FINERACT-2148: Add 'Accelerate maturity' charge-off behaviour option

This commit is contained in:
leksinomi
2025-01-07 18:21:24 +01:00
committed by Adam Saghy
parent dfc1d3ebad
commit 2fbdbe9df7
6 changed files with 419 additions and 2 deletions
@@ -3290,6 +3290,18 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
loan.liftChargeOff();
loanTransactionRepository.saveAndFlush(chargedOffTransaction);
if (loan.isProgressiveSchedule()) {
final ScheduleGeneratorDTO scheduleGeneratorDTO = this.loanUtilService.buildScheduleGeneratorDTO(loan, null, null);
loanScheduleService.regenerateRepaymentScheduleWithInterestRecalculation(loan, scheduleGeneratorDTO);
ChangedTransactionDetail changedTransactionDetail = loan.reprocessTransactions();
if (changedTransactionDetail != null) {
for (final Map.Entry<Long, LoanTransaction> mapEntry : changedTransactionDetail.getNewTransactionMappings().entrySet()) {
loanAccountDomainService.saveLoanTransactionWithDataIntegrityViolationChecks(mapEntry.getValue());
accountTransfersWritePlatformService.updateLoanTransaction(mapEntry.getKey(), mapEntry.getValue());
}
replayedTransactionBusinessEventService.raiseTransactionReplayedEvents(changedTransactionDetail);
}
}
saveLoanWithDataIntegrityViolationChecks(loan);
postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds);
businessEventNotifierService.notifyPostBusinessEvent(new LoanUndoChargeOffBusinessEvent(chargedOffTransaction));