This is an automated email from the ASF dual-hosted git repository.

adamsaghy pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git

commit bbf797fc34f74b36b1e4f513afdb7b5ec1d2a758
Author: Rustam Zeinalov <[email protected]>
AuthorDate: Sat Apr 26 15:13:50 2025 +0200

    FINERACT-2226: Added e2e tests for testing repayment reversal issue after 
charge off and MIR
---
 .../test/data/loanproduct/DefaultLoanProduct.java  |   3 +
 .../global/LoanProductGlobalInitializerStep.java   |  60 +++++
 .../fineract/test/support/TestContextKey.java      |   3 +
 .../test/resources/features/LoanChargeOff.feature  | 276 +++++++++++++++++++++
 4 files changed, 342 insertions(+)

diff --git 
a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/data/loanproduct/DefaultLoanProduct.java
 
b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/data/loanproduct/DefaultLoanProduct.java
index e13df43213..75d817fad8 100644
--- 
a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/data/loanproduct/DefaultLoanProduct.java
+++ 
b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/data/loanproduct/DefaultLoanProduct.java
@@ -68,6 +68,7 @@ public enum DefaultLoanProduct implements LoanProduct {
     
LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALCULATION_SARP_TILL_REST_FREQUENCY_DATE,
 //
     
LP2_ADV_CUSTOM_PAYMENT_ALLOC_INTEREST_RECALCULATION_DAILY_EMI_360_30_MULTIDISBURSE,
 //
     LP2_ADV_PYMNT_INTEREST_DAILY_EMI_ACTUAL_ACTUAL_INTEREST_REFUND_FULL, //
+    
LP2_ADV_PYMNT_INTEREST_DAILY_EMI_ACTUAL_ACTUAL_NO_INTEREST_RECALC_REFUND_FULL, 
//
     LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_MULTIDISBURSE, //
     
LP2_ADV_PYMNT_INTEREST_RECOGNITION_DISBURSEMENT_DAILY_EMI_360_30_ACCRUAL_ACTIVITY,
 //
     
LP2_ADV_PYMNT_INTEREST_RECOGNITION_DISBURSEMENT_DAILY_EMI_ACTUAL_ACTUAL_ACCRUAL_ACTIVITY,
 //
@@ -115,6 +116,8 @@ public enum DefaultLoanProduct implements LoanProduct {
     
LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_CASH_ACCOUNTING_DISBURSEMENT_CHARGES,
 //
     
LP2_ADV_PYMNT_INT_DAILY_EMI_ACTUAL_ACTUAL_INT_REFUND_FULL_ZERO_INT_CHARGE_OFF, 
//
     
LP2_ADV_PYMNT_INT_DAILY_EMI_ACTUAL_ACTUAL_INT_REFUND_FULL_ACCELERATE_MATURITY_CHARGE_OFF,
 //
+    
LP2_ADV_PYMNT_INT_DAILY_EMI_ACTUAL_ACTUAL_NO_INTEREST_RECALC_INT_REFUND_FULL_ZERO_INT_CHARGE_OFF,
 //
+    
LP2_ADV_PYMNT_INT_DAILY_EMI_ACTUAL_ACTUAL_NO_INTEREST_RECALC_INT_REFUND_FULL_ACC_MATUR_CHARGE_OFF,
 //
     ;
 
     @Override
diff --git 
a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/initializer/global/LoanProductGlobalInitializerStep.java
 
b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/initializer/global/LoanProductGlobalInitializerStep.java
index a39192be30..4f7daf1515 100644
--- 
a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/initializer/global/LoanProductGlobalInitializerStep.java
+++ 
b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/initializer/global/LoanProductGlobalInitializerStep.java
@@ -918,6 +918,8 @@ public class LoanProductGlobalInitializerStep implements 
FineractGlobalInitializ
                 
TestContextKey.DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADVANCED_CUSTOM_PAYMENT_ALLOCATION_PROGRESSIVE_LOAN_SCHEDULE,
                 
responseLoanProductsRequestAdvCustomPaymentAllocationProgressiveLoanSchedule);
 
+        // LP2 + interest recalculation + horizontal + interest refund
+        // 
(LP2_ADV_PYMNT_INTEREST_DAILY_EMI_ACTUAL_ACTUAL_INTEREST_REFUND_FULL)
         String name45 = 
DefaultLoanProduct.LP2_ADV_PYMNT_INTEREST_DAILY_EMI_ACTUAL_ACTUAL_INTEREST_REFUND_FULL.getName();
         PostLoanProductsRequest 
loanProductsRequestLP2AdvancedpaymentInterestEmiActualActualInterestRefundFull 
= loanProductsRequestFactory
                 .defaultLoanProductsRequestLP2Emi()//
@@ -2264,6 +2266,8 @@ public class LoanProductGlobalInitializerStep implements 
FineractGlobalInitializ
                 
TestContextKey.DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_ZERO_INTEREST_CHARGE_OFF_DELINQUENT_REASON_INTEREST_RECALC,
                 
responseLoanProductsRequestAdvZeroInterestChargeOffProgressiveDelinquentReasonIntRecalc);
 
+        // LP2 + zero-interest chargeOff behaviour + progressive loan schedule 
+ horizontal + interest recalculation
+        // 
(LP2_ADV_PYMNT_INT_DAILY_EMI_ACTUAL_ACTUAL_INT_REFUND_FULL_ZERO_INT_CHARGE_OFF)
         final String name91 = 
DefaultLoanProduct.LP2_ADV_PYMNT_INT_DAILY_EMI_ACTUAL_ACTUAL_INT_REFUND_FULL_ZERO_INT_CHARGE_OFF.getName();
         final PostLoanProductsRequest 
loanProductsRequestLP2AdvPaymentIntEmiActualActualIntRefundFullZeroIntChargeOff 
= loanProductsRequestLP2AdvancedpaymentInterestEmiActualActualInterestRefundFull
                 .name(name91)//
@@ -2275,6 +2279,9 @@ public class LoanProductGlobalInitializerStep implements 
FineractGlobalInitializ
                 
TestContextKey.DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INT_DAILY_EMI_ACTUAL_ACTUAL_INT_REFUND_FULL_ZERO_INT_CHARGE_OFF,
                 
responseLoanProductsRequestLP2AdvPaymentIntEmiActualActualIntRefundFullZeroIntChargeOff);
 
+        // LP2 + accelerate maturity chargeOff behaviour + progressive loan 
schedule + horizontal + interest
+        // recalculation
+        // 
(LP2_ADV_PYMNT_INT_DAILY_EMI_ACTUAL_ACTUAL_INT_REFUND_FULL_ACCELERATE_MATURITY_CHARGE_OFF)
         final String name92 = 
DefaultLoanProduct.LP2_ADV_PYMNT_INT_DAILY_EMI_ACTUAL_ACTUAL_INT_REFUND_FULL_ACCELERATE_MATURITY_CHARGE_OFF
                 .getName();
         final PostLoanProductsRequest 
