Skip to content

Commit 4f2e27b

Browse files
FINERACT-2354: e2e test scenarios for re-aging with payable and full interest handling options
1 parent c7a0fe9 commit 4f2e27b

File tree

4 files changed

+2797
-410
lines changed

4 files changed

+2797
-410
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ 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_CHARGEBACK, //
128129
LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_CASH_ACCOUNTING_DISBURSEMENT_CHARGES, //
129130
LP2_ADV_PYMNT_INT_DAILY_EMI_ACTUAL_ACTUAL_INT_REFUND_FULL_ZERO_INT_CHARGE_OFF, //
130131
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: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3983,8 +3983,7 @@ public void initialize() throws Exception {
39833983
.getName();
39843984
PostLoanProductsRequest loanProductsResponseAdvCustomPaymentAllocationProgressiveLoanInterestDailyEmi36030InterestRecalculationDaily = loanProductsRequestFactory
39853985
.defaultLoanProductsRequestLP2Emi()//
3986-
.supportedInterestRefundTypes(supportedInterestRefundTypes)
3987-
// .installmentAmountInMultiplesOf(null) //
3986+
.supportedInterestRefundTypes(supportedInterestRefundTypes).installmentAmountInMultiplesOf(null) //
39883987
.name(name147)//
39893988
.daysInYearType(DaysInYearType.DAYS360.value)//
39903989
.daysInMonthType(DaysInMonthType.DAYS30.value)//
@@ -4105,6 +4104,42 @@ public void initialize() throws Exception {
41054104
final Response<PostLoanProductsResponse> responseNoOverrides = loanProductsApi.createLoanProduct(loanProductsRequestNoOverrides)
41064105
.execute();
41074106
TestContext.INSTANCE.set(TestContextKey.DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP1_NO_OVERRIDES, responseNoOverrides);
4107+
4108+
// LP2 with progressive loan schedule + horizontal + interest recalculation daily EMI + 360/30 +
4109+
// multidisbursement
4110+
// Frequency for recalculate Outstanding Principal: Daily, Frequency Interval for recalculation: 1
4111+
// chargeback - interest, fee, principal, penalty
4112+
String name148 = DefaultLoanProduct.LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE_CHARGEBACK
4113+
.getName();
4114+
PostLoanProductsRequest loanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyMultiDisburseChargeback = loanProductsRequestFactory
4115+
.defaultLoanProductsRequestLP2Emi()//
4116+
.name(name148)//
4117+
.daysInYearType(DaysInYearType.DAYS360.value)//
4118+
.daysInMonthType(DaysInMonthType.DAYS30.value)//
4119+
.isInterestRecalculationEnabled(true)//
4120+
.preClosureInterestCalculationStrategy(1)//
4121+
.rescheduleStrategyMethod(4)//
4122+
.interestRecalculationCompoundingMethod(0)//
4123+
.recalculationRestFrequencyType(2)//
4124+
.recalculationRestFrequencyInterval(1)//
4125+
.creditAllocation(List.of(//
4126+
createCreditAllocation("CHARGEBACK", List.of("INTEREST", "FEE", "PRINCIPAL", "PENALTY"))//
4127+
))//
4128+
.paymentAllocation(List.of(//
4129+
createPaymentAllocation("DEFAULT", "NEXT_INSTALLMENT"), //
4130+
createPaymentAllocation("GOODWILL_CREDIT", "LAST_INSTALLMENT"), //
4131+
createPaymentAllocation("MERCHANT_ISSUED_REFUND", "REAMORTIZATION"), //
4132+
createPaymentAllocation("PAYOUT_REFUND", "NEXT_INSTALLMENT")))//
4133+
.multiDisburseLoan(true)//
4134+
.disallowExpectedDisbursements(true)//
4135+
.maxTrancheCount(10)//
4136+
.outstandingLoanBalance(10000.0);//
4137+
Response<PostLoanProductsResponse> responseLoanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyMultiDisburseChargeback = loanProductsApi
4138+
.createLoanProduct(loanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyMultiDisburseChargeback)
4139+
.execute();
4140+
TestContext.INSTANCE.set(
4141+
TestContextKey.DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE_CHARGEBACK,
4142+
responseLoanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyMultiDisburseChargeback);
41084143
}
41094144

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

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ 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_CHARGEBACK = "loanProductCreateResponseLP2AdvancedPaymentInterestRecalculationDailyEmi36030MultidisburseChargeback";
158159
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";
159160
public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_PROGRESSIVE_ADV_PYMNT_CAPITALIZED_INCOME = "loanProductCreateResponseLP2ProgressiveAdvancedPaymentCapitalizedIncome";
160161
public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_PROGRESSIVE_ADV_PYMNT_BUYDOWN_FEES = "loanProductCreateResponseLP2ProgressiveAdvancedPaymentBuyDownFees";

0 commit comments

Comments
 (0)