bug fix: MIFOSX-201 and MIFOSX-202
This commit is contained in:
+1
-1
@@ -37,7 +37,7 @@ public class DefaultLoanLifecycleStateMachine implements LoanLifecycleStateMachi
|
||||
}
|
||||
break;
|
||||
case LOAN_WITHDRAWN:
|
||||
if (this.anyOfAllowedWhenComingFrom(from, LoanStatus.SUBMITTED_AND_PENDING_APPROVAL, LoanStatus.APPROVED)) {
|
||||
if (this.anyOfAllowedWhenComingFrom(from, LoanStatus.SUBMITTED_AND_PENDING_APPROVAL)) {
|
||||
newState = stateOf(LoanStatus.WITHDRAWN_BY_CLIENT, allowedLoanStatuses);
|
||||
}
|
||||
break;
|
||||
|
||||
+6
@@ -1099,6 +1099,9 @@ public class Loan extends AbstractPersistable<Long> {
|
||||
final String errorMessage = "The date on which a loan is rejected cannot be in the future.";
|
||||
throw new InvalidLoanStateTransitionException("reject", "cannot.be.a.future.date", errorMessage, rejectedOn);
|
||||
}
|
||||
}else{
|
||||
final String errorMessage = "Only the Loan applications with status 'Submitted and Pending approval' are allowed to reject.";
|
||||
throw new InvalidLoanStateTransitionException("reject", "cannot.reject", errorMessage);
|
||||
}
|
||||
|
||||
return actualChanges;
|
||||
@@ -1143,6 +1146,9 @@ public class Loan extends AbstractPersistable<Long> {
|
||||
final String errorMessage = "The date on which a loan is withdrawn cannot be in the future.";
|
||||
throw new InvalidLoanStateTransitionException("reject", "cannot.be.a.future.date", errorMessage, command);
|
||||
}
|
||||
}else{
|
||||
final String errorMessage = "Only the Loan applications with status 'Submitted and Pending approval' are allowed to Withdraw By Client.";
|
||||
throw new InvalidLoanStateTransitionException("withdraw", "cannot.withdraw", errorMessage);
|
||||
}
|
||||
|
||||
return actualChanges;
|
||||
|
||||
Reference in New Issue
Block a user