Skip to content

Commit 1d24a8c

Browse files
ruzeynalovadamsaghy
authored andcommitted
FINERACT-2181: added e2e test validatin accrual entries added after after reseting Loan undo disbursement and running COB
1 parent a8cb680 commit 1d24a8c

File tree

1 file changed

+90
-0
lines changed

1 file changed

+90
-0
lines changed

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

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,3 +683,93 @@ Feature: Loan Migration
683683
# Verify loan has no overdue amounts and closed date is recorded
684684
Then Loan status will be "CLOSED_OBLIGATIONS_MET"
685685
Then Loan has 0.0 total overdue amount
686+
687+
@TestRailId:C3804
688+
Scenario: Verify backdated loan migration with disbursement reversal and running Loan COB afterwards
689+
When Admin sets the business date to "07 April 2025"
690+
And Admin creates a client with random data
691+
When Admin creates a fully customized loan with the following data:
692+
| 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 |
693+
| LP2_ADV_CUSTOM_PMT_ALLOC_PROGRESSIVE_LOAN_SCHEDULE_HORIZONTAL | 01 January 2025 | 10000 | 12 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 4 | MONTHS | 1 | MONTHS | 4 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION |
694+
And Admin successfully approves the loan on "01 January 2025" with "10000" amount and expected disbursement date on "01 January 2025"
695+
And Admin successfully disburse the loan on "01 January 2025" with "10000" EUR transaction amount
696+
Then Loan Repayment schedule has 4 periods, with the following data for periods:
697+
| Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
698+
| | | 01 January 2025 | | 10000.0 | | | 0.0 | | 0.0 | 0.0 | | | |
699+
| 1 | 31 | 01 February 2025 | | 7537.19 | 2462.81 | 100.0 | 0.0 | 0.0 | 2562.81 | 0.0 | 0.0 | 0.0 | 2562.81 |
700+
| 2 | 28 | 01 March 2025 | | 5074.38 | 2462.81 | 100.0 | 0.0 | 0.0 | 2562.81 | 0.0 | 0.0 | 0.0 | 2562.81 |
701+
| 3 | 31 | 01 April 2025 | | 2611.57 | 2462.81 | 100.0 | 0.0 | 0.0 | 2562.81 | 0.0 | 0.0 | 0.0 | 2562.81 |
702+
| 4 | 30 | 01 May 2025 | | 0.0 | 2611.57 | 40.89 | 0.0 | 0.0 | 2652.46 | 0.0 | 0.0 | 0.0 | 2652.46 |
703+
Then Loan Repayment schedule has the following data in Total row:
704+
| Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
705+
| 10000.0 | 340.89 | 0 | 0 | 10340.89 | 0.0 | 0.0 | 0.0 | 10340.89 |
706+
Then Loan Transactions tab has the following data:
707+
| Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed |
708+
| 01 January 2025 | Disbursement | 10000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 10000.0 | false | false |
709+
When Admin runs inline COB job for Loan
710+
# Verify accrual entries are created correctly
711+
Then Loan Repayment schedule has 4 periods, with the following data for periods:
712+
| Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
713+
| | | 01 January 2025 | | 10000.0 | | | 0.0 | | 0.0 | 0.0 | | | |
714+
| 1 | 31 | 01 February 2025 | | 7537.19 | 2462.81 | 100.0 | 0.0 | 0.0 | 2562.81 | 0.0 | 0.0 | 0.0 | 2562.81 |
715+
| 2 | 28 | 01 March 2025 | | 5074.38 | 2462.81 | 100.0 | 0.0 | 0.0 | 2562.81 | 0.0 | 0.0 | 0.0 | 2562.81 |
716+
| 3 | 31 | 01 April 2025 | | 2611.57 | 2462.81 | 100.0 | 0.0 | 0.0 | 2562.81 | 0.0 | 0.0 | 0.0 | 2562.81 |
717+
| 4 | 30 | 01 May 2025 | | 0.0 | 2611.57 | 40.89 | 0.0 | 0.0 | 2652.46 | 0.0 | 0.0 | 0.0 | 2652.46 |
718+
Then Loan Repayment schedule has the following data in Total row:
719+
| Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
720+
| 10000.0 | 340.89 | 0.0 | 0.0 | 10340.89 | 0.0 | 0.0 | 0.0 | 10340.89 |
721+
Then Loan Transactions tab has the following data:
722+
| Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed |
723+
| 01 January 2025 | Disbursement | 10000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 10000.0 | false | false |
724+
| 01 February 2025 | Accrual Activity | 100.0 | 0.0 | 100.0 | 0.0 | 0.0 | 0.0 | false | false |
725+
| 01 March 2025 | Accrual Activity | 100.0 | 0.0 | 100.0 | 0.0 | 0.0 | 0.0 | false | false |
726+
| 01 April 2025 | Accrual Activity | 100.0 | 0.0 | 100.0 | 0.0 | 0.0 | 0.0 | false | false |
727+
| 06 April 2025 | Accrual | 316.67 | 0.0 | 316.67 | 0.0 | 0.0 | 0.0 | false | false |
728+
When Admin sets the business date to "01 January 2025"
729+
When Admin successfully undo disbursal
730+
Then Loan Repayment schedule has 4 periods, with the following data for periods:
731+
| Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
732+
| | | 01 January 2025 | | 10000.0 | | | 0.0 | | 0.0 | | | | 0.0 |
733+
| 1 | 31 | 01 February 2025 | | 7537.19 | 2462.81 | 100.0 | 0.0 | 0.0 | 2562.81 | 0.0 | 0.0 | 0.0 | 2562.81 |
734+
| 2 | 28 | 01 March 2025 | | 5049.75 | 2487.44 | 75.37 | 0.0 | 0.0 | 2562.81 | 0.0 | 0.0 | 0.0 | 2562.81 |
735+
| 3 | 31 | 01 April 2025 | | 2537.44 | 2512.31 | 50.5 | 0.0 | 0.0 | 2562.81 | 0.0 | 0.0 | 0.0 | 2562.81 |
736+
| 4 | 30 | 01 May 2025 | | 0.0 | 2537.44 | 25.37 | 0.0 | 0.0 | 2562.81 | 0.0 | 0.0 | 0.0 | 2562.81 |
737+
Then Loan Repayment schedule has the following data in Total row:
738+
| Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
739+
| 10000.0 | 251.24 | 0.0 | 0.0 | 10251.24 | 0.0 | 0.0 | 0.0 | 10251.24 |
740+
Then Loan Transactions tab has none transaction
741+
When Admin sets the business date to "02 January 2025"
742+
And Admin successfully disburse the loan on "02 January 2025" with "10000" EUR transaction amount
743+
Then Loan Repayment schedule has 4 periods, with the following data for periods:
744+
| Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
745+
| | | 02 January 2025 | | 10000.0 | | | 0.0 | | 0.0 | 0.0 | | | |
746+
| 1 | 31 | 01 February 2025 | | 7534.78 | 2465.22 | 96.77 | 0.0 | 0.0 | 2561.99 | 0.0 | 0.0 | 0.0 | 2561.99 |
747+
| 2 | 28 | 01 March 2025 | | 5048.14 | 2486.64 | 75.35 | 0.0 | 0.0 | 2561.99 | 0.0 | 0.0 | 0.0 | 2561.99 |
748+
| 3 | 31 | 01 April 2025 | | 2536.63 | 2511.51 | 50.48 | 0.0 | 0.0 | 2561.99 | 0.0 | 0.0 | 0.0 | 2561.99 |
749+
| 4 | 30 | 01 May 2025 | | 0.0 | 2536.63 | 25.37 | 0.0 | 0.0 | 2562.0 | 0.0 | 0.0 | 0.0 | 2562.0 |
750+
Then Loan Repayment schedule has the following data in Total row:
751+
| Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
752+
| 10000.0 | 247.97 | 0 | 0 | 10247.97 | 0.0 | 0.0 | 0.0 | 10247.97 |
753+
Then Loan Transactions tab has the following data:
754+
| Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed |
755+
| 02 January 2025 | Disbursement | 10000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 10000.0 | false | false |
756+
When Admin sets the business date to "08 April 2025"
757+
When Admin runs inline COB job for Loan
758+
# Verify accrual entries are created correctly
759+
Then Loan Repayment schedule has 4 periods, with the following data for periods:
760+
| Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
761+
| | | 02 January 2025 | | 10000.0 | | | 0.0 | | 0.0 | 0.0 | | | |
762+
| 1 | 31 | 01 February 2025 | | 7534.78 | 2465.22 | 96.77 | 0.0 | 0.0 | 2561.99 | 0.0 | 0.0 | 0.0 | 2561.99 |
763+
| 2 | 28 | 01 March 2025 | | 5072.79 | 2461.99 | 100.0 | 0.0 | 0.0 | 2561.99 | 0.0 | 0.0 | 0.0 | 2561.99 |
764+
| 3 | 31 | 01 April 2025 | | 2610.8 | 2461.99 | 100.0 | 0.0 | 0.0 | 2561.99 | 0.0 | 0.0 | 0.0 | 2561.99 |
765+
| 4 | 30 | 01 May 2025 | | 0.0 | 2610.8 | 43.35 | 0.0 | 0.0 | 2654.15 | 0.0 | 0.0 | 0.0 | 2654.15 |
766+
Then Loan Repayment schedule has the following data in Total row:
767+
| Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
768+
| 10000.0 | 340.12 | 0.0 | 0.0 | 10340.12 | 0.0 | 0.0 | 0.0 | 10340.12 |
769+
Then Loan Transactions tab has the following data:
770+
| Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed |
771+
| 02 January 2025 | Disbursement | 10000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 10000.0 | false | false |
772+
| 01 February 2025 | Accrual Activity | 96.77 | 0.0 | 96.77 | 0.0 | 0.0 | 0.0 | false | false |
773+
| 01 March 2025 | Accrual Activity | 100.0 | 0.0 | 100.0 | 0.0 | 0.0 | 0.0 | false | false |
774+
| 01 April 2025 | Accrual Activity | 100.0 | 0.0 | 100.0 | 0.0 | 0.0 | 0.0 | false | false |
775+
| 07 April 2025 | Accrual | 242.6 | 0.0 | 242.6 | 0.0 | 0.0 | 0.0 | false | false |

0 commit comments

Comments
 (0)