FINERACT-1971: Installment level delinquency for loan modification
This commit is contained in:
committed by
Adam Saghy
parent
582742d2ef
commit
8b2c9da804
+2
@@ -1372,6 +1372,8 @@ final class LoansApiResourceSwagger {
|
||||
public List<PutLoansLoanIdDisbursementData> disbursementData;
|
||||
@Schema(example = "HORIZONTAL")
|
||||
public String loanScheduleProcessingType;
|
||||
@Schema(example = "false")
|
||||
public Boolean enableInstallmentLevelDelinquency;
|
||||
|
||||
static final class PutLoansLoanIdChanges {
|
||||
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ public final class CalculateLoanScheduleQueryFromApiJsonHelper {
|
||||
LoanApiConstants.repaymentFrequencyDayOfWeekTypeParameterName, LoanApiConstants.isTopup, LoanApiConstants.loanIdToClose,
|
||||
LoanApiConstants.datatables, LoanApiConstants.isEqualAmortizationParam, LoanProductConstants.RATES_PARAM_NAME,
|
||||
LoanApiConstants.daysInYearTypeParameterName, LoanApiConstants.fixedPrincipalPercentagePerInstallmentParamName,
|
||||
LoanProductConstants.FIXED_LENGTH));
|
||||
LoanProductConstants.FIXED_LENGTH, LoanProductConstants.ENABLE_INSTALLMENT_LEVEL_DELINQUENCY));
|
||||
|
||||
private final FromJsonHelper fromApiJsonHelper;
|
||||
|
||||
|
||||
+14
@@ -1134,6 +1134,20 @@ public final class LoanApplicationCommandFromApiJsonHelper {
|
||||
advancedPaymentAllocationsValidator.checkGroupingOfAllocationRules(allocationRules);
|
||||
}
|
||||
|
||||
if (this.fromApiJsonHelper.parameterExists(LoanProductConstants.ENABLE_INSTALLMENT_LEVEL_DELINQUENCY, element)) {
|
||||
final Boolean isEnableInstallmentLevelDelinquency = this.fromApiJsonHelper
|
||||
.extractBooleanNamed(LoanProductConstants.ENABLE_INSTALLMENT_LEVEL_DELINQUENCY, element);
|
||||
baseDataValidator.reset().parameter(LoanProductConstants.ENABLE_INSTALLMENT_LEVEL_DELINQUENCY)
|
||||
.value(isEnableInstallmentLevelDelinquency).validateForBooleanValue();
|
||||
if (loanProduct.getDelinquencyBucket() == null) {
|
||||
if (isEnableInstallmentLevelDelinquency) {
|
||||
baseDataValidator.reset().parameter(LoanProductConstants.ENABLE_INSTALLMENT_LEVEL_DELINQUENCY).failWithCode(
|
||||
"can.be.enabled.for.loan.with.loan.product.having.valid.delinquency.bucket",
|
||||
"Installment level delinquency cannot be enabled for a loan if Delinquency bucket is not configured for loan product");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!dataValidationErrors.isEmpty()) {
|
||||
throw new PlatformApiDataValidationException("validation.msg.validation.errors.exist", "Validation errors exist.",
|
||||
dataValidationErrors);
|
||||
|
||||
+8
@@ -970,6 +970,14 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
||||
existingLoanApplication.updateLoanCharges(possiblyModifedLoanCharges);
|
||||
}
|
||||
|
||||
// update installment level delinquency
|
||||
if (command.isChangeInBooleanParameterNamed(LoanProductConstants.ENABLE_INSTALLMENT_LEVEL_DELINQUENCY,
|
||||
existingLoanApplication.isEnableInstallmentLevelDelinquency())) {
|
||||
final Boolean enableInstallmentLevelDelinquency = command
|
||||
.booleanObjectValueOfParameterNamed(LoanProductConstants.ENABLE_INSTALLMENT_LEVEL_DELINQUENCY);
|
||||
existingLoanApplication.updateEnableInstallmentLevelDelinquency(enableInstallmentLevelDelinquency);
|
||||
}
|
||||
|
||||
if (changes.containsKey("recalculateLoanSchedule")) {
|
||||
changes.remove("recalculateLoanSchedule");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user