fix(savings): allow modifyApplication for rejected Savings/FD/RD accounts
SavingsAccount.modifyApplication() previously blocked modification unless the account was in SUBMITTED_AND_PENDING_APPROVAL state. Extended to also allow REJECTED state so bank users can amend and re-submit rejected applications. When a rejected account is modified, status resets to SUBMITTED_AND_PENDING_APPROVAL (rejectedOnDate and rejectedBy cleared) so the account re-enters the approval workflow. Applies to Savings, FD, and RD accounts (all extend SavingsAccount). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
a051faba5d
commit
6e31ac9acd
+10
-1
@@ -1656,10 +1656,19 @@ public class SavingsAccount extends AbstractAuditableWithUTCDateTimeCustom<Long>
|
|||||||
final DataValidatorBuilder baseDataValidator) {
|
final DataValidatorBuilder baseDataValidator) {
|
||||||
|
|
||||||
final SavingsAccountStatusType currentStatus = SavingsAccountStatusType.fromInt(this.status);
|
final SavingsAccountStatusType currentStatus = SavingsAccountStatusType.fromInt(this.status);
|
||||||
if (!SavingsAccountStatusType.SUBMITTED_AND_PENDING_APPROVAL.hasStateOf(currentStatus)) {
|
final boolean isAllowedState = SavingsAccountStatusType.SUBMITTED_AND_PENDING_APPROVAL.hasStateOf(currentStatus)
|
||||||
|
|| SavingsAccountStatusType.REJECTED.hasStateOf(currentStatus);
|
||||||
|
if (!isAllowedState) {
|
||||||
baseDataValidator.reset().failWithCodeNoParameterAddedToErrorCode("not.in.submittedandpendingapproval.state");
|
baseDataValidator.reset().failWithCodeNoParameterAddedToErrorCode("not.in.submittedandpendingapproval.state");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// If modifying a rejected application, reset it back to pending approval
|
||||||
|
if (SavingsAccountStatusType.REJECTED.hasStateOf(currentStatus)) {
|
||||||
|
this.status = SavingsAccountStatusType.SUBMITTED_AND_PENDING_APPROVAL.getValue();
|
||||||
|
this.rejectedOnDate = null;
|
||||||
|
this.rejectedBy = null;
|
||||||
|
actualChanges.put("status", SavingsAccountStatusType.SUBMITTED_AND_PENDING_APPROVAL.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
final String localeAsInput = command.locale();
|
final String localeAsInput = command.locale();
|
||||||
final String dateFormat = command.dateFormat();
|
final String dateFormat = command.dateFormat();
|
||||||
|
|||||||
Reference in New Issue
Block a user