Skip to content

Commit 0667f0e

Browse files
FINERACT-2354: e2e test scenarios for re-aging with payable and full interest handling options
1 parent 3512a44 commit 0667f0e

File tree

4 files changed

+2462
-282
lines changed

4 files changed

+2462
-282
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ public enum DefaultLoanProduct implements LoanProduct {
125125
LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE_EXPECT_TRANCHE, //
126126
LP2_ADV_PYMNT_INT_DAILY_EMI_360_30_INT_RECALC_DAILY_MULTIDISB_EXPECT_TRANCHE_APPROVED_OVER_APPLIED, //
127127
LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE, //
128+
LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE_EXPECT_TRANCHE_CHARGEBACK, //
129+
LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE_CHARGEBACK, //
128130
LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_CASH_ACCOUNTING_DISBURSEMENT_CHARGES, //
129131
LP2_ADV_PYMNT_INT_DAILY_EMI_ACTUAL_ACTUAL_INT_REFUND_FULL_ZERO_INT_CHARGE_OFF, //
130132
LP2_ADV_PYMNT_INT_DAILY_EMI_ACTUAL_ACTUAL_INT_REFUND_FULL_ACCELERATE_MATURITY_CHARGE_OFF, //

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

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2221,6 +2221,79 @@ public void initialize() throws Exception {
22212221
TestContextKey.DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE,
22222222
responseLoanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyMultiDisburseDisbursementCharge);
22232223

2224+
// LP2 with progressive loan schedule + horizontal + interest recalculation daily EMI + 360/30 +
2225+
// multidisbursement
2226+
// Frequency for recalculate Outstanding Principal: Daily, Frequency Interval for recalculation: 1
2227+
// chargeback - interest, fee, principal, penalty
2228+
String name150 = DefaultLoanProduct.LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE_EXPECT_TRANCHE_CHARGEBACK
2229+
.getName();
2230+
PostLoanProductsRequest loanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyMultiDisburseExpectTrancheChargeback = loanProductsRequestFactory
2231+
.defaultLoanProductsRequestLP2Emi()//
2232+
.name(name150)//
2233+
.daysInYearType(DaysInYearType.DAYS360.value)//
2234+
.daysInMonthType(DaysInMonthType.DAYS30.value)//
2235+
.isInterestRecalculationEnabled(true)//
2236+
.preClosureInterestCalculationStrategy(1)//
2237+
.rescheduleStrategyMethod(4)//
2238+
.interestRecalculationCompoundingMethod(0)//
2239+
.recalculationRestFrequencyType(2)//
2240+
.recalculationRestFrequencyInterval(1)//
2241+
.creditAllocation(List.of(//
2242+
createCreditAllocation("CHARGEBACK", List.of("INTEREST", "FEE", "PRINCIPAL", "PENALTY"))//
2243+
))//
2244+
.paymentAllocation(List.of(//
2245+
createPaymentAllocation("DEFAULT", "NEXT_INSTALLMENT"), //
2246+
createPaymentAllocation("GOODWILL_CREDIT", "LAST_INSTALLMENT"), //
2247+
createPaymentAllocation("MERCHANT_ISSUED_REFUND", "REAMORTIZATION"), //
2248+
createPaymentAllocation("PAYOUT_REFUND", "NEXT_INSTALLMENT")))//
2249+
.multiDisburseLoan(true)//
2250+
.disallowExpectedDisbursements(false)//
2251+
.maxTrancheCount(10)//
2252+
.outstandingLoanBalance(10000.0);//
2253+
Response<PostLoanProductsResponse> responseLoanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyMultiDisburseExpectTrancheChargeback = loanProductsApi
2254+
.createLoanProduct(
2255+
loanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyMultiDisburseExpectTrancheChargeback)
2256+
.execute();
2257+
TestContext.INSTANCE.set(
2258+
TestContextKey.DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE_EXPECT_TRANCHE_CHARGEBACK,
2259+
responseLoanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyMultiDisburseExpectTrancheChargeback);
2260+
2261+
// LP2 with progressive loan schedule + horizontal + interest recalculation daily EMI + 360/30 +
2262+
// multidisbursement
2263+
// Frequency for recalculate Outstanding Principal: Daily, Frequency Interval for recalculation: 1
2264+
// chargeback - interest, fee, principal, penalty
2265+
String name151 = DefaultLoanProduct.LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE_CHARGEBACK
2266+
.getName();
2267+
PostLoanProductsRequest loanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyMultiDisburseChargeback = loanProductsRequestFactory
2268+
.defaultLoanProductsRequestLP2Emi()//
2269+
.name(name151)//
2270+
.daysInYearType(DaysInYearType.DAYS360.value)//
2271+
.daysInMonthType(DaysInMonthType.DAYS30.value)//
2272+
.isInterestRecalculationEnabled(true)//
2273+
.preClosureInterestCalculationStrategy(1)//
2274+
.rescheduleStrategyMethod(4)//
2275+
.interestRecalculationCompoundingMethod(0)//
2276+
.recalculationRestFrequencyType(2)//
2277+
.recalculationRestFrequencyInterval(1)//
2278+
.creditAllocation(List.of(//
2279+
createCreditAllocation("CHARGEBACK", List.of("INTEREST", "FEE", "PRINCIPAL", "PENALTY"))//
2280+
))//
2281+
.paymentAllocation(List.of(//
2282+
createPaymentAllocation("DEFAULT", "NEXT_INSTALLMENT"), //
2283+
createPaymentAllocation("GOODWILL_CREDIT", "LAST_INSTALLMENT"), //
2284+
createPaymentAllocation("MERCHANT_ISSUED_REFUND", "REAMORTIZATION"), //
2285+
createPaymentAllocation("PAYOUT_REFUND", "NEXT_INSTALLMENT")))//
2286+
.multiDisburseLoan(true)//
2287+
.disallowExpectedDisbursements(true)//
2288+
.maxTrancheCount(10)//
2289+
.outstandingLoanBalance(10000.0);//
2290+
Response<PostLoanProductsResponse> responseLoanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyMultiDisburseChargeback = loanProductsApi
2291+
.createLoanProduct(loanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyMultiDisburseChargeback)
2292+
.execute();
2293+
TestContext.INSTANCE.set(
2294+
TestContextKey.DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE_CHARGEBACK,
2295+
responseLoanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyMultiDisburseDisbursementCharge);
2296+
22242297
// LP2 with progressive loan schedule + horizontal + interest recalculation daily EMI + 360/30 + cash based
22252298
// accounting
22262299
// Frequency for recalculate Outstanding Principal: Daily, Frequency Interval for recalculation: 1

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ public abstract class TestContextKey {
155155
public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE_EXPECT_TRANCHE = "loanProductCreateResponseLP2AdvancedPaymentInterestDailyEmi36030InterestRecalculationDailyMultidisburseExpectTranche";
156156
public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INT_DAILY_EMI_360_30_INT_RECALC_DAILY_MULTIDISB_EXPECT_TRANCHE_APPROVED_OVER_APPLIED = "loanProductCreateResponseLP2AdvancedPaymentInterestDailyEmi36030InterestRecalculationDailyMultidisburseExpectTrancheApprovedOVerAppliedPercentage";
157157
public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE = "loanProductCreateResponseLP2AdvancedPaymentInterestRecalculationDailyEmi36030Multidisburse";
158+
public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE_EXPECT_TRANCHE_CHARGEBACK = "loanProductCreateResponseLP2AdvancedPaymentInterestDailyEmi36030InterestRecalculationDailyMultidisburseExpectTrancheChargeback";
159+
public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE_CHARGEBACK = "loanProductCreateResponseLP2AdvancedPaymentInterestRecalculationDailyEmi36030MultidisburseChargeback";
158160
public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_CASH_ACCOUNTING_DISBURSEMENT_CHARGES = "loanProductCreateResponseLP2AdvancedPaymentInterestDailyEmi36030InterestRecalculationDailyCashBasedDisbursementCharge";
159161
public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_PROGRESSIVE_ADV_PYMNT_CAPITALIZED_INCOME = "loanProductCreateResponseLP2ProgressiveAdvancedPaymentCapitalizedIncome";
160162
public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_PROGRESSIVE_ADV_PYMNT_BUYDOWN_FEES = "loanProductCreateResponseLP2ProgressiveAdvancedPaymentBuyDownFees";

0 commit comments

Comments
 (0)