Merge pull request #1511 from nazeer1100126/DisablingReschedule
MIFOSX-2258
This commit is contained in:
+5
-1
@@ -1477,10 +1477,14 @@ public class Loan extends AbstractPersistable<Long> {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isInterestRecalculationEnabledForProduct() {
|
||||
public boolean isInterestRecalculationEnabledForProduct() {
|
||||
return this.loanProduct.isInterestRecalculationEnabled();
|
||||
}
|
||||
|
||||
public boolean isMultiDisburmentLoan() {
|
||||
return this.loanProduct.isMultiDisburseLoan() ;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update interest recalculation settings if product configuration changes
|
||||
*/
|
||||
|
||||
+3
-1
@@ -31,7 +31,9 @@ public class RescheduleLoansApiConstants {
|
||||
public static final String rescheduleReasonCommentParamName = "rescheduleReasonComment";
|
||||
public static final String submittedOnDateParamName = "submittedOnDate";
|
||||
public static final String adjustedDueDateParamName = "adjustedDueDate";
|
||||
|
||||
public static final String resheduleForMultiDisbursementNotSupportedErrorCode = "loan.reschedule.multidisbursement.error.code";
|
||||
public static final String resheduleWithInterestRecalculationNotSupportedErrorCode = "loan.reschedule.interestrecalculation.error.code";
|
||||
|
||||
public static final Set<String> CREATE_REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(localeParamName, dateFormatParamName,
|
||||
graceOnPrincipalParamName, graceOnInterestParamName, extraTermsParamName, rescheduleFromDateParamName,
|
||||
newInterestRateParamName, rescheduleReasonIdParamName, rescheduleReasonCommentParamName, submittedOnDateParamName,
|
||||
|
||||
+10
-1
@@ -161,7 +161,16 @@ public class LoanRescheduleRequestDataValidator {
|
||||
"The loan can only be rescheduled once.");
|
||||
}
|
||||
}
|
||||
|
||||
if(loan.isMultiDisburmentLoan()) {
|
||||
dataValidatorBuilder.reset().failWithCodeNoParameterAddedToErrorCode(RescheduleLoansApiConstants.resheduleForMultiDisbursementNotSupportedErrorCode,
|
||||
"Loan rescheduling is not supported for multidisbursement loans");
|
||||
}
|
||||
|
||||
if(loan.isInterestRecalculationEnabledForProduct()) {
|
||||
dataValidatorBuilder.reset().failWithCodeNoParameterAddedToErrorCode(RescheduleLoansApiConstants.resheduleWithInterestRecalculationNotSupportedErrorCode,
|
||||
"Loan rescheduling is not supported for the loan product with interest recalculation enabled");
|
||||
}
|
||||
|
||||
if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException(dataValidationErrors); }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user