[ 
https://issues.apache.org/jira/browse/FINERACT-2944?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18128280#comment-18128280
 ] 

chinmaya samantara commented on FINERACT-2944:
----------------------------------------------

Fixed by https://github.com/apache/fineract/pull/6644, which is merged. Could 
this be marked Resolved?

> POST /collectionsheet?command=saveCollectionSheet returns 200 but does not 
> create the loan repayments
> -----------------------------------------------------------------------------------------------------
>
>                 Key: FINERACT-2944
>                 URL: https://issues.apache.org/jira/browse/FINERACT-2944
>             Project: Apache Fineract
>          Issue Type: Bug
>            Reporter: chinmaya samantara
>            Assignee: chinmaya samantara
>            Priority: Major
>
> Saving an individual collection sheet returns HTTP 200 but no loan repayment 
> is created. The loan balance does not change and the response has no 
> {{loanTransactions}}.
> *Steps to reproduce* (any active individual loan with an installment due, 
> e.g. loan 3)
> {code:json}
> POST /fineract-provider/api/v1/collectionsheet?command=saveCollectionSheet
> {
>   "dateFormat": "dd MMMM yyyy", "locale": "en",
>   "transactionDate": "13 October 2026", "actualDisbursementDate": "13 October 
> 2026",
>   "bulkRepaymentTransactions": [ { "loanId": 3, "transactionAmount": 100 } ],
>   "bulkSavingsDueTransactions": []
> }
> {code}
> *Actual result:* {{\{"changes":\{"dateFormat":"dd MMMM 
> yyyy","SavingsTransactions":[],"locale":"en"\}\}}}, and no repayment on loan 
> 3. The same happens when the lists are nested inside 
> {{bulkDisbursementTransactions}} (the shape of the CollectionSheetRequest 
> schema in Swagger).
> *Expected result:* the repayment is created (as documented in the API docs: 
> {{bulkRepaymentTransactions}} at the top level) and its id is returned in 
> {{changes.loanTransactions}}.
> *Cause*
> Since FINERACT-2169 (commit a9fe523eae, "Refactor collection sheet api") 
> CollectionSheetApiResource binds the body to CollectionSheetRequest and 
> re-serializes it before processing. CollectionSheetRequest only has 
> {{bulkDisbursementTransactions}} as an object holding 
> {{bulkRepaymentTransactions}} and {{bulkSavingsDueTransactions}}, so a 
> top-level {{bulkRepaymentTransactions}} (and {{note}}) is dropped. 
> CollectionSheetBulkRepaymentCommandFromApiJsonDeserializer and 
> CollectionSheetTransactionDataValidator still read 
> {{bulkRepaymentTransactions}} at the top level, so the nested shape is 
> ignored too.
> Also, CollectionSheetBulkRepaymentCommandFromApiJsonDeserializer skips a 
> repayment when {{transactionAmount.intValue() > 0}} is false, so a repayment 
> below 1 (e.g. 0.50) is dropped.
> *Suggested fix:* make CollectionSheetRequest match the documented request 
> (top-level {{bulkDisbursementTransactions}}, {{bulkRepaymentTransactions}}, 
> {{bulkSavingsDueTransactions}} lists and {{note}}), compare the amount with 
> zero instead of using intValue(), and add an integration test that saves an 
> individual collection sheet.
> Related: FINERACT-2362. Checked on develop ddb1ca04bb.



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

Reply via email to