FINERACT-2319: Add penalty-first payment allocation strategy for progressive loans with backdated repayment charge handling

This commit is contained in:
Oleksii Novikov
2025-07-10 13:38:56 +02:00
committed by Adam Saghy
parent 68b2fcb7e1
commit fc93db16b5
12 changed files with 219 additions and 49 deletions
@@ -904,6 +904,7 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService {
boolean processLatest = isTransactionChronologicallyLatest //
&& !loan.isForeclosure() //
&& !loan.hasChargesAffectedByBackdatedRepaymentLikeTransaction(refundTransaction) //
&& loanTransactionProcessingService.canProcessLatestTransactionOnly(loan, refundTransaction, currentInstallment); //
if (processLatest) {
loanTransactionProcessingService.processLatestTransaction(loan.getTransactionProcessingStrategyCode(), refundTransaction,
@@ -74,6 +74,9 @@ public class LoanTransactionProcessingServiceImpl implements LoanTransactionProc
if (!DateUtils.isEqualBusinessDate(loanTransaction.getTransactionDate())) {
return false;
}
if (loan.hasChargesAffectedByBackdatedRepaymentLikeTransaction(loanTransaction)) {
return false;
}
LoanInterestRecalculationDetails interestRecalculationDetails = loan.getLoanInterestRecalculationDetails();
if (interestRecalculationDetails != null && ((interestRecalculationDetails.getRestFrequencyType().isSameAsRepayment()
&& interestRecalculationDetails.getPreCloseInterestCalculationStrategy().calculateTillPreClosureDateEnabled())