-
Notifications
You must be signed in to change notification settings - Fork 2.2k
FINERACT-2405: totalUnpaidPayableNotDueInterest resets to 0 on Charge-Off #5153
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
FINERACT-2405: totalUnpaidPayableNotDueInterest resets to 0 on Charge-Off #5153
Conversation
| | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | | ||
| | 546.14 | 24.69 | 0.0 | 10.0 | 580.83 | 308.59 | 308.59 | 0.0 | 272.24 | | ||
|
|
||
| @temp3 |
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.
do we need this temp3 tag?
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.
removed
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.
Tag removed, thanks
| Double totalUnpaidPayableNotDueInterestActual = loanDetailsResponse.body().getSummary().getTotalUnpaidPayableNotDueInterest() | ||
| .doubleValue(); | ||
| assertThat(totalUnpaidPayableNotDueInterestActual) | ||
| .as(ErrorMessageHelper.wrongAmountInTotalUnpaidPayableDueInterest(totalUnpaidPayableNotDueInterestActual, |
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.
This logic is a little bit strange with the naming. So the method says wrongAmountInTotalUnpaidPayableDueInterest, but we are checking totalUnpaidPayableNotDueInterestActual and totalUnpaidPayableNotDueInterestExpected. Which one are we actually checking?
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.
Method renamed to be more easy to understand the amount to be validated
1837481 to
f432d67
Compare
| @Override | ||
| public BigDecimal computeTotalUnpaidPayableDueInterestAmount(Collection<LoanSchedulePeriodData> periods, final LocalDate businessDate) { | ||
| return periods.stream().filter(period -> !period.isDownPaymentPeriod() && !businessDate.isBefore(period.getDueDate())) | ||
| return periods.stream().filter(period -> !period.isDownPaymentPeriod() && !period.getDueDate().isAfter(businessDate)) |
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.
@alberto-art3ch This cannot be right... on the due date it shall be part of the unpaid, payable, due interest amount.
| if (loan.isChargedOff() || loan.hasContractTerminationTransaction()) { | ||
| if (loan.isChargedOff()) { | ||
| return currentRepaymentPeriod.get().getInterestOutstanding(loan.getCurrency()).getAmount(); | ||
| } else if (loan.hasContractTerminationTransaction()) { |
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.
@alberto-art3ch I think the same shall apply to contract termination. Charge-off and Contract termination is quite similar in this case.
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.
Please see my questions.
20714a3 to
cf1aa62
Compare
f082afe to
5a775c1
Compare
5a775c1 to
66d7145
Compare
66d7145 to
5d328c9
Compare
Description
We were having an issue where the
totalUnpaidPayableNotDueInterestin summary gets reset to 0 when a loan is charged off even though there were unrealized accruals available in that installment.FINERACT-2405
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.