|
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 |
7 | 3 |
|
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 -------------------------------------------------- |
11 | 7 | When Admin sets the business date to "01 January 2022" |
12 | 8 | When Admin creates a client with random data |
13 | 9 | When Admin creates a new default Loan with date: "01 January 2022" |
14 | 10 | 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 |
16 | 12 | Then Loan status will be "ACTIVE" |
17 | 13 | 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. |
19 | 28 | When Admin sets the business date to "15 January 2022" |
20 | 29 | And Customer makes "AUTOPAY" repayment on "15 January 2022" with 500 EUR transaction amount |
21 | 30 | Then Repayment transaction is created with 500 amount and "AUTOPAY" type |
22 | 31 | Then Loan has 500 outstanding amount |
23 | 32 | 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. |
26 | 49 | When Admin sets the business date to "04 February 2022" |
27 | 50 | When Admin runs COB job |
28 | 51 | 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. |
30 | 63 | 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 | |
31 | 76 | Then Loan has 0 outstanding amount |
32 | 77 | Then Loan status will be "CLOSED_OBLIGATIONS_MET" |
0 commit comments