FINERACT-2205: Add tests when charge is added after the charge off date and forbid backdated charge-off transactions in the middle of the monetary activity.

This commit is contained in:
mariiaKraievska
2025-02-03 16:29:45 +01:00
committed by Adam Saghy
parent bc0293bfa1
commit 69317d62c8
11 changed files with 582 additions and 215 deletions
@@ -3201,6 +3201,12 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
transactionDate);
}
if (loan.hasMonetaryActivityAfter(transactionDate)) {
throw new GeneralPlatformDomainRuleException("error.msg.loan.monetary.transactions.after.charge.off",
"Loan: " + loanId + " charge-off cannot be executed. Loan has monetary activity after the charge-off transaction date!",
loanId);
}
businessEventNotifierService.notifyPreBusinessEvent(new LoanChargeOffPreBusinessEvent(loan));
if (command.hasParameter(LoanApiConstants.chargeOffReasonIdParamName)) {