-
Notifications
You must be signed in to change notification settings - Fork 2.2k
FINERACT-2354: Validation of Re-age amount during submission #5183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
FINERACT-2354: Validation of Re-age amount during submission #5183
Conversation
b72208d to
2bd9427
Compare
2bd9427 to
1c15211
Compare
|
@alberto-art3ch Please rebase |
| this.resourceId = resourceId; | ||
| this.commandId = null; | ||
| this.jsonCommand = null; | ||
| this.jsonCommand = parsedCommand.toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure this is correct.
| if (command.parameterExists(LoanReAgingApiConstants.transactionAmountParamName)) { | ||
| final BigDecimal transactionAmount = command | ||
| .bigDecimalValueOfParameterNamed(LoanReAgingApiConstants.transactionAmountParamName); | ||
| final BigDecimal totalReAgeAmount = totalPrincipalOutstanding.add(loan.getSummary().getTotalInterestOutstanding()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think this is correct. We should move this validation out from this and make the check after the correct "reage" amount was calculated by Fineract. After we have this information we can do the check and throw error if needed.
adamsaghy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kindly see my review!
|
@alberto-art3ch Please rebase. |
Description
There is a Scenario where the total outstanding amount could change during the time the re-age is previewed and applied.
Example
When the re-age preview is called, the total outstanding of the loan was $250, and a repayment was made before the re-age was applied, which had reduced the total outstanding of the loan to $200. which is an edge case.
In this case, the system should not allow the re-age to be applied for $250
FINERACT-2354
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
FYI our guidelines for code reviews are at https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide.