|
| 1 | +Feature: PayoutRefund |
| 2 | + |
| 3 | + @TestRailId:C3845 |
| 4 | + Scenario: Payout Refund with interestRefundCalculation = false (Interest Refund transaction should NOT be created) |
| 5 | + When Admin sets the business date to "01 July 2024" |
| 6 | + And Admin creates a client with random data |
| 7 | + And Admin creates a fully customized loan with the following data: |
| 8 | + | 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 | |
| 9 | + | LP2_ADV_CUSTOM_PMT_ALLOC_PROGRESSIVE_LOAN_SCHEDULE_HORIZONTAL | 01 July 2024 | 1000 | 10 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 3 | MONTHS | 1 | MONTHS | 3 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | |
| 10 | + And Admin successfully approves the loan on "01 July 2024" with "1000" amount and expected disbursement date on "01 July 2024" |
| 11 | + And Admin successfully disburse the loan on "01 July 2024" with "1000" EUR transaction amount |
| 12 | + Then Loan Repayment schedule has 3 periods, with the following data for periods: |
| 13 | + | Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | |
| 14 | + | | | 01 July 2024 | | 1000.0 | | | 0.0 | | 0.0 | 0.0 | | | | |
| 15 | + | 1 | 31 | 01 August 2024 | | 669.43 | 330.57 | 8.33 | 0.0 | 0.0 | 338.9 | 0.0 | 0.0 | 0.0 | 338.9 | |
| 16 | + | 2 | 31 | 01 September 2024 | | 336.11 | 333.32 | 5.58 | 0.0 | 0.0 | 338.9 | 0.0 | 0.0 | 0.0 | 338.9 | |
| 17 | + | 3 | 30 | 01 October 2024 | | 0.0 | 336.11 | 2.8 | 0.0 | 0.0 | 338.91 | 0.0 | 0.0 | 0.0 | 338.91 | |
| 18 | + And 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 | 16.71 | 0.0 | 0.0 | 1016.71 | 0.0 | 0.0 | 0.0 | 1016.71 | |
| 21 | + And Loan Transactions tab has the following data: |
| 22 | + | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed | |
| 23 | + | 01 July 2024 | Disbursement | 1000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1000.0 | false | false | |
| 24 | + When Admin sets the business date to "10 July 2024" |
| 25 | + And Customer makes "REPAYMENT" transaction with "AUTOPAY" payment type on "10 July 2024" with 338.9 EUR transaction amount and system-generated Idempotency key |
| 26 | + When Admin sets the business date to "15 July 2024" |
| 27 | + And Customer makes "PAYOUT_REFUND" transaction with "AUTOPAY" payment type on "15 July 2024" with 50 EUR transaction amount and system-generated Idempotency key and interestRefundCalculation false |
| 28 | + Then Loan Repayment schedule has 3 periods, with the following data for periods: |
| 29 | + | Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | |
| 30 | + | | | 01 July 2024 | | 1000.0 | | | 0.0 | | 0.0 | 0.0 | | | | |
| 31 | + | 1 | 31 | 01 August 2024 | 10 July 2024 | 663.52 | 336.48 | 2.42 | 0.0 | 0.0 | 338.9 | 338.9 | 338.9 | 0.0 | 0.0 | |
| 32 | + | 2 | 31 | 01 September 2024 | | 333.42 | 330.1 | 8.8 | 0.0 | 0.0 | 338.9 | 50.0 | 50.0 | 0.0 | 288.9 | |
| 33 | + | 3 | 30 | 01 October 2024 | | 0.0 | 333.42 | 2.78 | 0.0 | 0.0 | 336.2 | 0.0 | 0.0 | 0.0 | 336.2 | |
| 34 | + And Loan Repayment schedule has the following data in Total row: |
| 35 | + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | |
| 36 | + | 1000.0 | 14.0 | 0.0 | 0.0 | 1014.0 | 388.9 | 388.9 | 0.0 | 625.1 | |
| 37 | + And Loan Transactions tab has the following data: |
| 38 | + | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed | |
| 39 | + | 01 July 2024 | Disbursement | 1000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1000.0 | false | false | |
| 40 | + | 10 July 2024 | Repayment | 338.9 | 336.48 | 2.42 | 0.0 | 0.0 | 663.52 | false | false | |
| 41 | + | 15 July 2024 | Payout Refund | 50.0 | 50.0 | 0.0 | 0.0 | 0.0 | 613.52 | false | false | |
| 42 | + |
| 43 | + @TestRailId:C3846 |
| 44 | + Scenario: Payout Refund with interestRefundCalculation = true (Interest Refund transaction SHOULD be created) |
| 45 | + When Admin sets the business date to "01 July 2024" |
| 46 | + And Admin creates a client with random data |
| 47 | + And Admin creates a fully customized loan with the following data: |
| 48 | + | 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 | |
| 49 | + | LP2_ADV_CUSTOM_PMT_ALLOC_PROGRESSIVE_LOAN_SCHEDULE_HORIZONTAL | 01 July 2024 | 1000 | 10 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 3 | MONTHS | 1 | MONTHS | 3 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | |
| 50 | + And Admin successfully approves the loan on "01 July 2024" with "1000" amount and expected disbursement date on "01 July 2024" |
| 51 | + And Admin successfully disburse the loan on "01 July 2024" with "1000" EUR transaction amount |
| 52 | + Then Loan Repayment schedule has 3 periods, with the following data for periods: |
| 53 | + | Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | |
| 54 | + | | | 01 July 2024 | | 1000.0 | | | 0.0 | | 0.0 | 0.0 | | | | |
| 55 | + | 1 | 31 | 01 August 2024 | | 669.43 | 330.57 | 8.33 | 0.0 | 0.0 | 338.9 | 0.0 | 0.0 | 0.0 | 338.9 | |
| 56 | + | 2 | 31 | 01 September 2024 | | 336.11 | 333.32 | 5.58 | 0.0 | 0.0 | 338.9 | 0.0 | 0.0 | 0.0 | 338.9 | |
| 57 | + | 3 | 30 | 01 October 2024 | | 0.0 | 336.11 | 2.8 | 0.0 | 0.0 | 338.91 | 0.0 | 0.0 | 0.0 | 338.91 | |
| 58 | + And Loan Repayment schedule has the following data in Total row: |
| 59 | + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | |
| 60 | + | 1000.0 | 16.71 | 0.0 | 0.0 | 1016.71 | 0.0 | 0.0 | 0.0 | 1016.71 | |
| 61 | + And Loan Transactions tab has the following data: |
| 62 | + | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed | |
| 63 | + | 01 July 2024 | Disbursement | 1000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1000.0 | false | false | |
| 64 | + When Admin sets the business date to "10 July 2024" |
| 65 | + And Customer makes "REPAYMENT" transaction with "AUTOPAY" payment type on "10 July 2024" with 338.9 EUR transaction amount and system-generated Idempotency key |
| 66 | + When Admin sets the business date to "15 July 2024" |
| 67 | + And Customer makes "PAYOUT_REFUND" transaction with "AUTOPAY" payment type on "15 July 2024" with 50 EUR transaction amount and system-generated Idempotency key and interestRefundCalculation true |
| 68 | + Then Loan Repayment schedule has 3 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 July 2024 | | 1000.0 | | | 0.0 | | 0.0 | 0.0 | | | | |
| 71 | + | 1 | 31 | 01 August 2024 | 10 July 2024 | 663.52 | 336.48 | 2.42 | 0.0 | 0.0 | 338.9 | 338.9 | 338.9 | 0.0 | 0.0 | |
| 72 | + | 2 | 31 | 01 September 2024 | | 333.42 | 330.1 | 8.8 | 0.0 | 0.0 | 338.9 | 50.19 | 50.19 | 0.0 | 288.71 | |
| 73 | + | 3 | 30 | 01 October 2024 | | 0.0 | 333.42 | 2.78 | 0.0 | 0.0 | 336.2 | 0.0 | 0.0 | 0.0 | 336.2 | |
| 74 | + And Loan Repayment schedule has the following data in Total row: |
| 75 | + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | |
| 76 | + | 1000.0 | 14.0 | 0.0 | 0.0 | 1014.0 | 389.09 | 389.09 | 0.0 | 624.91 | |
| 77 | + And Loan Transactions tab has the following data: |
| 78 | + | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed | |
| 79 | + | 01 July 2024 | Disbursement | 1000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1000.0 | false | false | |
| 80 | + | 10 July 2024 | Repayment | 338.9 | 336.48 | 2.42 | 0.0 | 0.0 | 663.52 | false | false | |
| 81 | + | 15 July 2024 | Payout Refund | 50.0 | 50.0 | 0.0 | 0.0 | 0.0 | 613.52 | false | false | |
| 82 | + | 15 July 2024 | Interest Refund | 0.19 | 0.0 | 0.19 | 0.0 | 0.0 | 613.52 | false | false | |
| 83 | + |
| 84 | + @TestRailId:C3847 |
| 85 | + Scenario: Payout Refund without interestRefundCalculation (should fallback to loan product config) |
| 86 | + When Admin sets the business date to "01 July 2024" |
| 87 | + And Admin creates a client with random data |
| 88 | + And Admin creates a fully customized loan with the following data: |
| 89 | + | 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 | |
| 90 | + | LP2_ADV_CUSTOM_PMT_ALLOC_PROGRESSIVE_LOAN_SCHEDULE_HORIZONTAL | 01 July 2024 | 1000 | 10 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 3 | MONTHS | 1 | MONTHS | 3 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | |
| 91 | + And Admin successfully approves the loan on "01 July 2024" with "1000" amount and expected disbursement date on "01 July 2024" |
| 92 | + And Admin successfully disburse the loan on "01 July 2024" with "1000" EUR transaction amount |
| 93 | + Then Loan Repayment schedule has 3 periods, with the following data for periods: |
| 94 | + | Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | |
| 95 | + | | | 01 July 2024 | | 1000.0 | | | 0.0 | | 0.0 | 0.0 | | | | |
| 96 | + | 1 | 31 | 01 August 2024 | | 669.43 | 330.57 | 8.33 | 0.0 | 0.0 | 338.9 | 0.0 | 0.0 | 0.0 | 338.9 | |
| 97 | + | 2 | 31 | 01 September 2024 | | 336.11 | 333.32 | 5.58 | 0.0 | 0.0 | 338.9 | 0.0 | 0.0 | 0.0 | 338.9 | |
| 98 | + | 3 | 30 | 01 October 2024 | | 0.0 | 336.11 | 2.8 | 0.0 | 0.0 | 338.91 | 0.0 | 0.0 | 0.0 | 338.91 | |
| 99 | + And Loan Repayment schedule has the following data in Total row: |
| 100 | + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | |
| 101 | + | 1000.0 | 16.71 | 0.0 | 0.0 | 1016.71 | 0.0 | 0.0 | 0.0 | 1016.71 | |
| 102 | + And Loan Transactions tab has the following data: |
| 103 | + | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed | |
| 104 | + | 01 July 2024 | Disbursement | 1000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1000.0 | false | false | |
| 105 | + When Admin sets the business date to "10 July 2024" |
| 106 | + And Customer makes "REPAYMENT" transaction with "AUTOPAY" payment type on "10 July 2024" with 338.9 EUR transaction amount and system-generated Idempotency key |
| 107 | + When Admin sets the business date to "15 July 2024" |
| 108 | + And Customer makes "PAYOUT_REFUND" transaction with "AUTOPAY" payment type on "15 July 2024" with 50 EUR transaction amount and system-generated Idempotency key |
| 109 | + Then Loan Repayment schedule has 3 periods, with the following data for periods: |
| 110 | + | Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | |
| 111 | + | | | 01 July 2024 | | 1000.0 | | | 0.0 | | 0.0 | 0.0 | | | | |
| 112 | + | 1 | 31 | 01 August 2024 | 10 July 2024 | 663.52 | 336.48 | 2.42 | 0.0 | 0.0 | 338.9 | 338.9 | 338.9 | 0.0 | 0.0 | |
| 113 | + | 2 | 31 | 01 September 2024 | | 333.42 | 330.1 | 8.8 | 0.0 | 0.0 | 338.9 | 50.19 | 50.19 | 0.0 | 288.71 | |
| 114 | + | 3 | 30 | 01 October 2024 | | 0.0 | 333.42 | 2.78 | 0.0 | 0.0 | 336.2 | 0.0 | 0.0 | 0.0 | 336.2 | |
| 115 | + And Loan Repayment schedule has the following data in Total row: |
| 116 | + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | |
| 117 | + | 1000.0 | 14.0 | 0.0 | 0.0 | 1014.0 | 389.09 | 389.09 | 0.0 | 624.91 | |
| 118 | + And Loan Transactions tab has the following data: |
| 119 | + | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed | |
| 120 | + | 01 July 2024 | Disbursement | 1000.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1000.0 | false | false | |
| 121 | + | 10 July 2024 | Repayment | 338.9 | 336.48 | 2.42 | 0.0 | 0.0 | 663.52 | false | false | |
| 122 | + | 15 July 2024 | Payout Refund | 50.0 | 50.0 | 0.0 | 0.0 | 0.0 | 613.52 | false | false | |
| 123 | + | 15 July 2024 | Interest Refund | 0.19 | 0.0 | 0.19 | 0.0 | 0.0 | 613.52 | false | false | |
0 commit comments