FINERACT-2081: Added loan accrual activity test to check the case when undo happens on duedate repayment

This commit is contained in:
tamasszabo-dpc
2025-01-31 15:01:09 +01:00
committed by Adam Saghy
parent 894b6cbf6f
commit bc0293bfa1
@@ -2554,3 +2554,103 @@ Feature: LoanAccrualActivity
| 09 January 2025 | Accrual | 0.72 | 0.0 | 0.72 | 0.0 | 0.0 | 0.0 | false | false | | 09 January 2025 | Accrual | 0.72 | 0.0 | 0.72 | 0.0 | 0.0 | 0.0 | false | false |
| 10 January 2025 | Accrual | 0.6 | 0.0 | 0.6 | 0.0 | 0.0 | 0.0 | false | false | | 10 January 2025 | Accrual | 0.6 | 0.0 | 0.6 | 0.0 | 0.0 | 0.0 | false | false |
| 11 January 2025 | Accrual Adjustment | 1.19 | 0.0 | 1.19 | 0.0 | 0.0 | 0.0 | false | false | | 11 January 2025 | Accrual Adjustment | 1.19 | 0.0 | 1.19 | 0.0 | 0.0 | 0.0 | false | false |
@TestRailId:C3401
Scenario: Verify that accrual activity is not reverse replayed when undo happens on due date repayment
When Admin sets the business date to "08 August 2024"
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_ACCRUAL_ACTIVITY | 08 August 2024 | 400 | 12 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 12 | MONTHS | 1 | MONTHS | 12 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION |
And Admin successfully approves the loan on "08 August 2024" with "400" amount and expected disbursement date on "08 August 2024"
When Admin successfully disburse the loan on "08 August 2024" with "400" EUR transaction amount
When Admin sets the business date to "08 January 2025"
When Admin runs inline COB job for Loan
Then Loan Repayment schedule has 12 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 |
| | | 08 August 2024 | | 400.0 | | | 0.0 | | 0.0 | 0.0 | | | |
| 1 | 31 | 08 September 2024 | | 368.53 | 31.47 | 4.07 | 0.0 | 0.0 | 35.54 | 0.0 | 0.0 | 0.0 | 35.54 |
| 2 | 30 | 08 October 2024 | | 336.61 | 31.92 | 3.62 | 0.0 | 0.0 | 35.54 | 0.0 | 0.0 | 0.0 | 35.54 |
| 3 | 31 | 08 November 2024 | | 304.49 | 32.12 | 3.42 | 0.0 | 0.0 | 35.54 | 0.0 | 0.0 | 0.0 | 35.54 |
| 4 | 30 | 08 December 2024 | | 271.94 | 32.55 | 2.99 | 0.0 | 0.0 | 35.54 | 0.0 | 0.0 | 0.0 | 35.54 |
| 5 | 31 | 08 January 2025 | | 239.17 | 32.77 | 2.77 | 0.0 | 0.0 | 35.54 | 0.0 | 0.0 | 0.0 | 35.54 |
| 6 | 31 | 08 February 2025 | | 206.07 | 33.1 | 2.44 | 0.0 | 0.0 | 35.54 | 0.0 | 0.0 | 0.0 | 35.54 |
| 7 | 28 | 08 March 2025 | | 172.43 | 33.64 | 1.9 | 0.0 | 0.0 | 35.54 | 0.0 | 0.0 | 0.0 | 35.54 |
| 8 | 31 | 08 April 2025 | | 138.65 | 33.78 | 1.76 | 0.0 | 0.0 | 35.54 | 0.0 | 0.0 | 0.0 | 35.54 |
| 9 | 30 | 08 May 2025 | | 104.48 | 34.17 | 1.37 | 0.0 | 0.0 | 35.54 | 0.0 | 0.0 | 0.0 | 35.54 |
| 10 | 31 | 08 June 2025 | | 70.0 | 34.48 | 1.06 | 0.0 | 0.0 | 35.54 | 0.0 | 0.0 | 0.0 | 35.54 |
| 11 | 30 | 08 July 2025 | | 35.15 | 34.85 | 0.69 | 0.0 | 0.0 | 35.54 | 0.0 | 0.0 | 0.0 | 35.54 |
| 12 | 31 | 08 August 2025 | | 0.0 | 35.15 | 0.36 | 0.0 | 0.0 | 35.51 | 0.0 | 0.0 | 0.0 | 35.51 |
Then Loan Repayment schedule has the following data in Total row:
| Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
| 400.0 | 26.45 | 0.0 | 0.0 | 426.45 | 0.0 | 0.0 | 0.0 | 426.45 |
Then Loan Transactions tab has the following data:
| Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance |
| 08 August 2024 | Disbursement | 400.0 | 0.0 | 0.0 | 0.0 | 0.0 | 400.0 |
| 08 September 2024 | Accrual Activity | 4.07 | 0.0 | 4.07 | 0.0 | 0.0 | 0.0 |
| 08 October 2024 | Accrual Activity | 3.62 | 0.0 | 3.62 | 0.0 | 0.0 | 0.0 |
| 08 November 2024 | Accrual Activity | 3.42 | 0.0 | 3.42 | 0.0 | 0.0 | 0.0 |
| 08 December 2024 | Accrual Activity | 2.99 | 0.0 | 2.99 | 0.0 | 0.0 | 0.0 |
| 07 January 2025 | Accrual | 16.78 | 0.0 | 16.78 | 0.0 | 0.0 | 0.0 |
And Customer makes "AUTOPAY" repayment on "08 January 2025" with 500 EUR transaction amount
When Admin runs inline COB job for Loan
Then Loan Repayment schedule has 12 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 |
| | | 08 August 2024 | | 400.0 | | | 0.0 | | 0.0 | 0.0 | | | |
| 1 | 31 | 08 September 2024 | 08 January 2025 | 368.53 | 31.47 | 4.07 | 0.0 | 0.0 | 35.54 | 35.54 | 0.0 | 35.54 | 0.0 |
| 2 | 30 | 08 October 2024 | 08 January 2025 | 336.61 | 31.92 | 3.62 | 0.0 | 0.0 | 35.54 | 35.54 | 0.0 | 35.54 | 0.0 |
| 3 | 31 | 08 November 2024 | 08 January 2025 | 304.49 | 32.12 | 3.42 | 0.0 | 0.0 | 35.54 | 35.54 | 0.0 | 35.54 | 0.0 |
| 4 | 30 | 08 December 2024 | 08 January 2025 | 271.94 | 32.55 | 2.99 | 0.0 | 0.0 | 35.54 | 35.54 | 0.0 | 35.54 | 0.0 |
| 5 | 31 | 08 January 2025 | 08 January 2025 | 239.17 | 32.77 | 2.77 | 0.0 | 0.0 | 35.54 | 35.54 | 0.0 | 0.0 | 0.0 |
| 6 | 31 | 08 February 2025 | 08 January 2025 | 206.07 | 33.1 | 2.44 | 0.0 | 0.0 | 35.54 | 35.54 | 35.54 | 0.0 | 0.0 |
| 7 | 28 | 08 March 2025 | 08 January 2025 | 172.43 | 33.64 | 1.9 | 0.0 | 0.0 | 35.54 | 35.54 | 35.54 | 0.0 | 0.0 |
| 8 | 31 | 08 April 2025 | 08 January 2025 | 138.65 | 33.78 | 1.76 | 0.0 | 0.0 | 35.54 | 35.54 | 35.54 | 0.0 | 0.0 |
| 9 | 30 | 08 May 2025 | 08 January 2025 | 104.48 | 34.17 | 1.37 | 0.0 | 0.0 | 35.54 | 35.54 | 35.54 | 0.0 | 0.0 |
| 10 | 31 | 08 June 2025 | 08 January 2025 | 70.0 | 34.48 | 1.06 | 0.0 | 0.0 | 35.54 | 35.54 | 35.54 | 0.0 | 0.0 |
| 11 | 30 | 08 July 2025 | 08 January 2025 | 35.15 | 34.85 | 0.69 | 0.0 | 0.0 | 35.54 | 35.54 | 35.54 | 0.0 | 0.0 |
| 12 | 31 | 08 August 2025 | 08 January 2025 | 0.0 | 35.15 | 0.36 | 0.0 | 0.0 | 35.51 | 35.51 | 35.51 | 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 |
| 400.0 | 26.45 | 0.0 | 0.0 | 426.45 | 426.45 | 248.75 | 142.16 | 0.0 |
Then Loan Transactions tab has the following data:
| Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance |
| 08 August 2024 | Disbursement | 400.0 | 0.0 | 0.0 | 0.0 | 0.0 | 400.0 |
| 08 September 2024 | Accrual Activity | 4.07 | 0.0 | 4.07 | 0.0 | 0.0 | 0.0 |
| 08 October 2024 | Accrual Activity | 3.62 | 0.0 | 3.62 | 0.0 | 0.0 | 0.0 |
| 08 November 2024 | Accrual Activity | 3.42 | 0.0 | 3.42 | 0.0 | 0.0 | 0.0 |
| 08 December 2024 | Accrual Activity | 2.99 | 0.0 | 2.99 | 0.0 | 0.0 | 0.0 |
| 07 January 2025 | Accrual | 16.78 | 0.0 | 16.78 | 0.0 | 0.0 | 0.0 |
| 08 January 2025 | Repayment | 500.0 | 400.0 | 26.45 | 0.0 | 0.0 | 0.0 |
| 08 January 2025 | Accrual | 9.67 | 0.0 | 9.67 | 0.0 | 0.0 | 0.0 |
| 08 January 2025 | Accrual Activity | 12.35 | 0.0 | 12.35 | 0.0 | 0.0 | 0.0 |
Then Loan status will be "OVERPAID"
Then Loan has 0 outstanding amount
When Customer undo "1"th repayment on "08 January 2025"
Then Loan Repayment schedule has 12 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 |
| | | 08 August 2024 | | 400.0 | | | 0.0 | | 0.0 | 0.0 | | | |
| 1 | 31 | 08 September 2024 | | 368.53 | 31.47 | 4.07 | 0.0 | 0.0 | 35.54 | 0.0 | 0.0 | 0.0 | 35.54 |
| 2 | 30 | 08 October 2024 | | 336.61 | 31.92 | 3.62 | 0.0 | 0.0 | 35.54 | 0.0 | 0.0 | 0.0 | 35.54 |
| 3 | 31 | 08 November 2024 | | 304.49 | 32.12 | 3.42 | 0.0 | 0.0 | 35.54 | 0.0 | 0.0 | 0.0 | 35.54 |
| 4 | 30 | 08 December 2024 | | 271.94 | 32.55 | 2.99 | 0.0 | 0.0 | 35.54 | 0.0 | 0.0 | 0.0 | 35.54 |
| 5 | 31 | 08 January 2025 | | 239.17 | 32.77 | 2.77 | 0.0 | 0.0 | 35.54 | 0.0 | 0.0 | 0.0 | 35.54 |
| 6 | 31 | 08 February 2025 | | 206.07 | 33.1 | 2.44 | 0.0 | 0.0 | 35.54 | 0.0 | 0.0 | 0.0 | 35.54 |
| 7 | 28 | 08 March 2025 | | 172.43 | 33.64 | 1.9 | 0.0 | 0.0 | 35.54 | 0.0 | 0.0 | 0.0 | 35.54 |
| 8 | 31 | 08 April 2025 | | 138.65 | 33.78 | 1.76 | 0.0 | 0.0 | 35.54 | 0.0 | 0.0 | 0.0 | 35.54 |
| 9 | 30 | 08 May 2025 | | 104.48 | 34.17 | 1.37 | 0.0 | 0.0 | 35.54 | 0.0 | 0.0 | 0.0 | 35.54 |
| 10 | 31 | 08 June 2025 | | 70.0 | 34.48 | 1.06 | 0.0 | 0.0 | 35.54 | 0.0 | 0.0 | 0.0 | 35.54 |
| 11 | 30 | 08 July 2025 | | 35.15 | 34.85 | 0.69 | 0.0 | 0.0 | 35.54 | 0.0 | 0.0 | 0.0 | 35.54 |
| 12 | 31 | 08 August 2025 | | 0.0 | 35.15 | 0.36 | 0.0 | 0.0 | 35.51 | 0.0 | 0.0 | 0.0 | 35.51 |
Then Loan Repayment schedule has the following data in Total row:
| Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
| 400.0 | 26.45 | 0.0 | 0.0 | 426.45 | 0.0 | 0.0 | 0.0 | 426.45 |
Then Loan Transactions tab has the following data:
| Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed |
| 08 August 2024 | Disbursement | 400.0 | 0.0 | 0.0 | 0.0 | 0.0 | 400.0 | false | false |
| 08 September 2024 | Accrual Activity | 4.07 | 0.0 | 4.07 | 0.0 | 0.0 | 0.0 | false | false |
| 08 October 2024 | Accrual Activity | 3.62 | 0.0 | 3.62 | 0.0 | 0.0 | 0.0 | false | false |
| 08 November 2024 | Accrual Activity | 3.42 | 0.0 | 3.42 | 0.0 | 0.0 | 0.0 | false | false |
| 08 December 2024 | Accrual Activity | 2.99 | 0.0 | 2.99 | 0.0 | 0.0 | 0.0 | false | false |
| 07 January 2025 | Accrual | 16.78 | 0.0 | 16.78 | 0.0 | 0.0 | 0.0 | false | false |
| 08 January 2025 | Repayment | 500.0 | 400.0 | 26.45 | 0.0 | 0.0 | 0.0 | true | false |
| 08 January 2025 | Accrual | 9.67 | 0.0 | 9.67 | 0.0 | 0.0 | 0.0 | false | false |