-
Notifications
You must be signed in to change notification settings - Fork 2.2k
FINERACT-2326: Capitalized Income transaction template considering over applied amount when enabled #4877
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
Conversation
48df271 to
2c3eef1
Compare
2c3eef1 to
0956bf9
Compare
| import org.springframework.stereotype.Component; | ||
|
|
||
| @Component | ||
| public final class LoanMaximumAmountValidator { |
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 would not call this a validator as it doesn't really validate anything. Please rename it and maybe move it out of the serialization package as well.
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.
Done! I've renamed this class
| final BigDecimal maxAppliedAmount = getOverAppliedMax(loan); | ||
| final BigDecimal maxAppliedAmount = loanMaximumAmountValidator.getOverAppliedMax(loan); | ||
| if (newTotal.compareTo(maxAppliedAmount) > 0) { | ||
| baseDataValidator.reset().parameter("transactionAmount").failWithCode("exceeds.approved.amount", |
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.
Should we consider changing the error code? We aren't really comparing the transaction amount to the approved amount in this case.
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 don't know, this is a part of legacy code, I've just change from the local method to the other class
|
The description references FINERACT-2181, but since we have already released 1.12.0 it should reference FINERACT-2326. Same with the branch. |
|
@alberto-art3ch Please rebase your PR! |
…er applied amount when enabled
1e6c6f3 to
0d935c1
Compare
@adamsaghy PR rebased |
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.
LGTM
Description
We need the calculations with CI to reflect the right amount even when the Allow approval / disbursal above loan applied amount setting enabled and look like that:
Disbursement + CI <= Approved (including over applied amount when enabled)FINERACT-2181
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.