FINERACT-1992: Multi-dlnqcy - Configuration of Installment level delinquency

This commit is contained in:
Jose Alberto Hernandez
2023-10-18 09:27:52 +02:00
committed by Adam Saghy
parent e0d087320a
commit 73b77b9414
14 changed files with 142 additions and 20 deletions
@@ -460,6 +460,9 @@ public class Loan extends AbstractAuditableWithUTCDateTimeCustom {
@JoinColumn(name = "charged_off_by_userid")
private AppUser chargedOffBy;
@Column(name = "enable_installment_level_delinquency", nullable = false)
private boolean enableInstallmentLevelDelinquency = false;
public static Loan newIndividualLoanApplication(final String accountNo, final Client client, final Integer loanType,
final LoanProduct loanProduct, final Fund fund, final Staff officer, final CodeValue loanPurpose,
final String transactionProcessingStrategyCode, final LoanProductRelatedDetail loanRepaymentScheduleDetail,
@@ -7146,4 +7149,13 @@ public class Loan extends AbstractAuditableWithUTCDateTimeCustom {
public String getTransactionProcessingStrategyName() {
return transactionProcessingStrategyName;
}
public boolean isEnableInstallmentLevelDelinquency() {
return this.enableInstallmentLevelDelinquency;
}
public void updateEnableInstallmentLevelDelinquency(boolean enableInstallmentLevelDelinquency) {
this.enableInstallmentLevelDelinquency = enableInstallmentLevelDelinquency;
}
}
@@ -154,4 +154,6 @@ public interface LoanProductConstants {
String REPAYMENT_START_DATE_TYPE = "repaymentStartDateType";
String DISABLE_SCHEDULE_EXTENSION_FOR_DOWN_PAYMENT = "disableScheduleExtensionForDownPayment";
String ENABLE_INSTALLMENT_LEVEL_DELINQUENCY = "enableInstallmentLevelDelinquency";
}
@@ -207,6 +207,9 @@ public class LoanProduct extends AbstractPersistableCustom {
@JoinColumn(name = "delinquency_bucket_id")
private DelinquencyBucket delinquencyBucket;
@Column(name = "enable_installment_level_delinquency", nullable = false)
private boolean enableInstallmentLevelDelinquency = false;
@Column(name = "due_days_for_repayment_event")
private Integer dueDaysForRepaymentEvent;
@@ -403,6 +406,9 @@ public class LoanProduct extends AbstractPersistableCustom {
final boolean disableScheduleExtensionForDownPayment = command
.booleanPrimitiveValueOfParameterNamed(LoanProductConstants.DISABLE_SCHEDULE_EXTENSION_FOR_DOWN_PAYMENT);
final boolean enableInstallmentLevelDelinquency = command
.booleanPrimitiveValueOfParameterNamed(LoanProductConstants.ENABLE_INSTALLMENT_LEVEL_DELINQUENCY);
return new LoanProduct(fund, loanTransactionProcessingStrategy, loanProductPaymentAllocationRules, name, shortName, description,
currency, principal, minPrincipal, maxPrincipal, interestRatePerPeriod, minInterestRatePerPeriod, maxInterestRatePerPeriod,
interestFrequencyType, annualInterestRate, interestMethod, interestCalculationPeriodMethod,
@@ -420,7 +426,8 @@ public class LoanProduct extends AbstractPersistableCustom {
syncExpectedWithDisbursementDate, canUseForTopup, isEqualAmortization, productRates, fixedPrincipalPercentagePerInstallment,
disallowExpectedDisbursements, allowApprovedDisbursedAmountsOverApplied, overAppliedCalculationType, overAppliedNumber,
dueDaysForRepaymentEvent, overDueDaysForRepaymentEvent, enableDownPayment, disbursedAmountPercentageDownPayment,
enableAutoRepaymentForDownPayment, repaymentStartDateType, disableScheduleExtensionForDownPayment);
enableAutoRepaymentForDownPayment, repaymentStartDateType, disableScheduleExtensionForDownPayment,
enableInstallmentLevelDelinquency);
}
@@ -635,7 +642,7 @@ public class LoanProduct extends AbstractPersistableCustom {
final Integer overAppliedNumber, final Integer dueDaysForRepaymentEvent, final Integer overDueDaysForRepaymentEvent,
final boolean enableDownPayment, final BigDecimal disbursedAmountPercentageForDownPayment,
final boolean enableAutoRepaymentForDownPayment, final RepaymentStartDateType repaymentStartDateType,
final boolean disableScheduleExtensionForDownPayment) {
final boolean disableScheduleExtensionForDownPayment, final boolean enableInstallmentLevelDelinquency) {
this.fund = fund;
this.transactionProcessingStrategyCode = transactionProcessingStrategyCode;
@@ -731,6 +738,8 @@ public class LoanProduct extends AbstractPersistableCustom {
this.overDueDaysForRepaymentEvent = overDueDaysForRepaymentEvent;
this.repaymentStartDateType = repaymentStartDateType;
this.enableInstallmentLevelDelinquency = enableInstallmentLevelDelinquency;
validateLoanProductPreSave();
}
@@ -1307,6 +1316,14 @@ public class LoanProduct extends AbstractPersistableCustom {
this.loanProductRelatedDetail.updateDisableScheduleExtensionForDownPayment(newValue);
}
if (command.isChangeInBooleanParameterNamed(LoanProductConstants.ENABLE_INSTALLMENT_LEVEL_DELINQUENCY,
this.isEnableInstallmentLevelDelinquency())) {
final boolean newValue = command
.booleanPrimitiveValueOfParameterNamed(LoanProductConstants.ENABLE_INSTALLMENT_LEVEL_DELINQUENCY);
actualChanges.put(LoanProductConstants.ENABLE_INSTALLMENT_LEVEL_DELINQUENCY, newValue);
this.updateEnableInstallmentLevelDelinquency(newValue);
}
return actualChanges;
}
@@ -1706,4 +1723,12 @@ public class LoanProduct extends AbstractPersistableCustom {
return this.repaymentStartDateType == null ? RepaymentStartDateType.INVALID : this.repaymentStartDateType;
}
public boolean isEnableInstallmentLevelDelinquency() {
return enableInstallmentLevelDelinquency;
}
public void updateEnableInstallmentLevelDelinquency(boolean enableInstallmentLevelDelinquency) {
this.enableInstallmentLevelDelinquency = enableInstallmentLevelDelinquency;
}
}
@@ -728,4 +728,5 @@ public class LoanProductRelatedDetail implements LoanProductMinimumRepaymentSche
public void updateDisableScheduleExtensionForDownPayment(boolean disableScheduleExtensionForDownPayment) {
this.disableScheduleExtensionForDownPayment = disableScheduleExtensionForDownPayment;
}
}