|
19 | 19 | package org.apache.fineract.test.initializer.global; |
20 | 20 |
|
21 | 21 | import static org.apache.fineract.client.models.LoanProductRelatedDetail.DaysInYearCustomStrategyEnum.FEB_29_PERIOD_ONLY; |
| 22 | +import static org.apache.fineract.test.data.ChargeOffBehaviour.ZERO_INTEREST; |
22 | 23 | import static org.apache.fineract.test.data.TransactionProcessingStrategyCode.ADVANCED_PAYMENT_ALLOCATION; |
23 | 24 | import static org.apache.fineract.test.factory.LoanProductsRequestFactory.INTEREST_CALCULATION_PERIOD_TYPE_SAME_AS_REPAYMENT; |
24 | 25 | import static org.apache.fineract.test.factory.LoanProductsRequestFactory.INTEREST_RATE_FREQUENCY_TYPE_MONTH; |
@@ -3974,6 +3975,87 @@ public void initialize() throws Exception { |
3974 | 3975 | TestContext.INSTANCE.set( |
3975 | 3976 | TestContextKey.DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP1_INTEREST_FLAT_SAR_RECALCULATION_SAME_AS_REPAYMENT_MULTIDISB_AUTO_DOWNPAYMENT, |
3976 | 3977 | responseLoanProductsRequestInterestFlatSaRRecalculationSameAsRepaymentMultiDisbursementAUtoDownPayment); |
| 3978 | + |
| 3979 | + // LP2 advanced custom payment allocation + progressive loan schedule + horizontal + interest recalculation |
| 3980 | + // Frequency for recalculate Outstanding Principal: Daily, Frequency Interval for recalculation: 1 |
| 3981 | + String name147 = DefaultLoanProduct.LP2_ADV_CUSTOM_PMT_ALLOC_PROGRESSIVE_INTEREST_DAILY_EMI_360_30_INTEREST_RECALCULATION_DAILY |
| 3982 | + .getName(); |
| 3983 | + PostLoanProductsRequest loanProductsResponseAdvCustomPaymentAllocationProgressiveLoanInterestDailyEmi36030InterestRecalculationDaily = loanProductsRequestFactory |
| 3984 | + .defaultLoanProductsRequestLP2Emi()// |
| 3985 | + .supportedInterestRefundTypes(supportedInterestRefundTypes) |
| 3986 | + // .installmentAmountInMultiplesOf(null) // |
| 3987 | + .name(name147)// |
| 3988 | + .daysInYearType(DaysInYearType.DAYS360.value)// |
| 3989 | + .daysInMonthType(DaysInMonthType.DAYS30.value)// |
| 3990 | + .isInterestRecalculationEnabled(true)// |
| 3991 | + .preClosureInterestCalculationStrategy(1)// |
| 3992 | + .rescheduleStrategyMethod(4)// |
| 3993 | + .interestRecalculationCompoundingMethod(0)// |
| 3994 | + .recalculationRestFrequencyType(2)// |
| 3995 | + .recalculationRestFrequencyInterval(1)// |
| 3996 | + .enableAccrualActivityPosting(true) // |
| 3997 | + .chargeOffBehaviour(ZERO_INTEREST.value)// |
| 3998 | + .paymentAllocation(List.of(// |
| 3999 | + createPaymentAllocation("MERCHANT_ISSUED_REFUND", "LAST_INSTALLMENT", |
| 4000 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.PAST_DUE_INTEREST, // |
| 4001 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.PAST_DUE_PRINCIPAL, // |
| 4002 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.PAST_DUE_PENALTY, // |
| 4003 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.PAST_DUE_FEE, // |
| 4004 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.DUE_INTEREST, // |
| 4005 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.DUE_PRINCIPAL, // |
| 4006 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.DUE_PENALTY, // |
| 4007 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.DUE_FEE, // |
| 4008 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.IN_ADVANCE_INTEREST, // |
| 4009 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.IN_ADVANCE_PRINCIPAL, // |
| 4010 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.IN_ADVANCE_PENALTY, // |
| 4011 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.IN_ADVANCE_FEE), // |
| 4012 | + createPaymentAllocation("GOODWILL_CREDIT", "REAMORTIZATION", |
| 4013 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.PAST_DUE_PRINCIPAL, // |
| 4014 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.PAST_DUE_INTEREST, // |
| 4015 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.PAST_DUE_PENALTY, // |
| 4016 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.PAST_DUE_FEE, // |
| 4017 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.DUE_PRINCIPAL, // |
| 4018 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.DUE_INTEREST, // |
| 4019 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.DUE_PENALTY, // |
| 4020 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.DUE_FEE, // |
| 4021 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.IN_ADVANCE_PRINCIPAL, // |
| 4022 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.IN_ADVANCE_INTEREST, // |
| 4023 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.IN_ADVANCE_PENALTY, // |
| 4024 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.IN_ADVANCE_FEE), // |
| 4025 | + createPaymentAllocation("DEFAULT", "NEXT_INSTALLMENT", |
| 4026 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.PAST_DUE_INTEREST, // |
| 4027 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.PAST_DUE_PRINCIPAL, // |
| 4028 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.PAST_DUE_PENALTY, // |
| 4029 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.PAST_DUE_FEE, // |
| 4030 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.DUE_INTEREST, // |
| 4031 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.DUE_PRINCIPAL, // |
| 4032 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.DUE_PENALTY, // |
| 4033 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.DUE_FEE, // |
| 4034 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.IN_ADVANCE_INTEREST, // |
| 4035 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.IN_ADVANCE_PRINCIPAL, // |
| 4036 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.IN_ADVANCE_PENALTY, // |
| 4037 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.IN_ADVANCE_FEE), // |
| 4038 | + createPaymentAllocation("PAYOUT_REFUND", "NEXT_INSTALLMENT", |
| 4039 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.PAST_DUE_INTEREST, // |
| 4040 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.PAST_DUE_PRINCIPAL, // |
| 4041 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.PAST_DUE_PENALTY, // |
| 4042 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.PAST_DUE_FEE, // |
| 4043 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.DUE_INTEREST, // |
| 4044 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.DUE_PRINCIPAL, // |
| 4045 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.DUE_PENALTY, // |
| 4046 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.DUE_FEE, // |
| 4047 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.IN_ADVANCE_INTEREST, // |
| 4048 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.IN_ADVANCE_PRINCIPAL, // |
| 4049 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.IN_ADVANCE_PENALTY, // |
| 4050 | + LoanProductPaymentAllocationRule.AllocationTypesEnum.IN_ADVANCE_FEE) // |
| 4051 | + ));// |
| 4052 | + Response<PostLoanProductsResponse> responseLoanProductsResponseAdvCustomPaymentAllocationProgressiveLoanInterestDailyEmi36030InterestRecalculationDaily = loanProductsApi |
| 4053 | + .createLoanProduct( |
| 4054 | + loanProductsResponseAdvCustomPaymentAllocationProgressiveLoanInterestDailyEmi36030InterestRecalculationDaily) |
| 4055 | + .execute(); |
| 4056 | + TestContext.INSTANCE.set( |
| 4057 | + TestContextKey.DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_CUSTOM_PMT_ALLOC_PROGRESSIVE_INTEREST_DAILY_EMI_360_30_INTEREST_RECALCULATION_DAILY, |
| 4058 | + responseLoanProductsResponseAdvCustomPaymentAllocationProgressiveLoanInterestDailyEmi36030InterestRecalculationDaily); |
3977 | 4059 | } |
3978 | 4060 |
|
3979 | 4061 | public static AdvancedPaymentData createPaymentAllocation(String transactionType, String futureInstallmentAllocationRule, |
|
0 commit comments