FINERACT-2326: Capitalized Income transaction template considering over applied amount when enabled - #4877
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.
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.
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.
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.
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 |
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.