Skip to content

Commit e5571a8

Browse files
FINERACT-2412: Full term tranche - downpayment handling
1 parent 7dac82a commit e5571a8

File tree

4 files changed

+302
-0
lines changed

4 files changed

+302
-0
lines changed

fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/data/loanproduct/DefaultLoanProduct.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ public enum DefaultLoanProduct implements LoanProduct {
180180
LP1_INTEREST_FLAT_DAILY_ACTUAL_ACTUAL_MULTIDISB_EXPECT_TRANCHES, //
181181
LP2_ADV_PYMNT_360_30_ZERO_INTEREST_CHARGE_OFF_ACCRUAL_ACTIVITY, //
182182
LP2_ADV_CUSTOM_PMT_ALLOC_PROGRESSIVE_LOAN_SCHEDULE_HORIZONTAL_PRINCIPAL_FIRST, //
183+
LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE_FULL_TERM_TRANCHE, //
184+
LP2_ADV_PYMNT_INT_DAILY_EMI_360_30_INT_RECALC_DAILY_MULTIDISB_FULL_TERM_TRANCHE_DOWNPAYMENT, //
185+
LP2_ADV_PYMNT_INT_DAILY_EMI_360_30_INT_RECALC_DAILY_MULTIDISB_FULL_TERM_TRANCHE_DOWNPAYMENT_AUTO, //
183186
;
184187

185188
@Override

fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/initializer/global/LoanProductGlobalInitializerStep.java

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4262,6 +4262,111 @@ public void initialize() throws Exception {
42624262
TestContext.INSTANCE.set(
42634263
TestContextKey.DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADVANCED_CUSTOM_PAYMENT_ALLOCATION_PROGRESSIVE_LOAN_SCHEDULE_PRINCIPAL_FIRST,
42644264
responseLoanProductsRequestAdvCustomPaymentAllocationProgressiveLoanSchedulePrincipalFirst);
4265+
4266+
// LP2 with progressive loan schedule + horizontal + interest recalculation daily EMI + 360/30 +
4267+
// multidisbursement with full term tranche enabled
4268+
// Frequency for recalculate Outstanding Principal: Daily, Frequency Interval for recalculation: 1
4269+
// (LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE_FULL_TERM_TRANCHE)
4270+
String name152 = DefaultLoanProduct.LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE_FULL_TERM_TRANCHE
4271+
.getName();
4272+
PostLoanProductsRequest loanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyMultiDisburseFullTermTranche = loanProductsRequestFactory
4273+
.defaultLoanProductsRequestLP2Emi()//
4274+
.name(name152)//
4275+
.daysInYearType(DaysInYearType.DAYS360.value)//
4276+
.daysInMonthType(DaysInMonthType.DAYS30.value)//
4277+
.isInterestRecalculationEnabled(true)//
4278+
.preClosureInterestCalculationStrategy(1)//
4279+
.rescheduleStrategyMethod(4)//
4280+
.interestRecalculationCompoundingMethod(0)//
4281+
.recalculationRestFrequencyType(2)//
4282+
.recalculationRestFrequencyInterval(1)//
4283+
.paymentAllocation(List.of(//
4284+
createPaymentAllocation("DEFAULT", "NEXT_INSTALLMENT"), //
4285+
createPaymentAllocation("GOODWILL_CREDIT", "LAST_INSTALLMENT"), //
4286+
createPaymentAllocation("MERCHANT_ISSUED_REFUND", "REAMORTIZATION"), //
4287+
createPaymentAllocation("PAYOUT_REFUND", "NEXT_INSTALLMENT")))//
4288+
.multiDisburseLoan(true)//
4289+
.disallowExpectedDisbursements(false)//
4290+
.allowFullTermForTranche(true)//
4291+
.maxTrancheCount(10)//
4292+
.outstandingLoanBalance(10000.0);//
4293+
PostLoanProductsResponse responseLoanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyMultiDisburseFullTermTranche = createLoanProductIdempotent(
4294+
loanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyMultiDisburseFullTermTranche);
4295+
TestContext.INSTANCE.set(
4296+
TestContextKey.DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE_FULL_TERM_TRANCHE,
4297+
responseLoanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyMultiDisburseFullTermTranche);
4298+
4299+
// LP2 with progressive loan schedule + horizontal + interest recalculation daily EMI + 360/30 +
4300+
// multidisbursement with full term tranche enabled + Down Payment
4301+
// Frequency for recalculate Outstanding Principal: Daily, Frequency Interval for recalculation: 1
4302+
// (LP2_ADV_PYMNT_INT_DAILY_EMI_360_30_INT_RECALC_DAILY_MULTIDISB_FULL_TERM_TRANCHE_DOWNPAYMENT)
4303+
final String name153 = DefaultLoanProduct.LP2_ADV_PYMNT_INT_DAILY_EMI_360_30_INT_RECALC_DAILY_MULTIDISB_FULL_TERM_TRANCHE_DOWNPAYMENT
4304+
.getName();
4305+
final PostLoanProductsRequest loanProductsRequestLP2AdvPymntIntEmi36030IntRecalcDailyMultiDisbFullTermTrancheDownPayment = loanProductsRequestFactory
4306+
.defaultLoanProductsRequestLP2Emi()//
4307+
.name(name153)//
4308+
.daysInYearType(DaysInYearType.DAYS360.value)//
4309+
.daysInMonthType(DaysInMonthType.DAYS30.value)//
4310+
.isInterestRecalculationEnabled(true)//
4311+
.preClosureInterestCalculationStrategy(1)//
4312+
.rescheduleStrategyMethod(4)//
4313+
.interestRecalculationCompoundingMethod(0)//
4314+
.recalculationRestFrequencyType(2)//
4315+
.recalculationRestFrequencyInterval(1)//
4316+
.paymentAllocation(List.of(//
4317+
createPaymentAllocation("DEFAULT", "NEXT_INSTALLMENT"), //
4318+
createPaymentAllocation("GOODWILL_CREDIT", "LAST_INSTALLMENT"), //
4319+
createPaymentAllocation("MERCHANT_ISSUED_REFUND", "REAMORTIZATION"), //
4320+
createPaymentAllocation("PAYOUT_REFUND", "NEXT_INSTALLMENT")))//
4321+
.multiDisburseLoan(true)//
4322+
.disallowExpectedDisbursements(false)//
4323+
.allowFullTermForTranche(true)//
4324+
.enableDownPayment(true)//
4325+
.enableAutoRepaymentForDownPayment(false)//
4326+
.disbursedAmountPercentageForDownPayment(new BigDecimal(25))//
4327+
.maxTrancheCount(10)//
4328+
.outstandingLoanBalance(10000.0);//
4329+
final PostLoanProductsResponse responseLoanProductsRequestLP2AdvPymntIntEmi36030IntRecalcDailyMultiDisbFullTermTrancheDownPayment = createLoanProductIdempotent(
4330+
loanProductsRequestLP2AdvPymntIntEmi36030IntRecalcDailyMultiDisbFullTermTrancheDownPayment);
4331+
TestContext.INSTANCE.set(
4332+
TestContextKey.DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INT_DAILY_EMI_360_30_INT_RECALC_DAILY_MULTIDISB_FULL_TERM_TRANCHE_DOWNPAYMENT,
4333+
responseLoanProductsRequestLP2AdvPymntIntEmi36030IntRecalcDailyMultiDisbFullTermTrancheDownPayment);
4334+
4335+
// LP2 with progressive loan schedule + horizontal + interest recalculation daily EMI + 360/30 +
4336+
// multidisbursement with full term tranche enabled + Down Payment auto enabled
4337+
// Frequency for recalculate Outstanding Principal: Daily, Frequency Interval for recalculation: 1
4338+
// (LP2_ADV_PYMNT_INT_DAILY_EMI_360_30_INT_RECALC_DAILY_MULTIDISB_FULL_TERM_TRANCHE_DOWNPAYMENT_AUTO)
4339+
final String name154 = DefaultLoanProduct.LP2_ADV_PYMNT_INT_DAILY_EMI_360_30_INT_RECALC_DAILY_MULTIDISB_FULL_TERM_TRANCHE_DOWNPAYMENT_AUTO
4340+
.getName();
4341+
final PostLoanProductsRequest loanProductsRequestLP2AdvPymntIntEmi36030IntRecalcDailyMultiDisbFullTermTrancheDownPaymentAuto = loanProductsRequestFactory
4342+
.defaultLoanProductsRequestLP2Emi()//
4343+
.name(name154)//
4344+
.daysInYearType(DaysInYearType.DAYS360.value)//
4345+
.daysInMonthType(DaysInMonthType.DAYS30.value)//
4346+
.isInterestRecalculationEnabled(true)//
4347+
.preClosureInterestCalculationStrategy(1)//
4348+
.rescheduleStrategyMethod(4)//
4349+
.interestRecalculationCompoundingMethod(0)//
4350+
.recalculationRestFrequencyType(2)//
4351+
.recalculationRestFrequencyInterval(1)//
4352+
.paymentAllocation(List.of(//
4353+
createPaymentAllocation("DEFAULT", "NEXT_INSTALLMENT"), //
4354+
createPaymentAllocation("GOODWILL_CREDIT", "LAST_INSTALLMENT"), //
4355+
createPaymentAllocation("MERCHANT_ISSUED_REFUND", "REAMORTIZATION"), //
4356+
createPaymentAllocation("PAYOUT_REFUND", "NEXT_INSTALLMENT")))//
4357+
.multiDisburseLoan(true)//
4358+
.disallowExpectedDisbursements(false)//
4359+
.allowFullTermForTranche(true)//
4360+
.enableDownPayment(true)//
4361+
.enableAutoRepaymentForDownPayment(true)//
4362+
.disbursedAmountPercentageForDownPayment(new BigDecimal(25))//
4363+
.maxTrancheCount(10)//
4364+
.outstandingLoanBalance(10000.0);//
4365+
final PostLoanProductsResponse responseLoanProductsRequestLP2AdvPymntIntEmi36030IntRecalcDailyMultiDisbFullTermTrancheDownPaymentAuto = createLoanProductIdempotent(
4366+
loanProductsRequestLP2AdvPymntIntEmi36030IntRecalcDailyMultiDisbFullTermTrancheDownPaymentAuto);
4367+
TestContext.INSTANCE.set(
4368+
TestContextKey.DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INT_DAILY_EMI_360_30_INT_RECALC_DAILY_MULTIDISB_FULL_TERM_TRANCHE_DOWNPAYMENT_AUTO,
4369+
responseLoanProductsRequestLP2AdvPymntIntEmi36030IntRecalcDailyMultiDisbFullTermTrancheDownPaymentAuto);
42654370
}
42664371

42674372
public static AdvancedPaymentData createPaymentAllocation(String transactionType, String futureInstallmentAllocationRule,

fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/support/TestContextKey.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,4 +292,7 @@ public abstract class TestContextKey {
292292
public static final String LP1_INTEREST_FLAT_DAILY_ACTUAL_ACTUAL_MULTIDISB_EXPECT_TRANCHES = "loanProductCreateResponseLP1InterestFlatDailyActualActualMultiDisbursementExpectTranches";
293293
public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_360_30_ZERO_INTEREST_CHARGE_OFF_ACCRUAL_ACTIVITY = "loanProductCreateResponseLP2AdvancedPaymentZeroInterestChargeOffBehaviourAccrualActivity";
294294
public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADVANCED_CUSTOM_PAYMENT_ALLOCATION_PROGRESSIVE_LOAN_SCHEDULE_PRINCIPAL_FIRST = "loanProductCreateResponseLP2AdvancedPaymentHorizontalPrincipalFirst";
295+
public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE_FULL_TERM_TRANCHE = "loanProductCreateResponseLP2AdvancedPaymentInterestDailyEmi36030InterestRecalculationDailyMultidisburseFullTermTranche";
296+
public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INT_DAILY_EMI_360_30_INT_RECALC_DAILY_MULTIDISB_FULL_TERM_TRANCHE_DOWNPAYMENT = "loanProductCreateResponseLP2AdvancedPaymentInterestDailyEmi36030InterestRecalculationDailyMultidisburseFullTermTrancheDownPayment";
297+
public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INT_DAILY_EMI_360_30_INT_RECALC_DAILY_MULTIDISB_FULL_TERM_TRANCHE_DOWNPAYMENT_AUTO = "loanProductCreateResponseLP2AdvancedPaymentInterestDailyEmi36030InterestRecalculationDailyMultidisburseFullTermTrancheDownPaymentAuto";
295298
}

0 commit comments

Comments
 (0)