Skip to content

Commit 6092e2d

Browse files
committed
FINERACT-2581: add regression safety checks for db changes - update e2e scenario
1 parent f404593 commit 6092e2d

1 file changed

Lines changed: 57 additions & 8 deletions

File tree

fineract-e2e-tests-runner/src/test/resources/features/LoanRegressionSafety.feature

Lines changed: 57 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,77 @@ Feature: Loan Lifecycle Regression Safety
55
to catch regressions introduced by database schema changes.
66
Based on proven patterns from 0_COB.feature (C2501, C2681).
77

8-
@TestRailId:C3500 @RegressionSafety
9-
Scenario: Full loan lifecycle - create, disburse, partial repay, COB with delinquency, full payoff
10-
# -- Setup and disbursement --
8+
@TestRailId:C76758
9+
Scenario: Verify loan delinquency lifecycle (in-advance + late repayment) after DB changes
10+
# --- Setup + disburse --------------------------------------------------
1111
When Admin sets the business date to "01 January 2022"
1212
When Admin creates a client with random data
1313
When Admin creates a new default Loan with date: "01 January 2022"
1414
And Admin successfully approves the loan on "01 January 2022" with "1000" amount and expected disbursement date on "01 January 2022"
15-
When Admin successfully disburse the loan on "01 January 2022" with "1000" EUR transaction amount
15+
And Admin successfully disburse the loan on "01 January 2022" with "1000" EUR transaction amount
1616
Then Loan status will be "ACTIVE"
1717
Then Loan has 1000 outstanding amount
18-
# -- Partial repayment before due date (monetary action) --
18+
Then Loan Repayment schedule has 1 periods, with the following data for periods:
19+
| Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
20+
| | | 01 January 2022 | | 1000.0 | | | 0.0 | | 0.0 | 0.0 | | | |
21+
| 1 | 30 | 31 January 2022 | | 0.0 | 1000.0 | 0.0 | 0.0 | 0.0 | 1000.0 | 0.0 | 0.0 | 0.0 | 1000.0 |
22+
Then Loan Repayment schedule has the following data in Total row:
23+
| Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
24+
| 1000.0 | 0.0 | 0.0 | 0.0 | 1000.0 | 0.0 | 0.0 | 0.0 | 1000.0 |
25+
Then Loan Transactions tab has the following data:
26+
| Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance |
27+
| 01 January 2022 | Disbursement | 1000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1000.0 |
28+
29+
# --- IN-ADVANCE partial repayment (15 Jan, before due 31 Jan) ---------
30+
# Writes to m_loan_transaction, m_loan_transaction_repayment_schedule_mapping
31+
# AND records the amount in the "In advance" column of the schedule.
1932
When Admin sets the business date to "15 January 2022"
2033
And Customer makes "AUTOPAY" repayment on "15 January 2022" with 500 EUR transaction amount
2134
Then Repayment transaction is created with 500 amount and "AUTOPAY" type
2235
Then Loan has 500 outstanding amount
2336
Then Loan status will be "ACTIVE"
24-
# -- Advance past due date (Feb 1), run COB, verify delinquency --
25-
# -- Arrears setting is 3 on default product -> delinquent from Feb 3 --
37+
Then Loan Repayment schedule has 1 periods, with the following data for periods:
38+
| Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
39+
| | | 01 January 2022 | | 1000.0 | | | 0.0 | | 0.0 | 0.0 | | | |
40+
| 1 | 30 | 31 January 2022 | | 0.0 | 1000.0 | 0.0 | 0.0 | 0.0 | 1000.0 | 500.0 | 500.0 | 0.0 | 500.0 |
41+
Then Loan Repayment schedule has the following data in Total row:
42+
| Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
43+
| 1000.0 | 0.0 | 0.0 | 0.0 | 1000.0 | 500.0 | 500.0 | 0.0 | 500.0 |
44+
Then Loan Transactions tab has the following data:
45+
| Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance |
46+
| 01 January 2022 | Disbursement | 1000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1000.0 |
47+
| 15 January 2022 | Repayment | 500.0 | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 |
48+
49+
# --- Advance past due (04 Feb) + COB triggers delinquency --------------
50+
# Default LP1 has an arrears setting of 3 days -> delinquent from 03 Feb.
51+
# Writes to m_loan (lastClosedBusinessDate), m_loan_delinquency_tag_history,
52+
# m_delinquency_range. Interest-free, no charges -> no Accrual rows.
2653
When Admin sets the business date to "04 February 2022"
2754
When Admin runs COB job
2855
Then Admin checks that delinquency range is: "RANGE_1" and has delinquentDate "2022-02-03"
29-
# -- Full payoff --
56+
Then Loan Repayment schedule has the following data in Total row:
57+
| Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
58+
| 1000.0 | 0.0 | 0.0 | 0.0 | 1000.0 | 500.0 | 500.0 | 0.0 | 500.0 |
59+
Then Loan Transactions tab has the following data:
60+
| Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance |
61+
| 01 January 2022 | Disbursement | 1000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1000.0 |
62+
| 15 January 2022 | Repayment | 500.0 | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 |
63+
64+
# --- LATE full payoff (04 Feb, after due) -----------------------------
65+
# This 500 lands in the "Late" column (paid after 31 Jan due date).
66+
# Final schedule shows both in-advance 500 and late 500 amounts.
3067
And Customer makes "AUTOPAY" repayment on "04 February 2022" with 500 EUR transaction amount
68+
Then Loan Repayment schedule has 1 periods, with the following data for periods:
69+
| Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
70+
| | | 01 January 2022 | | 1000.0 | | | 0.0 | | 0.0 | 0.0 | | | |
71+
| 1 | 30 | 31 January 2022 | 04 February 2022 | 0.0 | 1000.0 | 0.0 | 0.0 | 0.0 | 1000.0 | 1000.0 | 500.0 | 500.0 | 0.0 |
72+
Then Loan Repayment schedule has the following data in Total row:
73+
| Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
74+
| 1000.0 | 0.0 | 0.0 | 0.0 | 1000.0 | 1000.0 | 500.0 | 500.0 | 0.0 |
75+
Then Loan Transactions tab has the following data:
76+
| Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance |
77+
| 01 January 2022 | Disbursement | 1000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1000.0 |
78+
| 15 January 2022 | Repayment | 500.0 | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 |
79+
| 04 February 2022 | Repayment | 500.0 | 500.0 | 0.0 | 0.0 | 0.0 | 0.0 |
3180
Then Loan has 0 outstanding amount
3281
Then Loan status will be "CLOSED_OBLIGATIONS_MET"

0 commit comments

Comments
 (0)