FINERACT-2181: Fix github actions not failing test runs on failed tests
- added validation for cumulative multidisburse loan applications for interest method - test fixes
This commit is contained in:
+17
@@ -214,6 +214,8 @@ public final class LoanApplicationValidator {
|
||||
expectedFirstRepaymentOnDate);
|
||||
}
|
||||
|
||||
validateCumulativeMultiDisburse(loan);
|
||||
|
||||
validateLoanTermAndRepaidEveryValues(loan.getTermFrequency(), loan.getTermPeriodFrequencyType().getValue(),
|
||||
loan.getLoanProductRelatedDetail().getNumberOfRepayments(), loan.getLoanProductRelatedDetail().getRepayEvery(),
|
||||
loan.getLoanProductRelatedDetail().getRepaymentPeriodFrequencyType().getValue(), loan);
|
||||
@@ -228,6 +230,8 @@ public final class LoanApplicationValidator {
|
||||
expectedFirstRepaymentOnDate);
|
||||
}
|
||||
|
||||
validateCumulativeMultiDisburse(loan);
|
||||
|
||||
validateLoanTermAndRepaidEveryValues(loan.getTermFrequency(), loan.getTermPeriodFrequencyType().getValue(),
|
||||
loan.getLoanProductRelatedDetail().getNumberOfRepayments(), loan.getLoanProductRelatedDetail().getRepayEvery(),
|
||||
loan.getLoanProductRelatedDetail().getRepaymentPeriodFrequencyType().getValue(), loan);
|
||||
@@ -2190,6 +2194,19 @@ public final class LoanApplicationValidator {
|
||||
}
|
||||
}
|
||||
|
||||
private static void validateCumulativeMultiDisburse(Loan loan) {
|
||||
if (loan.isCumulativeSchedule() && loan.isMultiDisburmentLoan()
|
||||
&& loan.getLoanProductRelatedDetail().getInterestMethod().isFlat()) {
|
||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
|
||||
final ApiParameterError error = ApiParameterError.generalError(
|
||||
"validation.msg.loan.cumulative.multidisburse.does.not.support.flat.interest.mode",
|
||||
"Cumulative multidisburse loan does NOT support FLAT interest mode.");
|
||||
dataValidationErrors.add(error);
|
||||
throw new PlatformApiDataValidationException("validation.msg.validation.errors.exist", "Validation errors exist.",
|
||||
dataValidationErrors);
|
||||
}
|
||||
}
|
||||
|
||||
private Calendar getCalendarInstance(Loan loan) {
|
||||
CalendarInstance calendarInstance = calendarInstanceRepository.findCalendarInstanceByEntityId(loan.getId(),
|
||||
CalendarEntityType.LOANS.getValue());
|
||||
|
||||
Reference in New Issue
Block a user