FINERACT-1901-NPE-Reject-Loan-Api-Business-Event

This commit is contained in:
Ruchi Dhamankar
2023-02-23 11:18:22 +01:00
committed by Adam Saghy
parent 77da04fa7d
commit 670e0d55a3
2 changed files with 121 additions and 3 deletions
@@ -2166,9 +2166,6 @@ public class Loan extends AbstractAuditableWithUTCDateTimeCustom {
final LoanStatus statusEnum = loanLifecycleStateMachine.dryTransition(LoanEvent.LOAN_REJECTED, this);
if (!statusEnum.hasStateOf(LoanStatus.fromInt(this.loanStatus))) {
loanLifecycleStateMachine.transition(LoanEvent.LOAN_REJECTED, this);
actualChanges.put(PARAM_STATUS, LoanEnumerations.status(this.loanStatus));
final LocalDate rejectedOn = command.localDateValueOfParameterNamed(REJECTED_ON_DATE);
final Locale locale = new Locale(command.locale());
@@ -2179,6 +2176,9 @@ public class Loan extends AbstractAuditableWithUTCDateTimeCustom {
this.closedOnDate = rejectedOn;
this.closedBy = currentUser;
loanLifecycleStateMachine.transition(LoanEvent.LOAN_REJECTED, this);
actualChanges.put(PARAM_STATUS, LoanEnumerations.status(this.loanStatus));
actualChanges.put(LOCALE, command.locale());
actualChanges.put(DATE_FORMAT, command.dateFormat());
actualChanges.put(REJECTED_ON_DATE, rejectedOn.format(fmt));