MIFOSX-1842 Adding validation for add/delete tranche based on loan status.
This commit is contained in:
+1
-1
@@ -885,7 +885,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
loan.regenerateRepaymentSchedule(scheduleGeneratorDTO, currentUser);
|
loan.regenerateRepaymentSchedule(scheduleGeneratorDTO, currentUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.loanRepository.save(loan);
|
saveAndFlushLoanWithDataIntegrityViolationChecks(loan);
|
||||||
|
|
||||||
final String noteText = command.stringValueOfParameterNamed("note");
|
final String noteText = command.stringValueOfParameterNamed("note");
|
||||||
if (StringUtils.isNotBlank(noteText)) {
|
if (StringUtils.isNotBlank(noteText)) {
|
||||||
|
|||||||
+3
-2
@@ -2612,8 +2612,9 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
|||||||
final String errorMessage = "loan.product.does.not.support.multiple.disbursals";
|
final String errorMessage = "loan.product.does.not.support.multiple.disbursals";
|
||||||
throw new LoanMultiDisbursementException(LoanApiConstants.disbursementDataParameterName, errorMessage);
|
throw new LoanMultiDisbursementException(LoanApiConstants.disbursementDataParameterName, errorMessage);
|
||||||
}
|
}
|
||||||
if(loan.isSubmittedAndPendingApproval()){
|
if(loan.isSubmittedAndPendingApproval() || loan.isClosed() || loan.isClosedWrittenOff() || loan.status().isClosedObligationsMet() ||
|
||||||
final String errorMessage = "loan.account.should.be.approved";
|
loan.status().isOverpaid()){
|
||||||
|
final String errorMessage = "cannot.modify.tranches.if.loan.is.pendingapproval.closed.overpaid.writtenoff";
|
||||||
throw new LoanMultiDisbursementException(LoanApiConstants.disbursementDataParameterName, errorMessage);
|
throw new LoanMultiDisbursementException(LoanApiConstants.disbursementDataParameterName, errorMessage);
|
||||||
}
|
}
|
||||||
validateMultiDisbursementData(command, expectedDisbursementDate);
|
validateMultiDisbursementData(command, expectedDisbursementDate);
|
||||||
|
|||||||
Reference in New Issue
Block a user