You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by "Adam Saghy (Jira)" <ji...@apache.org> on 2026/10/15 09:32:00 UTC

[jira] [Resolved] (FINERACT-2933) GET /clients/{clientId}/collaterals returns an empty list unless prodId is given

     [ https://issues.apache.org/jira/browse/FINERACT-2933?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Adam Saghy resolved FINERACT-2933.
----------------------------------
    Resolution: Fixed

> GET /clients/{clientId}/collaterals returns an empty list unless prodId is given
> --------------------------------------------------------------------------------
>
>                 Key: FINERACT-2933
>                 URL: https://issues.apache.org/jira/browse/FINERACT-2933
>             Project: Apache Fineract
>          Issue Type: Bug
>            Reporter: chinmaya samantara
>            Assignee: chinmaya samantara
>            Priority: Minor
>             Fix For: 1.16.0
>
>
> *GET /clients/\{clientId}/collaterals* always returns an empty list when the optional *prodId* query parameter is not given, even though the client has collaterals.
> *Steps to reproduce*
> # Create a collateral product (POST /collateral-management) and add it to a client:
> {code:json}
> POST /fineract-provider/api/v1/clients/2/collaterals
> { "collateralId": 1, "quantity": "2", "locale": "en" }
> {code}
> # GET /fineract-provider/api/v1/clients/2/collaterals
> *Actual result:* {{[]}}
> The collateral exists: GET /clients/2/collaterals/1 returns it, and GET /clients/2/collaterals?prodId=1 lists it.
> *Expected result:* without prodId, all of the client's collaterals are listed. With prodId, only the collaterals in the loan product's currency (current behaviour).
> *Cause*
> ClientCollateralManagementRepositoryWrapper.getClientCollateralData() only adds a collateral when {{prodId != null && <currency matches>}}, so with no prodId nothing is ever added. The currency filter should only apply when a loan product is given: {{prodId == null || <currency matches>}}. The code has been like this since the collateral module was added (apache/fineract PR #1770, 2021).
> Checked on develop 6bb3c0c293.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)