Skip to content

Commit 02c580d

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

2 files changed

Lines changed: 62 additions & 17 deletions

File tree

.github/workflows/regression-safety-db-changes.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ jobs:
173173
run: |
174174
./gradlew --no-daemon --console=plain \
175175
:fineract-e2e-tests-runner:cucumber \
176-
-Pcucumber.features="src/test/resources/features/LoanRegressionSafety.feature" \
176+
-Pcucumber.features="src/test/resources/features/DbRegressionSmoke.feature" \
177177
-x spotlessCheck
178178
179179
- name: "Instance #1: Stop backend"
@@ -270,7 +270,7 @@ jobs:
270270
run: |
271271
./gradlew --no-daemon --console=plain \
272272
:fineract-e2e-tests-runner:cucumber \
273-
-Pcucumber.features="src/test/resources/features/LoanRegressionSafety.feature" \
273+
-Pcucumber.features="src/test/resources/features/DbRegressionSmoke.feature" \
274274
-x spotlessCheck
275275
276276
- name: "Instance #2: Stop backend"
@@ -334,7 +334,7 @@ jobs:
334334
run: |
335335
./gradlew --no-daemon --console=plain \
336336
:fineract-e2e-tests-runner:cucumber \
337-
-Pcucumber.features="src/test/resources/features/LoanRegressionSafety.feature" \
337+
-Pcucumber.features="src/test/resources/features/DbRegressionSmoke.feature" \
338338
-x spotlessCheck
339339
340340
- name: "Instance #3: Stop backend"
Lines changed: 59 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,77 @@
1-
@RegressionSafety
2-
Feature: Loan Lifecycle Regression Safety
3-
Exercises the complete loan lifecycle through all major state transitions.
4-
Designed to be run against multiple Fineract instances with different DB states
5-
to catch regressions introduced by database schema changes.
6-
Based on proven patterns from 0_COB.feature (C2501, C2681).
1+
@DbRegressionSmoke
2+
Feature: DbRegressionSmoke
73

8-
@TestRailId:C3500 @RegressionSafety
9-
Scenario: Full loan lifecycle - create, disburse, partial repay, COB with delinquency, full payoff
10-
# -- Setup and disbursement --
4+
@TestRailId:C76758
5+
Scenario: Verify loan delinquency lifecycle (in-advance + late repayment) after DB changes
6+
# --- Setup + disburse --------------------------------------------------
117
When Admin sets the business date to "01 January 2022"
128
When Admin creates a client with random data
139
When Admin creates a new default Loan with date: "01 January 2022"
1410
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
11+
And Admin successfully disburse the loan on "01 January 2022" with "1000" EUR transaction amount
1612
Then Loan status will be "ACTIVE"
1713
Then Loan has 1000 outstanding amount
18-
# -- Partial repayment before due date (monetary action) --
14+
Then Loan Repayment schedule has 1 periods, with the following data for periods:
15+
| Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
16+
| | | 01 January 2022 | | 1000.0 | | | 0.0 | | 0.0 | 0.0 | | | |
17+
| 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 |
18+
Then Loan Repayment schedule has the following data in Total row:
19+
| Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
20+
| 1000.0 | 0.0 | 0.0 | 0.0 | 1000.0 | 0.0 | 0.0 | 0.0 | 1000.0 |
21+
Then Loan Transactions tab has the following data:
22+
| Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance |
23+
| 01 January 2022 | Disbursement | 1000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1000.0 |
24+
25+
# --- IN-ADVANCE partial repayment (15 Jan, before due 31 Jan) ---------
26+
# Writes to m_loan_transaction, m_loan_transaction_repayment_schedule_mapping
27+
# AND records the amount in the "In advance" column of the schedule.
1928
When Admin sets the business date to "15 January 2022"
2029
And Customer makes "AUTOPAY" repayment on "15 January 2022" with 500 EUR transaction amount
2130
Then Repayment transaction is created with 500 amount and "AUTOPAY" type
2231
Then Loan has 500 outstanding amount
2332
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 --
33+
Then Loan Repayment schedule has 1 periods, with the following data for periods:
34+
| Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
35+
| | | 01 January 2022 | | 1000.0 | | | 0.0 | | 0.0 | 0.0 | | | |
36+
| 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 |
37+
Then Loan Repayment schedule has the following data in Total row:
38+
| Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
39+
| 1000.0 | 0.0 | 0.0 | 0.0 | 1000.0 | 500.0 | 500.0 | 0.0 | 500.0 |
40+
Then Loan Transactions tab has the following data:
41+
| Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance |
42+
| 01 January 2022 | Disbursement | 1000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1000.0 |
43+
| 15 January 2022 | Repayment | 500.0 | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 |
44+
45+
# --- Advance past due (04 Feb) + COB triggers delinquency --------------
46+
# Default LP1 has an arrears setting of 3 days -> delinquent from 03 Feb.
47+
# Writes to m_loan (lastClosedBusinessDate), m_loan_delinquency_tag_history,
48+
# m_delinquency_range. Interest-free, no charges -> no Accrual rows.
2649
When Admin sets the business date to "04 February 2022"
2750
When Admin runs COB job
2851
Then Admin checks that delinquency range is: "RANGE_1" and has delinquentDate "2022-02-03"
29-
# -- Full payoff --
52+
Then Loan Repayment schedule has the following data in Total row:
53+
| Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
54+
| 1000.0 | 0.0 | 0.0 | 0.0 | 1000.0 | 500.0 | 500.0 | 0.0 | 500.0 |
55+
Then Loan Transactions tab has the following data:
56+
| Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance |
57+
| 01 January 2022 | Disbursement | 1000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1000.0 |
58+
| 15 January 2022 | Repayment | 500.0 | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 |
59+
60+
# --- LATE full payoff (04 Feb, after due) -----------------------------
61+
# This 500 lands in the "Late" column (paid after 31 Jan due date).
62+
# Final schedule shows both in-advance 500 and late 500 amounts.
3063
And Customer makes "AUTOPAY" repayment on "04 February 2022" with 500 EUR transaction amount
64+
Then Loan Repayment schedule has 1 periods, with the following data for periods:
65+
| Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
66+
| | | 01 January 2022 | | 1000.0 | | | 0.0 | | 0.0 | 0.0 | | | |
67+
| 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 |
68+
Then Loan Repayment schedule has the following data in Total row:
69+
| Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
70+
| 1000.0 | 0.0 | 0.0 | 0.0 | 1000.0 | 1000.0 | 500.0 | 500.0 | 0.0 |
71+
Then Loan Transactions tab has the following data:
72+
| Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance |
73+
| 01 January 2022 | Disbursement | 1000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1000.0 |
74+
| 15 January 2022 | Repayment | 500.0 | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 |
75+
| 04 February 2022 | Repayment | 500.0 | 500.0 | 0.0 | 0.0 | 0.0 | 0.0 |
3176
Then Loan has 0 outstanding amount
3277
Then Loan status will be "CLOSED_OBLIGATIONS_MET"

0 commit comments

Comments
 (0)