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();
|
return this.loanProduct.isInterestRecalculationEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isMultiDisburmentLoan() {
|
||||||
|
return this.loanProduct.isMultiDisburseLoan() ;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update interest recalculation settings if product configuration changes
|
* Update interest recalculation settings if product configuration changes
|
||||||
*/
|
*/
|
||||||
|
|||||||
+2
@@ -31,6 +31,8 @@ public class RescheduleLoansApiConstants {
|
|||||||
public static final String rescheduleReasonCommentParamName = "rescheduleReasonComment";
|
public static final String rescheduleReasonCommentParamName = "rescheduleReasonComment";
|
||||||
public static final String submittedOnDateParamName = "submittedOnDate";
|
public static final String submittedOnDateParamName = "submittedOnDate";
|
||||||
public static final String adjustedDueDateParamName = "adjustedDueDate";
|
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,
|
public static final Set<String> CREATE_REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(localeParamName, dateFormatParamName,
|
||||||
graceOnPrincipalParamName, graceOnInterestParamName, extraTermsParamName, rescheduleFromDateParamName,
|
graceOnPrincipalParamName, graceOnInterestParamName, extraTermsParamName, rescheduleFromDateParamName,
|
||||||
|
|||||||
+9
@@ -161,6 +161,15 @@ public class LoanRescheduleRequestDataValidator {
|
|||||||
"The loan can only be rescheduled once.");
|
"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); }
|
if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException(dataValidationErrors); }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user