Skip to content

Conversation

@alberto-art3ch
Copy link
Contributor

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!

  • Write the commit message as per https://github.com/apache/fineract/#pull-requests
  • Acknowledge that we will not review PRs that are not passing the build ("green") - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.
  • Create/update unit or integration tests for verifying the changes made.
  • Follow coding conventions at https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions.
  • Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes
  • Submission is not a "code dump". (Large changes can be made "in repository" via a branch. Ask on the developer mailing list for guidance, if required.)

FYI our guidelines for code reviews are at https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide.

@alberto-art3ch alberto-art3ch force-pushed the FINERACT-2354/validation-of-re-age-amount-during-submission branch 4 times, most recently from b72208d to 2bd9427 Compare November 28, 2025 13:10
@alberto-art3ch alberto-art3ch force-pushed the FINERACT-2354/validation-of-re-age-amount-during-submission branch from 2bd9427 to 1c15211 Compare November 28, 2025 16:26
@adamsaghy
Copy link
Contributor

@alberto-art3ch Please rebase

this.resourceId = resourceId;
this.commandId = null;
this.jsonCommand = null;
this.jsonCommand = parsedCommand.toString();
Copy link
Contributor

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());
Copy link
Contributor

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.

Copy link
Contributor

@adamsaghy adamsaghy left a 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants