FINERACT-2059: Re-aging repayment schedule handling
This commit is contained in:
committed by
Arnold Gálovics
parent
52f614df59
commit
e66da3eaba
+1
-1
@@ -1335,7 +1335,7 @@ public class AdvancedPaymentScheduleTransactionProcessor extends AbstractLoanRep
|
||||
}
|
||||
|
||||
private void reprocessInstallmentsOrder(List<LoanRepaymentScheduleInstallment> installments) {
|
||||
AtomicInteger counter = new AtomicInteger(0);
|
||||
AtomicInteger counter = new AtomicInteger(1);
|
||||
installments.stream().sorted(LoanRepaymentScheduleInstallment::compareToByDueDate)
|
||||
.forEachOrdered(i -> i.updateInstallmentNumber(counter.getAndIncrement()));
|
||||
}
|
||||
|
||||
+3
@@ -462,6 +462,7 @@ public abstract class BaseLoanIntegrationTest {
|
||||
Assertions.assertEquals(installments.length, loanResponse.getRepaymentSchedule().getPeriods().size(),
|
||||
"Expected installments are not matching with the installments configured on the loan");
|
||||
|
||||
int installmentNumber = 0;
|
||||
for (int i = 1; i < installments.length; i++) {
|
||||
GetLoansLoanIdRepaymentPeriod period = loanResponse.getRepaymentSchedule().getPeriods().get(i);
|
||||
Double principalDue = period.getPrincipalDue();
|
||||
@@ -546,6 +547,8 @@ public abstract class BaseLoanIntegrationTest {
|
||||
outstandingTotalExpected, outstandingTotal));
|
||||
}
|
||||
|
||||
installmentNumber++;
|
||||
Assertions.assertEquals(installmentNumber, period.getPeriod());
|
||||
}
|
||||
Assertions.assertEquals(installments[i].completed, period.getComplete());
|
||||
Assertions.assertEquals(LocalDate.parse(installments[i].dueDate, dateTimeFormatter), period.getDueDate());
|
||||
|
||||
Reference in New Issue
Block a user