FINERACT-2081: Charge-off optimalization

This commit is contained in:
Adam Saghy
2025-02-21 14:09:23 +01:00
parent e02420f998
commit 5137fd65af
7 changed files with 18 additions and 14 deletions
@@ -3584,4 +3584,8 @@ public class Loan extends AbstractAuditableWithUTCDateTimeCustom<Long> {
public boolean hasChargeOffTransaction() {
return getLoanTransactions().stream().anyMatch(LoanTransaction::isChargeOff);
}
public boolean hasAccelerateChargeOffStrategy() {
return LoanChargeOffBehaviour.ACCELERATE_MATURITY.equals(getLoanProductRelatedDetail().getChargeOffBehaviour());
}
}
@@ -154,7 +154,7 @@ public class LoanDownPaymentHandlerServiceImpl implements LoanDownPaymentHandler
if (reprocess) {
if (loan.isCumulativeSchedule() && loan.isInterestBearingAndInterestRecalculationEnabled()) {
loanScheduleService.regenerateRepaymentScheduleWithInterestRecalculation(loan, scheduleGeneratorDTO);
} else if (loan.isProgressiveSchedule() && loan.hasChargeOffTransaction()) {
} else if (loan.isProgressiveSchedule() && loan.hasChargeOffTransaction() && loan.hasAccelerateChargeOffStrategy()) {
loanScheduleService.regenerateRepaymentSchedule(loan, scheduleGeneratorDTO);
}
reprocessLoanTransactionsService.reprocessTransactions(loan);