loanProductsRequestLP2AdvPaymentIntEmiActualActualIntRefundFullAccelerateMaturityChargeOff
 = 
loanProductsRequestLP2AdvancedpaymentInterestEmiActualActualInterestRefundFull
@@ -2286,6 +2293,59 @@ public class LoanProductGlobalInitializerStep implements 
FineractGlobalInitializ
         TestContext.INSTANCE.set(
                 
TestContextKey.DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INT_DAILY_EMI_ACTUAL_ACTUAL_INT_REFUND_FULL_ACCELERATE_MATURITY_CHARGE_OFF,
                 
responseLoanProductsRequestLP2AdvPaymentIntEmiActualActualIntRefundFullAccelerateMaturityChargeOff);
+
+        // LP2 + no interest recalculation + horizontal + interest refund
+        // 
(LP2_ADV_PYMNT_INTEREST_DAILY_EMI_ACTUAL_ACTUAL_NO_INTEREST_RECALC_REFUND_FULL)
+        String name93 = 
DefaultLoanProduct.LP2_ADV_PYMNT_INTEREST_DAILY_EMI_ACTUAL_ACTUAL_NO_INTEREST_RECALC_REFUND_FULL.getName();
+        PostLoanProductsRequest 
loanProductsRequestLP2AdvancedPaymentInterestEmiActualActualNoInterestRecalcRefundFull
 = loanProductsRequestFactory
+                .defaultLoanProductsRequestLP2Emi()//
+                .name(name93)//
+                .multiDisburseLoan(true)//
+                .disallowExpectedDisbursements(true)//
+                .maxTrancheCount(10)//
+                
.supportedInterestRefundTypes(supportedInterestRefundTypes).paymentAllocation(List.of(//
+                        createPaymentAllocation("DEFAULT", 
"NEXT_INSTALLMENT"), //
+                        createPaymentAllocation("GOODWILL_CREDIT", 
"NEXT_INSTALLMENT"), //
+                        createPaymentAllocation("MERCHANT_ISSUED_REFUND", 
"NEXT_INSTALLMENT"), //
+                        createPaymentAllocation("PAYOUT_REFUND", 
"NEXT_INSTALLMENT"), //
+                        createPaymentAllocation("INTEREST_REFUND", 
"NEXT_INSTALLMENT")));//
+        Response<PostLoanProductsResponse> 
responseLoanProductsRequestLP2AdvancedpaymentInterestEmiActualActualNoInterestRecalcRefundFull
 = loanProductsApi
+                
.createLoanProduct(loanProductsRequestLP2AdvancedPaymentInterestEmiActualActualNoInterestRecalcRefundFull).execute();
+        TestContext.INSTANCE.set(
+                
TestContextKey.DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INTEREST_DAILY_EMI_ACTUAL_ACTUAL_NO_INTEREST_RECALC_REFUND_FULL,
+                
responseLoanProductsRequestLP2AdvancedpaymentInterestEmiActualActualNoInterestRecalcRefundFull);
+
+        // LP2 + zero-interest chargeOff behaviour + progressive loan schedule 
+ horizontal + no interest recalculation
+        // 
(LP2_ADV_PYMNT_INT_DAILY_EMI_ACTUAL_ACTUAL_NO_INTEREST_RECALC_INT_REFUND_FULL_ZERO_INT_CHARGE_OFF)
+        final String name94 = 
DefaultLoanProduct.LP2_ADV_PYMNT_INT_DAILY_EMI_ACTUAL_ACTUAL_NO_INTEREST_RECALC_INT_REFUND_FULL_ZERO_INT_CHARGE_OFF
+                .getName();
+        final PostLoanProductsRequest 
loanProductsRequestLP2AdvPaymentIntEmiActualActualNoInterestRecalcIntRefundFullZeroIntChargeOff
 = 
loanProductsRequestLP2AdvancedPaymentInterestEmiActualActualNoInterestRecalcRefundFull
+                .name(name94)//
+                .shortName(Utils.randomNameGenerator(SHORT_NAME_PREFIX_EMI, 
3))//
+                .chargeOffBehaviour("ZERO_INTEREST");//
+        final Response<PostLoanProductsResponse> 
responseLoanProductsRequestLP2AdvPaymentIntEmiActualActualNoInterestRecalcIntRefundFullZeroIntChargeOff
 = loanProductsApi
+                
.createLoanProduct(loanProductsRequestLP2AdvPaymentIntEmiActualActualNoInterestRecalcIntRefundFullZeroIntChargeOff)
+                .execute();
+        TestContext.INSTANCE.set(
+                
TestContextKey.DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INT_DAILY_EMI_ACTUAL_ACTUAL_NO_INTEREST_RECALC_INT_REFUND_FULL_ZERO_INT_CHARGE_OFF,
+                
responseLoanProductsRequestLP2AdvPaymentIntEmiActualActualNoInterestRecalcIntRefundFullZeroIntChargeOff);
+
+        // LP2 + accelerate maturity chargeOff behaviour + progressive loan 
schedule + horizontal + no interest
+        // recalculation
+        // 
(LP2_ADV_PYMNT_INT_DAILY_EMI_ACTUAL_ACTUAL_NO_INTEREST_RECALC_INT_REFUND_FULL_ACC_MATUR_CHARGE_OFF)
+        final String name95 = 
DefaultLoanProduct.LP2_ADV_PYMNT_INT_DAILY_EMI_ACTUAL_ACTUAL_NO_INTEREST_RECALC_INT_REFUND_FULL_ACC_MATUR_CHARGE_OFF
+                .getName();
+        final PostLoanProductsRequest 
loanProductsRequestLP2AdvPaymentIntEmiActualActualNoInterestRecalcIntRefundFullAccelerateMaturityChargeOff
 = 
loanProductsRequestLP2AdvancedPaymentInterestEmiActualActualNoInterestRecalcRefundFull
+                .name(name95)//
+                .shortName(Utils.randomNameGenerator(SHORT_NAME_PREFIX_EMI, 
3))//
+                .chargeOffBehaviour("ACCELERATE_MATURITY");//
+        final Response<PostLoanProductsResponse> 
responseLoanProductsRequestLP2AdvPaymentIntEmiActualActualNoInterestRecalcIntRefundFullAccelerateMaturityChargeOff
 = loanProductsApi
