bug fix: MIFOSX-201 and MIFOSX-202

This commit is contained in:
ashok-conflux
2013-03-27 19:31:20 +05:30
parent c77f3e15f1
commit ca038a8ebf
2 changed files with 7 additions and 1 deletions
@@ -37,7 +37,7 @@ public class DefaultLoanLifecycleStateMachine implements LoanLifecycleStateMachi
} }
break; break;
case LOAN_WITHDRAWN: 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); newState = stateOf(LoanStatus.WITHDRAWN_BY_CLIENT, allowedLoanStatuses);
} }
break; break;
@@ -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."; 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); 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; 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."; 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); 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; return actualChanges;