FINERACT-2081: clear closed_on date on repayment reversal

This commit is contained in:
Kristof Jozsa
2024-08-09 07:51:48 +02:00
committed by Adam Saghy
parent 69dd19c74b
commit c70007e30a
3 changed files with 43 additions and 0 deletions
@@ -49,6 +49,20 @@ public class DefaultLoanLifecycleStateMachine implements LoanLifecycleStateMachi
// in case of Loan creation, a LoanCreatedBusinessEvent is also raised, no need to send a status change
businessEventNotifierService.notifyPostBusinessEvent(new LoanStatusChangedBusinessEvent(loan));
}
// set mandatory field states based on new status after the transition
switch (newStatus) {
case ACTIVE -> {
if (loan.getClosedOnDate() != null) {
loan.setClosedOnDate(null);
}
if (loan.getOverpaidOnDate() != null) {
loan.setOverpaidOnDate(null);
}
}
default -> {
}
}
}
}