+                .createLoanProduct(
+                        
loanProductsRequestLP2AdvPaymentIntEmiActualActualNoInterestRecalcIntRefundFullAccelerateMaturityChargeOff)
+                .execute();
+        TestContext.INSTANCE.set(
+                
TestContextKey.DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INT_DAILY_EMI_ACTUAL_ACTUAL_NO_INTEREST_RECALC_INT_REFUND_FULL_ACC_MATUR_CHARGE_OFF,
+                
responseLoanProductsRequestLP2AdvPaymentIntEmiActualActualNoInterestRecalcIntRefundFullAccelerateMaturityChargeOff);
     }
 
     public static AdvancedPaymentData createPaymentAllocation(String 
transactionType, String futureInstallmentAllocationRule,
diff --git 
a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/support/TestContextKey.java
 
b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/support/TestContextKey.java
index c54debbaa4..28283c4301 100644
--- 
a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/support/TestContextKey.java
+++ 
b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/support/TestContextKey.java
@@ -101,8 +101,11 @@ public abstract class TestContextKey {
     public static final String 
DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALCULATION_DAILY_TILL_REST_FREQUENCY_DATE
 = 
"loanProductCreateResponseLP2AdvancedPaymentInterestDailyEmi36030InterestRecalculationDailyTillRestFrequencyDate";
     public static final String 
DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALCULATION_SAME_AS_REP_TILL_REST_FREQUENCY_DATE
 = 
"loanProductCreateResponseLP2AdvancedPaymentInterestDailyEmi36030InterestRecalculationSameAsRepTillRestFrequencyDate";
     public static final String 
DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INTEREST_DAILY_EMI_ACTUAL_ACTUAL_INTEREST_REFUND_FULL
 = 
"loanProductCreateResponseLP2AdvancedPaymentInterestDailyEmiActualActualInterestRefundFull";
+    public static final String 
DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INTEREST_DAILY_EMI_ACTUAL_ACTUAL_NO_INTEREST_RECALC_REFUND_FULL
 = 
"loanProductCreateResponseLP2AdvancedPaymentInterestDailyEmiActualActualNoInterestRecalcRefundFull";
     public static final String 
DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INT_DAILY_EMI_ACTUAL_ACTUAL_INT_REFUND_FULL_ZERO_INT_CHARGE_OFF
 = 
"loanProductCreateResponseLP2AdvancedPaymentInterestDailyEmiActualActualInterestRefundFullZeroInterestChargeOff";
+    public static final String 
DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INT_DAILY_EMI_ACTUAL_ACTUAL_NO_INTEREST_RECALC_INT_REFUND_FULL_ZERO_INT_CHARGE_OFF
 = 
"loanProductCreateResponseLP2AdvancedPaymentInterestDailyEmiActualActualNoInterestRecalcInterestRefundFullZeroInterestChargeOff";
     public static final String 
DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INT_DAILY_EMI_ACTUAL_ACTUAL_INT_REFUND_FULL_ACCELERATE_MATURITY_CHARGE_OFF
 = 
"loanProductCreateResponseLP2AdvancedPaymentInterestDailyEmiActualActualInterestRefundFullAccelerateMaturityChargeOff";
+    public static final String 
DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INT_DAILY_EMI_ACTUAL_ACTUAL_NO_INTEREST_RECALC_INT_REFUND_FULL_ACC_MATUR_CHARGE_OFF
 = 
"loanProductCreateResponseLP2AdvancedPaymentInterestDailyEmiActualActualNoInterestRecalcInterestRefundFullAccelerateMaturityChargeOff";
     public static final String 
DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_MULTIDISBURSE
 = 
"loanProductCreateResponseLP2AdvancedPaymentInterestDailyEmi36030MultiDisburse";
     public static final String 
DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADVANCED_PAYMENT_ALLOCATION_INTEREST_RECALCULATION_DAILY_NO_CALC_ON_PAST_DUE_EMI_360_30_MULTIDISBURSE
 = 
"loanProductCreateResponseLP2AdvancedPaymentAllocationInterestRecalculationDailyNoCalcOnPastDueEmi36030MultiDisburse";
     public static final String 
DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADVANCED_CUSTOM_PAYMENT_ALLOCATION_INTEREST_RECALCULATION_DAILY_EMI_360_30_MULTIDISBURSE
 = 
"loanProductCreateResponseLP2AdvancedCustomPaymentInterestRecalculationDailyEmi36030MultiDisburse";
diff --git 
a/fineract-e2e-tests-runner/src/test/resources/features/LoanChargeOff.feature 
b/fineract-e2e-tests-runner/src/test/resources/features/LoanChargeOff.feature
index 10dabed848..42f1d4bd7b 100644
--- 
a/fineract-e2e-tests-runner/src/test/resources/features/LoanChargeOff.feature
+++ 
b/fineract-e2e-tests-runner/src/test/resources/features/LoanChargeOff.feature
@@ -8725,3 +8725,279 @@ Feature: Charge-off
       | 14 April 2025    | Charge-off             | 907.57 | 900.0     | 7.57  
   | 0.0  | 0.0       | 0.0          | false    | true     |
       | 15 April 2025    | Merchant Issued Refund | 900.0  | 900.0     | 0.0   
   | 0.0  | 0.0       | 0.0          | false    | true     |
       | 15 April 2025    | Interest Refund        | 7.57   | 0.0       | 7.57  
   | 0.0  | 0.0       | 0.0          | false    | true     |
+
+  @TestRailId:C3622
+  Scenario: Verify repayment reversal after charge-off and merchant issued 
refund and interestRecalculation=false
+    When Admin sets the business date to "14 March 2025"
+    When Admin creates a client with random data
+    When Admin creates a fully customized loan with the following data:
+      | LoanProduct                                                            
       | submitted on date | with Principal | ANNUAL interest rate % | interest 
type     | interest calculation period | amortization type  | loanTermFrequency 
| loanTermFrequencyType | repaymentEvery | repaymentFrequencyType | 
numberOfRepayments | graceOnPrincipalPayment | graceOnInterestPayment | 
interest free period | Payment strategy            |
+      | 
LP2_ADV_PYMNT_INTEREST_DAILY_EMI_ACTUAL_ACTUAL_NO_INTEREST_RECALC_REFUND_FULL | 
14 March 2025     | 900            | 9.9                    | DECLINING_BALANCE 
| DAILY                       | EQUAL_INSTALLMENTS | 4                 | MONTHS 
               | 1              | MONTHS                 | 4                  | 
0                       | 0                      | 0                    | 
ADVANCED_PAYMENT_ALLOCATION |
+    And Admin successfully approves the loan on "14 March 2025" with "900" 
amount and expected disbursement date on "14 March 2025"
+    And Admin successfully disburse the loan on "14 March 2025" with "900" EUR 
transaction amount
+    Then Loan Repayment schedule has 4 periods, with the following data for 
periods:
+      | Nr | Days | Date          | Paid date | Balance of loan | Principal 
due | Interest | Fees | Penalties | Due    | Paid | In advance | Late | 
Outstanding |
+      |    |      | 14 March 2025 |           | 900.0           |              
 |          | 0.0  |           | 0.0    | 0.0  |            |      |            
 |
+      | 1  | 31   | 14 April 2025 |           | 677.88          | 222.12       
 | 7.57     | 0.0  | 0.0       | 229.69 | 0.0  | 0.0        | 0.0  | 229.69     
 |
+      | 2  | 30   | 14 May 2025   |           | 453.71          | 224.17       
 | 5.52     | 0.0  | 0.0       | 229.69 | 0.0  | 0.0        | 0.0  | 229.69     
 |
+      | 3  | 31   | 14 June 2025  |           | 227.83          | 225.88       
 | 3.81     | 0.0  | 0.0       | 229.69 | 0.0  | 0.0        | 0.0  | 229.69     
 |
+      | 4  | 30   | 14 July 2025  |           | 0.0             | 227.83       
 | 1.85     | 0.0  | 0.0       | 229.68 | 0.0  | 0.0        | 0.0  | 229.68     
 |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid | In 
advance | Late | Outstanding |
+      | 900.0         | 18.75    | 0.0  | 0.0       | 918.75 | 0.0  | 0.0      
  | 0.0  | 918.75      |
+    Then Loan Transactions tab has the following data:
+      | Transaction date | Transaction Type | Amount | Principal | Interest | 
Fees | Penalties | Loan Balance |
+      | 14 March 2025    | Disbursement     | 900.0  | 0.0       | 0.0      | 
0.0  | 0.0       | 900.0        |
+    When Admin sets the business date to "05 April 2025"
+    And Customer makes "REPAYMENT" transaction with "AUTOPAY" payment type on 
"05 April 2025" with 100 EUR transaction amount and system-generated 
Idempotency key
+    Then Loan Repayment schedule has 4 periods, with the following data for 
periods:
+      | Nr | Days | Date          | Paid date | Balance of loan | Principal 
due | Interest | Fees | Penalties | Due    | Paid  | In advance | Late | 
Outstanding |
+      |    |      | 14 March 2025 |           | 900.0           |              
 |          | 0.0  |           | 0.0    | 0.0   |            |      |           
  |
+      | 1  | 31   | 14 April 2025 |           | 677.88          | 222.12       
 | 7.57     | 0.0  | 0.0       | 229.69 | 100.0 | 100.0      | 0.0  | 129.69    
  |
+      | 2  | 30   | 14 May 2025   |           | 453.71          | 224.17       
 | 5.52     | 0.0  | 0.0       | 229.69 | 0.0   | 0.0        | 0.0  | 229.69    
  |
+      | 3  | 31   | 14 June 2025  |           | 227.83          | 225.88       
 | 3.81     | 0.0  | 0.0       | 229.69 | 0.0   | 0.0        | 0.0  | 229.69    
  |
+      | 4  | 30   | 14 July 2025  |           | 0.0             | 227.83       
 | 1.85     | 0.0  | 0.0       | 229.68 | 0.0   | 0.0        | 0.0  | 229.68    
  |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid  | In 
advance | Late | Outstanding |
+      | 900.0         | 18.75    | 0.0  | 0.0       | 918.75 | 100.0 | 100.0   
   | 0.0  | 818.75      |
+    Then Loan Transactions tab has the following data:
+      | Transaction date | Transaction Type | Amount | Principal | Interest | 
Fees | Penalties | Loan Balance |
+      | 14 March 2025    | Disbursement     | 900.0  | 0.0       | 0.0      | 
0.0  | 0.0       | 900.0        |
+      | 05 April 2025    | Repayment        | 100.0  | 100.0     | 0.0      | 
0.0  | 0.0       | 800.0        |
+    When Admin sets the business date to "14 April 2025"
+    And Admin does charge-off the loan on "14 April 2025"
+    When Admin runs inline COB job for Loan
+    Then Loan Repayment schedule has 4 periods, with the following data for 
periods:
+      | Nr | Days | Date          | Paid date | Balance of loan | Principal 
due | Interest | Fees | Penalties | Due    | Paid  | In advance | Late | 
Outstanding |
+      |    |      | 14 March 2025 |           | 900.0           |              
 |          | 0.0  |           | 0.0    | 0.0   |            |      |           
  |
+      | 1  | 31   | 14 April 2025 |           | 677.88          | 222.12       
 | 7.57     | 0.0  | 0.0       | 229.69 | 100.0 | 100.0      | 0.0  | 129.69    
  |
+      | 2  | 30   | 14 May 2025   |           | 453.71          | 224.17       
 | 5.52     | 0.0  | 0.0       | 229.69 | 0.0   | 0.0        | 0.0  | 229.69    
  |
+      | 3  | 31   | 14 June 2025  |           | 227.83          | 225.88       
 | 3.81     | 0.0  | 0.0       | 229.69 | 0.0   | 0.0        | 0.0  | 229.69    
  |
+      | 4  | 30   | 14 July 2025  |           | 0.0             | 227.83       
 | 1.85     | 0.0  | 0.0       | 229.68 | 0.0   | 0.0        | 0.0  | 229.68    
  |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid  | In 
advance | Late | Outstanding |
+      | 900.0         | 18.75    | 0.0  | 0.0       | 918.75 | 100.0 | 100.0   
   | 0.0  | 818.75      |
+    Then Loan Transactions tab has the following data:
+      | Transaction date | Transaction Type | Amount | Principal | Interest | 
Fees | Penalties | Loan Balance |
+      | 14 March 2025    | Disbursement     | 900.0  | 0.0       | 0.0      | 
0.0  | 0.0       | 900.0        |
+      | 05 April 2025    | Repayment        | 100.0  | 100.0     | 0.0      | 
0.0  | 0.0       | 800.0        |
+      | 14 April 2025    | Accrual          | 7.57   | 0.0       | 7.57     | 
0.0  | 0.0       | 0.0          |
+      | 14 April 2025    | Charge-off       | 818.75 | 800.0     | 18.75    | 
0.0  | 0.0       | 0.0          |
+    When Admin sets the business date to "15 April 2025"
+    And Customer makes "MERCHANT_ISSUED_REFUND" transaction with "AUTOPAY" 
payment type on "15 April 2025" with 900 EUR transaction amount and 
system-generated Idempotency key
+    Then Loan Repayment schedule has 4 periods, with the following data for 
periods:
+      | Nr | Days | Date          | Paid date     | Balance of loan | 
Principal due | Interest | Fees | Penalties | Due    | Paid   | In advance | 
Late   | Outstanding |
+      |    |      | 14 March 2025 |               | 900.0           |          
     |          | 0.0  |           | 0.0    | 0.0    |            |        |    
         |
+      | 1  | 31   | 14 April 2025 | 15 April 2025 | 677.88          | 222.12   
     | 7.57     | 0.0  | 0.0       | 229.69 | 229.69 | 100.0      | 129.69 | 
0.0         |
+      | 2  | 30   | 14 May 2025   | 15 April 2025 | 453.71          | 224.17   
     | 5.52     | 0.0  | 0.0       | 229.69 | 229.69 | 229.69     | 0.0    | 
0.0         |
+      | 3  | 31   | 14 June 2025  | 15 April 2025 | 227.83          | 225.88   
     | 3.81     | 0.0  | 0.0       | 229.69 | 229.69 | 229.69     | 0.0    | 
0.0         |
+      | 4  | 30   | 14 July 2025  | 15 April 2025 | 0.0             | 227.83   
     | 1.85     | 0.0  | 0.0       | 229.68 | 229.68 | 229.68     | 0.0    | 
0.0         |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid   | In 
advance | Late   | Outstanding |
+      | 900.0         | 18.75    | 0.0  | 0.0       | 918.75 | 918.75 | 789.06 
    | 129.69 | 0.0         |
+    Then Loan Transactions tab has the following data:
+      | Transaction date | Transaction Type       | Amount | Principal | 
Interest | Fees | Penalties | Loan Balance |
+      | 14 March 2025    | Disbursement           | 900.0  | 0.0       | 0.0   
   | 0.0  | 0.0       | 900.0        |
+      | 05 April 2025    | Repayment              | 100.0  | 100.0     | 0.0   
   | 0.0  | 0.0       | 800.0        |
+      | 14 April 2025    | Accrual                | 7.57   | 0.0       | 7.57  
   | 0.0  | 0.0       | 0.0          |
+      | 14 April 2025    | Charge-off             | 818.75 | 800.0     | 18.75 
   | 0.0  | 0.0       | 0.0          |
+      | 15 April 2025    | Merchant Issued Refund | 900.0  | 800.0     | 18.75 
   | 0.0  | 0.0       | 0.0          |
+    When Customer undo "1"th repayment on "05 April 2025"
+    Then Loan Repayment schedule has 4 periods, with the following data for 
periods:
+      | Nr | Days | Date          | Paid date     | Balance of loan | 
Principal due | Interest | Fees | Penalties | Due    | Paid   | In advance | 
Late   | Outstanding |
+      |    |      | 14 March 2025 |               | 900.0           |          
     |          | 0.0  |           | 0.0    | 0.0    |            |        |    
         |
+      | 1  | 31   | 14 April 2025 | 15 April 2025 | 677.88          | 222.12   
     | 7.57     | 0.0  | 0.0       | 229.69 | 229.69 | 0.0        | 229.69 | 
0.0         |
+      | 2  | 30   | 14 May 2025   | 15 April 2025 | 453.71          | 224.17   
     | 5.52     | 0.0  | 0.0       | 229.69 | 229.69 | 229.69     | 0.0    | 
0.0         |
+      | 3  | 31   | 14 June 2025  | 15 April 2025 | 227.83          | 225.88   
     | 3.81     | 0.0  | 0.0       | 229.69 | 229.69 | 229.69     | 0.0    | 
0.0         |
+      | 4  | 30   | 14 July 2025  |               | 0.0             | 227.83   
     | 1.85     | 0.0  | 0.0       | 229.68 | 210.93 | 210.93     | 0.0    | 
18.75       |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid  | In 
advance | Late   | Outstanding |
+      | 900.0         | 18.75    | 0.0  | 0.0       | 918.75 | 900.0 | 670.31  
   | 229.69 | 18.75       |
+    Then Loan Transactions tab has the following data:
+      | Transaction date | Transaction Type       | Amount | Principal | 
Interest | Fees | Penalties | Loan Balance | Reverted | Replayed |
+      | 14 March 2025    | Disbursement           | 900.0  | 0.0       | 0.0   
   | 0.0  | 0.0       | 900.0        | false    | false    |
+      | 05 April 2025    | Repayment              | 100.0  | 100.0     | 0.0   
   | 0.0  | 0.0       | 800.0        | true     | false    |
+      | 14 April 2025    | Accrual                | 7.57   | 0.0       | 7.57  
   | 0.0  | 0.0       | 0.0          | false    | false    |
+      | 14 April 2025    | Charge-off             | 918.75 | 900.0     | 18.75 
   | 0.0  | 0.0       | 0.0          | false    | true     |
+      | 15 April 2025    | Merchant Issued Refund | 900.0  | 883.1     | 16.9  
   | 0.0  | 0.0       | 16.9         | false    | true     |
+
+  @TestRailId:C3623
+  Scenario: Verify repayment reversal after zero interest behaviour charge-off 
and merchant issued refund and interestRecalculation=false
+    When Admin sets the business date to "14 March 2025"
+    When Admin creates a client with random data
+    When Admin creates a fully customized loan with the following data:
+      | LoanProduct                                                            
                          | submitted on date | with Principal | ANNUAL 
interest rate % | interest type     | interest calculation period | 
amortization type  | loanTermFrequency | loanTermFrequencyType | repaymentEvery 
| repaymentFrequencyType | numberOfRepayments | graceOnPrincipalPayment | 
graceOnInterestPayment | interest free period | Payment strategy            |
+      | 
LP2_ADV_PYMNT_INT_DAILY_EMI_ACTUAL_ACTUAL_NO_INTEREST_RECALC_INT_REFUND_FULL_ZERO_INT_CHARGE_OFF
 | 14 March 2025     | 900            | 9.9                    | 
DECLINING_BALANCE | DAILY                       | EQUAL_INSTALLMENTS | 4        
         | MONTHS                | 1              | MONTHS                 | 4  
                | 0                       | 0                      | 0          
          | ADVANCED_PAYMENT_ALLOCATION |
+    And Admin successfully approves the loan on "14 March 2025" with "900" 
amount and expected disbursement date on "14 March 2025"
+    And Admin successfully disburse the loan on "14 March 2025" with "900" EUR 
transaction amount
+    Then Loan Repayment schedule has 4 periods, with the following data for 
periods:
+      | Nr | Days | Date          | Paid date | Balance of loan | Principal 
due | Interest | Fees | Penalties | Due    | Paid | In advance | Late | 
Outstanding |
+      |    |      | 14 March 2025 |           | 900.0           |              
 |          | 0.0  |           | 0.0    | 0.0  |            |      |            
 |
+      | 1  | 31   | 14 April 2025 |           | 677.88          | 222.12       
 | 7.57     | 0.0  | 0.0       | 229.69 | 0.0  | 0.0        | 0.0  | 229.69     
 |
+      | 2  | 30   | 14 May 2025   |           | 453.71          | 224.17       
 | 5.52     | 0.0  | 0.0       | 229.69 | 0.0  | 0.0        | 0.0  | 229.69     
 |
+      | 3  | 31   | 14 June 2025  |           | 227.83          | 225.88       
 | 3.81     | 0.0  | 0.0       | 229.69 | 0.0  | 0.0        | 0.0  | 229.69     
 |
+      | 4  | 30   | 14 July 2025  |           | 0.0             | 227.83       
 | 1.85     | 0.0  | 0.0       | 229.68 | 0.0  | 0.0        | 0.0  | 229.68     
 |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid | In 
advance | Late | Outstanding |
+      | 900.0         | 18.75    | 0.0  | 0.0       | 918.75 | 0.0  | 0.0      
  | 0.0  | 918.75      |
+    Then Loan Transactions tab has the following data:
+      | Transaction date | Transaction Type | Amount | Principal | Interest | 
Fees | Penalties | Loan Balance |
+      | 14 March 2025    | Disbursement     | 900.0  | 0.0       | 0.0      | 
0.0  | 0.0       | 900.0        |
+    When Admin sets the business date to "05 April 2025"
+    And Customer makes "REPAYMENT" transaction with "AUTOPAY" payment type on 
"05 April 2025" with 100 EUR transaction amount and system-generated 
Idempotency key
+    Then Loan Repayment schedule has 4 periods, with the following data for 
periods:
+      | Nr | Days | Date          | Paid date | Balance of loan | Principal 
due | Interest | Fees | Penalties | Due    | Paid  | In advance | Late | 
Outstanding |
+      |    |      | 14 March 2025 |           | 900.0           |              
 |          | 0.0  |           | 0.0    | 0.0   |            |      |           
  |
+      | 1  | 31   | 14 April 2025 |           | 677.88          | 222.12       
 | 7.57     | 0.0  | 0.0       | 229.69 | 100.0 | 100.0      | 0.0  | 129.69    
  |
+      | 2  | 30   | 14 May 2025   |           | 453.71          | 224.17       
 | 5.52     | 0.0  | 0.0       | 229.69 | 0.0   | 0.0        | 0.0  | 229.69    
  |
+      | 3  | 31   | 14 June 2025  |           | 227.83          | 225.88       
 | 3.81     | 0.0  | 0.0       | 229.69 | 0.0   | 0.0        | 0.0  | 229.69    
  |
+      | 4  | 30   | 14 July 2025  |           | 0.0             | 227.83       
 | 1.85     | 0.0  | 0.0       | 229.68 | 0.0   | 0.0        | 0.0  | 229.68    
  |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid  | In 
advance | Late | Outstanding |
+      | 900.0         | 18.75    | 0.0  | 0.0       | 918.75 | 100.0 | 100.0   
   | 0.0  | 818.75      |
+    Then Loan Transactions tab has the following data:
+      | Transaction date | Transaction Type | Amount | Principal | Interest | 
Fees | Penalties | Loan Balance |
+      | 14 March 2025    | Disbursement     | 900.0  | 0.0       | 0.0      | 
0.0  | 0.0       | 900.0        |
+      | 05 April 2025    | Repayment        | 100.0  | 100.0     | 0.0      | 
0.0  | 0.0       | 800.0        |
+    When Admin sets the business date to "14 April 2025"
+    And Admin does charge-off the loan on "14 April 2025"
+    When Admin runs inline COB job for Loan
+    Then Loan Repayment schedule has 4 periods, with the following data for 
periods:
+      | Nr | Days | Date          | Paid date | Balance of loan | Principal 
due | Interest | Fees | Penalties | Due    | Paid  | In advance | Late | 
Outstanding |
+      |    |      | 14 March 2025 |           | 900.0           |              
 |          | 0.0  |           | 0.0    | 0.0   |            |      |           
  |
+      | 1  | 31   | 14 April 2025 |           | 677.88          | 222.12       
 | 7.57     | 0.0  | 0.0       | 229.69 | 100.0 | 100.0      | 0.0  | 129.69    
  |
+      | 2  | 30   | 14 May 2025   |           | 448.19          | 229.69       
 | 0.0      | 0.0  | 0.0       | 229.69 | 0.0   | 0.0        | 0.0  | 229.69    
  |
+      | 3  | 31   | 14 June 2025  |           | 218.5           | 229.69       
 | 0.0      | 0.0  | 0.0       | 229.69 | 0.0   | 0.0        | 0.0  | 229.69    
  |
+      | 4  | 30   | 14 July 2025  |           | 0.0             | 218.5        
 | 0.0      | 0.0  | 0.0       | 218.5  | 0.0   | 0.0        | 0.0  | 218.5     
  |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid  | In 
advance | Late | Outstanding |
+      | 900.0         | 7.57     | 0.0  | 0.0       | 907.57 | 100.0 | 100.0   
   | 0.0  | 807.57      |
+    Then Loan Transactions tab has the following data:
+      | Transaction date | Transaction Type | Amount | Principal | Interest | 
Fees | Penalties | Loan Balance |
+      | 14 March 2025    | Disbursement     | 900.0  | 0.0       | 0.0      | 
0.0  | 0.0       | 900.0        |
+      | 05 April 2025    | Repayment        | 100.0  | 100.0     | 0.0      | 
0.0  | 0.0       | 800.0        |
+      | 14 April 2025    | Accrual          | 7.57   | 0.0       | 7.57     | 
0.0  | 0.0       | 0.0          |
+      | 14 April 2025    | Charge-off       | 807.57 | 800.0     | 7.57     | 
0.0  | 0.0       | 0.0          |
+    When Admin sets the business date to "15 April 2025"
+    And Customer makes "MERCHANT_ISSUED_REFUND" transaction with "AUTOPAY" 
payment type on "15 April 2025" with 900 EUR transaction amount and 
system-generated Idempotency key
+    Then Loan Repayment schedule has 4 periods, with the following data for 
periods:
+      | Nr | Days | Date          | Paid date     | Balance of loan | 
Principal due | Interest | Fees | Penalties | Due    | Paid   | In advance | 
Late   | Outstanding |
+      |    |      | 14 March 2025 |               | 900.0           |          
     |          | 0.0  |           | 0.0    | 0.0    |            |        |    
         |
+      | 1  | 31   | 14 April 2025 | 15 April 2025 | 677.88          | 222.12   
     | 7.57     | 0.0  | 0.0       | 229.69 | 229.69 | 100.0      | 129.69 | 
0.0         |
+      | 2  | 30   | 14 May 2025   | 15 April 2025 | 448.19          | 229.69   
     | 0.0      | 0.0  | 0.0       | 229.69 | 229.69 | 229.69     | 0.0    | 
0.0         |
+      | 3  | 31   | 14 June 2025  | 15 April 2025 | 218.5           | 229.69   
     | 0.0      | 0.0  | 0.0       | 229.69 | 229.69 | 229.69     | 0.0    | 
0.0         |
+      | 4  | 30   | 14 July 2025  | 15 April 2025 | 0.0             | 218.5    
     | 0.0      | 0.0  | 0.0       | 218.5  | 218.5  | 218.5      | 0.0    | 
0.0         |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid   | In 
advance | Late   | Outstanding |
+      | 900.0         | 7.57     | 0.0  | 0.0       | 907.57 | 907.57 | 777.88 
    | 129.69 | 0.0         |
+    Then Loan Transactions tab has the following data:
+      | Transaction date | Transaction Type       | Amount | Principal | 
Interest | Fees | Penalties | Loan Balance |
+      | 14 March 2025    | Disbursement           | 900.0  | 0.0       | 0.0   
   | 0.0  | 0.0       | 900.0        |
+      | 05 April 2025    | Repayment              | 100.0  | 100.0     | 0.0   
   | 0.0  | 0.0       | 800.0        |
+      | 14 April 2025    | Accrual                | 7.57   | 0.0       | 7.57  
   | 0.0  | 0.0       | 0.0          |
+      | 14 April 2025    | Charge-off             | 807.57 | 800.0     | 7.57  
   | 0.0  | 0.0       | 0.0          |
+      | 15 April 2025    | Merchant Issued Refund | 900.0  | 800.0     | 7.57  
   | 0.0  | 0.0       | 0.0          |
+    When Customer undo "1"th repayment on "05 April 2025"
+    Then Loan Repayment schedule has 4 periods, with the following data for 
periods:
+      | Nr | Days | Date          | Paid date     | Balance of loan | 
Principal due | Interest | Fees | Penalties | Due    | Paid   | In advance | 
Late   | Outstanding |
+      |    |      | 14 March 2025 |               | 900.0           |          
     |          | 0.0  |           | 0.0    | 0.0    |            |        |    
         |
+      | 1  | 31   | 14 April 2025 | 15 April 2025 | 677.88          | 222.12   
     | 7.57     | 0.0  | 0.0       | 229.69 | 229.69 | 0.0        | 229.69 | 
0.0         |
+      | 2  | 30   | 14 May 2025   | 15 April 2025 | 448.19          | 229.69   
     | 0.0      | 0.0  | 0.0       | 229.69 | 229.69 | 229.69     | 0.0    | 
0.0         |
+      | 3  | 31   | 14 June 2025  | 15 April 2025 | 218.5           | 229.69   
     | 0.0      | 0.0  | 0.0       | 229.69 | 229.69 | 229.69     | 0.0    | 
0.0         |
+      | 4  | 30   | 14 July 2025  |               | 0.0             | 218.5    
     | 0.0      | 0.0  | 0.0       | 218.5  | 210.93 | 210.93     | 0.0    | 
7.57        |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid  | In 
advance | Late   | Outstanding |
+      | 900.0         | 7.57     | 0.0  | 0.0       | 907.57 | 900.0 | 670.31  
   | 229.69 | 7.57        |
+    Then Loan Transactions tab has the following data:
+      | Transaction date | Transaction Type       | Amount | Principal | 
Interest | Fees | Penalties | Loan Balance | Reverted | Replayed |
+      | 14 March 2025    | Disbursement           | 900.0  | 0.0       | 0.0   
   | 0.0  | 0.0       | 900.0        | false    | false    |
+      | 05 April 2025    | Repayment              | 100.0  | 100.0     | 0.0   
   | 0.0  | 0.0       | 800.0        | true     | false    |
+      | 14 April 2025    | Accrual                | 7.57   | 0.0       | 7.57  
   | 0.0  | 0.0       | 0.0          | false    | false    |
+      | 14 April 2025    | Charge-off             | 907.57 | 900.0     | 7.57  
   | 0.0  | 0.0       | 0.0          | false    | true     |
+      | 15 April 2025    | Merchant Issued Refund | 900.0  | 892.43    | 7.57  
   | 0.0  | 0.0       | 7.57         | false    | true     |
+
+  @TestRailId:C3624
+  Scenario: Verify repayment reversal after accelerate maturity behaviour 
charge-off and merchant issued refund and interestRecalculation=false
+    When Admin sets the business date to "14 March 2025"
+    When Admin creates a client with random data
+    When Admin creates a fully customized loan with the following data:
+      | LoanProduct                                                            
                           | submitted on date | with Principal | ANNUAL 
interest rate % | interest type     | interest calculation period | 
amortization type  | loanTermFrequency | loanTermFrequencyType | repaymentEvery 
| repaymentFrequencyType | numberOfRepayments | graceOnPrincipalPayment | 
graceOnInterestPayment | interest free period | Payment strategy            |
+      | 
LP2_ADV_PYMNT_INT_DAILY_EMI_ACTUAL_ACTUAL_NO_INTEREST_RECALC_INT_REFUND_FULL_ACC_MATUR_CHARGE_OFF
 | 14 March 2025     | 900            | 9.9                    | 
DECLINING_BALANCE | DAILY                       | EQUAL_INSTALLMENTS | 4        
         | MONTHS                | 1              | MONTHS                 | 4  
                | 0                       | 0                      | 0          
          | ADVANCED_PAYMENT_ALLOCATION |
+    And Admin successfully approves the loan on "14 March 2025" with "900" 
amount and expected disbursement date on "14 March 2025"
+    And Admin successfully disburse the loan on "14 March 2025" with "900" EUR 
transaction amount
+    Then Loan Repayment schedule has 4 periods, with the following data for 
periods:
+      | Nr | Days | Date          | Paid date | Balance of loan | Principal 
due | Interest | Fees | Penalties | Due    | Paid | In advance | Late | 
Outstanding |
+      |    |      | 14 March 2025 |           | 900.0           |              
 |          | 0.0  |           | 0.0    | 0.0  |            |      |            
 |
+      | 1  | 31   | 14 April 2025 |           | 677.88          | 222.12       
 | 7.57     | 0.0  | 0.0       | 229.69 | 0.0  | 0.0        | 0.0  | 229.69     
 |
+      | 2  | 30   | 14 May 2025   |           | 453.71          | 224.17       
 | 5.52     | 0.0  | 0.0       | 229.69 | 0.0  | 0.0        | 0.0  | 229.69     
 |
+      | 3  | 31   | 14 June 2025  |           | 227.83          | 225.88       
 | 3.81     | 0.0  | 0.0       | 229.69 | 0.0  | 0.0        | 0.0  | 229.69     
 |
+      | 4  | 30   | 14 July 2025  |           | 0.0             | 227.83       
 | 1.85     | 0.0  | 0.0       | 229.68 | 0.0  | 0.0        | 0.0  | 229.68     
 |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid | In 
advance | Late | Outstanding |
+      | 900.0         | 18.75    | 0.0  | 0.0       | 918.75 | 0.0  | 0.0      
  | 0.0  | 918.75      |
+    Then Loan Transactions tab has the following data:
+      | Transaction date | Transaction Type | Amount | Principal | Interest | 
Fees | Penalties | Loan Balance |
+      | 14 March 2025    | Disbursement     | 900.0  | 0.0       | 0.0      | 
0.0  | 0.0       | 900.0        |
+    When Admin sets the business date to "05 April 2025"
+    And Customer makes "REPAYMENT" transaction with "AUTOPAY" payment type on 
"05 April 2025" with 100 EUR transaction amount and system-generated 
Idempotency key
+    Then Loan Repayment schedule has 4 periods, with the following data for 
periods:
+      | Nr | Days | Date          | Paid date | Balance of loan | Principal 
due | Interest | Fees | Penalties | Due    | Paid  | In advance | Late | 
Outstanding |
+      |    |      | 14 March 2025 |           | 900.0           |              
 |          | 0.0  |           | 0.0    | 0.0   |            |      |           
  |
+      | 1  | 31   | 14 April 2025 |           | 677.88          | 222.12       
 | 7.57     | 0.0  | 0.0       | 229.69 | 100.0 | 100.0      | 0.0  | 129.69    
  |
+      | 2  | 30   | 14 May 2025   |           | 453.71          | 224.17       
 | 5.52     | 0.0  | 0.0       | 229.69 | 0.0   | 0.0        | 0.0  | 229.69    
  |
+      | 3  | 31   | 14 June 2025  |           | 227.83          | 225.88       
 | 3.81     | 0.0  | 0.0       | 229.69 | 0.0   | 0.0        | 0.0  | 229.69    
  |
+      | 4  | 30   | 14 July 2025  |           | 0.0             | 227.83       
 | 1.85     | 0.0  | 0.0       | 229.68 | 0.0   | 0.0        | 0.0  | 229.68    
  |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid  | In 
advance | Late | Outstanding |
+      | 900.0         | 18.75    | 0.0  | 0.0       | 918.75 | 100.0 | 100.0   
   | 0.0  | 818.75      |
+    Then Loan Transactions tab has the following data:
+      | Transaction date | Transaction Type | Amount | Principal | Interest | 
Fees | Penalties | Loan Balance |
+      | 14 March 2025    | Disbursement     | 900.0  | 0.0       | 0.0      | 
0.0  | 0.0       | 900.0        |
+      | 05 April 2025    | Repayment        | 100.0  | 100.0     | 0.0      | 
0.0  | 0.0       | 800.0        |
+    When Admin sets the business date to "14 April 2025"
+    And Admin does charge-off the loan on "14 April 2025"
+    When Admin runs inline COB job for Loan
+    Then Loan Repayment schedule has 1 periods, with the following data for 
periods:
+      | Nr | Days | Date          | Paid date | Balance of loan | Principal 
due | Interest | Fees | Penalties | Due    | Paid  | In advance | Late | 
Outstanding |
+      |    |      | 14 March 2025 |           | 900.0           |              
 |          | 0.0  |           | 0.0    | 0.0   |            |      |           
  |
+      | 1  | 31   | 14 April 2025 |           | 0.0             | 900.0        
 | 7.57     | 0.0  | 0.0       | 907.57 | 100.0 | 100.0      | 0.0  | 807.57    
  |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid  | In 
advance | Late | Outstanding |
+      | 900.0         | 7.57     | 0.0  | 0.0       | 907.57 | 100.0 | 100.0   
   | 0.0  | 807.57      |
+    Then Loan Transactions tab has the following data:
+      | Transaction date | Transaction Type | Amount | Principal | Interest | 
Fees | Penalties | Loan Balance |
+      | 14 March 2025    | Disbursement     | 900.0  | 0.0       | 0.0      | 
0.0  | 0.0       | 900.0        |
+      | 05 April 2025    | Repayment        | 100.0  | 100.0     | 0.0      | 
0.0  | 0.0       | 800.0        |
+      | 14 April 2025    | Accrual          | 7.57   | 0.0       | 7.57     | 
0.0  | 0.0       | 0.0          |
+      | 14 April 2025    | Charge-off       | 807.57 | 800.0     | 7.57     | 
0.0  | 0.0       | 0.0          |
+    When Admin sets the business date to "15 April 2025"
+    And Customer makes "MERCHANT_ISSUED_REFUND" transaction with "AUTOPAY" 
payment type on "15 April 2025" with 900 EUR transaction amount and 
system-generated Idempotency key
+    Then Loan Repayment schedule has 1 periods, with the following data for 
periods:
+      | Nr | Days | Date          | Paid date     | Balance of loan | 
Principal due | Interest | Fees | Penalties | Due    | Paid   | In advance | 
Late   | Outstanding |
+      |    |      | 14 March 2025 |               | 900.0           |          
     |          | 0.0  |           | 0.0    | 0.0    |            |        |    
         |
+      | 1  | 31   | 14 April 2025 | 15 April 2025 | 0.0             | 900.0    
     | 7.57     | 0.0  | 0.0       | 907.57 | 907.57 | 100.0      | 807.57 | 
0.0         |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid   | In 
advance | Late   | Outstanding |
+      | 900.0         | 7.57     | 0.0  | 0.0       | 907.57 | 907.57 | 100.0  
    | 807.57 | 0.0         |
+    Then Loan Transactions tab has the following data:
+      | Transaction date | Transaction Type       | Amount | Principal | 
Interest | Fees | Penalties | Loan Balance |
+      | 14 March 2025    | Disbursement           | 900.0  | 0.0       | 0.0   
   | 0.0  | 0.0       | 900.0        |
+      | 05 April 2025    | Repayment              | 100.0  | 100.0     | 0.0   
   | 0.0  | 0.0       | 800.0        |
+      | 14 April 2025    | Accrual                | 7.57   | 0.0       | 7.57  
   | 0.0  | 0.0       | 0.0          |
+      | 14 April 2025    | Charge-off             | 807.57 | 800.0     | 7.57  
   | 0.0  | 0.0       | 0.0          |
+      | 15 April 2025    | Merchant Issued Refund | 900.0  | 800.0     | 7.57  
   | 0.0  | 0.0       | 0.0          |
+    When Customer undo "1"th repayment on "05 April 2025"
+    Then Loan Repayment schedule has 1 periods, with the following data for 
periods:
+      | Nr | Days | Date          | Paid date | Balance of loan | Principal 
due | Interest | Fees | Penalties | Due    | Paid  | In advance | Late  | 
Outstanding |
+      |    |      | 14 March 2025 |           | 900.0           |              
 |          | 0.0  |           | 0.0    | 0.0   |            |       |          
   |
+      | 1  | 31   | 14 April 2025 |           | 0.0             | 900.0        
 | 7.57     | 0.0  | 0.0       | 907.57 | 900.0 | 0.0        | 900.0 | 7.57     
   |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid  | In 
advance | Late  | Outstanding |
+      | 900.0         | 7.57     | 0.0  | 0.0       | 907.57 | 900.0 | 0.0     
   | 900.0 | 7.57        |
+    Then Loan Transactions tab has the following data:
+      | Transaction date | Transaction Type       | Amount | Principal | 
Interest | Fees | Penalties | Loan Balance | Reverted | Replayed |
+      | 14 March 2025    | Disbursement           | 900.0  | 0.0       | 0.0   
   | 0.0  | 0.0       | 900.0        | false    | false    |
+      | 05 April 2025    | Repayment              | 100.0  | 100.0     | 0.0   
   | 0.0  | 0.0       | 800.0        | true     | false    |
+      | 14 April 2025    | Accrual                | 7.57   | 0.0       | 7.57  
   | 0.0  | 0.0       | 0.0          | false    | false    |
+      | 14 April 2025    | Charge-off             | 907.57 | 900.0     | 7.57  
   | 0.0  | 0.0       | 0.0          | false    | true     |
+      | 15 April 2025    | Merchant Issued Refund | 900.0  | 900.0     | 0.0   
   | 0.0  | 0.0       | 0.0          | false    | true     |
\ No newline at end of file

Reply via email to