| @LoanReAmortizationFeature |
| Feature: LoanReAmortization |
| |
| @TestRailId:C3069 @AdvancedPaymentAllocation |
| Scenario: Verify Loan re-amortization transaction - re-amortization happy path |
| When Admin sets the business date to "01 January 2024" |
| When Admin creates a client with random data |
| When Admin set "PIN4_DOWNPAYMENT_AUTO_ADVANCED_PAYMENT_ALLOCATION" loan product "DEFAULT" transaction type to "NEXT_INSTALLMENT" future installment allocation rule |
| 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 | |
| | PIN4_DOWNPAYMENT_AUTO_ADVANCED_PAYMENT_ALLOCATION | 01 January 2024 | 500 | 0 | FLAT | SAME_AS_REPAYMENT_PERIOD | EQUAL_INSTALLMENTS | 45 | DAYS | 15 | DAYS | 3 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | |
| And Admin successfully approves the loan on "01 January 2024" with "500" amount and expected disbursement date on "01 January 2024" |
| When Admin successfully disburse the loan on "01 January 2024" with "500" EUR transaction amount |
| When Admin sets the business date to "25 January 2024" |
| Then Loan Repayment schedule has 4 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 | |
| | | | 01 January 2024 | | 500.0 | | | 0.0 | | 0.0 | 0.0 | | | | |
| | 1 | 0 | 01 January 2024 | 01 January 2024 | 375.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | |
| | 2 | 15 | 16 January 2024 | | 250.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | |
| | 3 | 15 | 31 January 2024 | | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | |
| | 4 | 15 | 15 February 2024 | | 0.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | |
| Then Loan Repayment schedule has the following data in Total row: |
| | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | |
| | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 | 125.0 | 0.0 | 0.0 | 375.0 | |
| Then Loan Transactions tab has the following data: |
| | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | |
| | 01 January 2024 | Disbursement | 500.0 | 0.0 | 0.0 | 0.0 | 0.0 | 500.0 | |
| | 01 January 2024 | Down Payment | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | 375.0 | |
| When When Admin creates a Loan re-amortization transaction on current business date |
| Then Loan Repayment schedule has 4 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 | |
| | | | 01 January 2024 | | 500.0 | | | 0.0 | | 0.0 | 0.0 | | | | |
| | 1 | 0 | 01 January 2024 | 01 January 2024 | 375.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | |
| | 2 | 15 | 16 January 2024 | 25 January 2024 | 375.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| | 3 | 15 | 31 January 2024 | | 187.0 | 188.0 | 0.0 | 0.0 | 0.0 | 188.0 | 0.0 | 0.0 | 0.0 | 188.0 | |
| | 4 | 15 | 15 February 2024 | | 0.0 | 187.0 | 0.0 | 0.0 | 0.0 | 187.0 | 0.0 | 0.0 | 0.0 | 187.0 | |
| Then Loan Repayment schedule has the following data in Total row: |
| | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | |
| | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 | 125.0 | 0.0 | 0.0 | 375.0 | |
| Then Loan Transactions tab has the following data: |
| | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | |
| | 01 January 2024 | Disbursement | 500.0 | 0.0 | 0.0 | 0.0 | 0.0 | 500.0 | |
| | 01 January 2024 | Down Payment | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | 375.0 | |
| | 25 January 2024 | Re-amortize | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| |
| @TestRailId:C3070 @AdvancedPaymentAllocation |
| Scenario: Verify Loan re-amortization transaction - re-amortization happy path with loan externalId |
| When Admin sets the business date to "01 January 2024" |
| When Admin creates a client with random data |
| When Admin set "PIN4_DOWNPAYMENT_AUTO_ADVANCED_PAYMENT_ALLOCATION" loan product "DEFAULT" transaction type to "NEXT_INSTALLMENT" future installment allocation rule |
| 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 | |
| | PIN4_DOWNPAYMENT_AUTO_ADVANCED_PAYMENT_ALLOCATION | 01 January 2024 | 500 | 0 | FLAT | SAME_AS_REPAYMENT_PERIOD | EQUAL_INSTALLMENTS | 45 | DAYS | 15 | DAYS | 3 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | |
| And Admin successfully approves the loan on "01 January 2024" with "500" amount and expected disbursement date on "01 January 2024" |
| When Admin successfully disburse the loan on "01 January 2024" with "500" EUR transaction amount |
| When Admin sets the business date to "25 January 2024" |
| Then Loan Repayment schedule has 4 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 | |
| | | | 01 January 2024 | | 500.0 | | | 0.0 | | 0.0 | 0.0 | | | | |
| | 1 | 0 | 01 January 2024 | 01 January 2024 | 375.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | |
| | 2 | 15 | 16 January 2024 | | 250.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | |
| | 3 | 15 | 31 January 2024 | | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | |
| | 4 | 15 | 15 February 2024 | | 0.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | |
| Then Loan Repayment schedule has the following data in Total row: |
| | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | |
| | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 | 125.0 | 0.0 | 0.0 | 375.0 | |
| Then Loan Transactions tab has the following data: |
| | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | |
| | 01 January 2024 | Disbursement | 500.0 | 0.0 | 0.0 | 0.0 | 0.0 | 500.0 | |
| | 01 January 2024 | Down Payment | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | 375.0 | |
| When When Admin creates a Loan re-amortization transaction on current business date by loan external ID |
| Then Loan Repayment schedule has 4 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 | |
| | | | 01 January 2024 | | 500.0 | | | 0.0 | | 0.0 | 0.0 | | | | |
| | 1 | 0 | 01 January 2024 | 01 January 2024 | 375.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | |
| | 2 | 15 | 16 January 2024 | 25 January 2024 | 375.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| | 3 | 15 | 31 January 2024 | | 187.0 | 188.0 | 0.0 | 0.0 | 0.0 | 188.0 | 0.0 | 0.0 | 0.0 | 188.0 | |
| | 4 | 15 | 15 February 2024 | | 0.0 | 187.0 | 0.0 | 0.0 | 0.0 | 187.0 | 0.0 | 0.0 | 0.0 | 187.0 | |
| Then Loan Repayment schedule has the following data in Total row: |
| | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | |
| | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 | 125.0 | 0.0 | 0.0 | 375.0 | |
| Then Loan Transactions tab has the following data: |
| | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | |
| | 01 January 2024 | Disbursement | 500.0 | 0.0 | 0.0 | 0.0 | 0.0 | 500.0 | |
| | 01 January 2024 | Down Payment | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | 375.0 | |
| | 25 January 2024 | Re-amortize | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| |
| @TestRailId:C3071 @AdvancedPaymentAllocation |
| Scenario: Verify Loan re-amortization transaction - re-amortization undo happy path |
| When Admin sets the business date to "01 January 2024" |
| When Admin creates a client with random data |
| When Admin set "PIN4_DOWNPAYMENT_AUTO_ADVANCED_PAYMENT_ALLOCATION" loan product "DEFAULT" transaction type to "NEXT_INSTALLMENT" future installment allocation rule |
| 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 | |
| | PIN4_DOWNPAYMENT_AUTO_ADVANCED_PAYMENT_ALLOCATION | 01 January 2024 | 500 | 0 | FLAT | SAME_AS_REPAYMENT_PERIOD | EQUAL_INSTALLMENTS | 45 | DAYS | 15 | DAYS | 3 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | |
| And Admin successfully approves the loan on "01 January 2024" with "500" amount and expected disbursement date on "01 January 2024" |
| When Admin successfully disburse the loan on "01 January 2024" with "500" EUR transaction amount |
| When Admin sets the business date to "25 January 2024" |
| When When Admin creates a Loan re-amortization transaction on current business date |
| Then Loan Repayment schedule has 4 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 | |
| | | | 01 January 2024 | | 500.0 | | | 0.0 | | 0.0 | 0.0 | | | | |
| | 1 | 0 | 01 January 2024 | 01 January 2024 | 375.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | |
| | 2 | 15 | 16 January 2024 | 25 January 2024 | 375.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| | 3 | 15 | 31 January 2024 | | 187.0 | 188.0 | 0.0 | 0.0 | 0.0 | 188.0 | 0.0 | 0.0 | 0.0 | 188.0 | |
| | 4 | 15 | 15 February 2024 | | 0.0 | 187.0 | 0.0 | 0.0 | 0.0 | 187.0 | 0.0 | 0.0 | 0.0 | 187.0 | |
| Then Loan Repayment schedule has the following data in Total row: |
| | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | |
| | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 | 125.0 | 0.0 | 0.0 | 375.0 | |
| Then Loan Transactions tab has the following data: |
| | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | |
| | 01 January 2024 | Disbursement | 500.0 | 0.0 | 0.0 | 0.0 | 0.0 | 500.0 | false | |
| | 01 January 2024 | Down Payment | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | 375.0 | false | |
| | 25 January 2024 | Re-amortize | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | 0.0 | false | |
| When Admin sets the business date to "26 January 2024" |
| When When Admin undo Loan re-amortization transaction on current business date |
| Then Loan Repayment schedule has 4 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 | |
| | | | 01 January 2024 | | 500.0 | | | 0.0 | | 0.0 | 0.0 | | | | |
| | 1 | 0 | 01 January 2024 | 01 January 2024 | 375.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | |
| | 2 | 15 | 16 January 2024 | | 250.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | |
| | 3 | 15 | 31 January 2024 | | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | |
| | 4 | 15 | 15 February 2024 | | 0.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | |
| Then Loan Repayment schedule has the following data in Total row: |
| | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | |
| | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 | 125.0 | 0.0 | 0.0 | 375.0 | |
| Then Loan Transactions tab has the following data: |
| | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | |
| | 01 January 2024 | Disbursement | 500.0 | 0.0 | 0.0 | 0.0 | 0.0 | 500.0 | false | |
| | 01 January 2024 | Down Payment | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | 375.0 | false | |
| | 25 January 2024 | Re-amortize | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | 0.0 | true | |
| Then Admin checks that delinquency range is: "RANGE_3" and has delinquentDate "2024-01-19" |
| |
| @TestRailId:C3072 @AdvancedPaymentAllocation |
| Scenario: Verify Loan re-amortization transaction - delinquency calculation triggered upon re-amortization transaction |
| When Admin sets the business date to "01 January 2024" |
| When Admin creates a client with random data |
| When Admin set "PIN4_DOWNPAYMENT_AUTO_ADVANCED_PAYMENT_ALLOCATION" loan product "DEFAULT" transaction type to "NEXT_INSTALLMENT" future installment allocation rule |
| 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 | |
| | PIN4_DOWNPAYMENT_AUTO_ADVANCED_PAYMENT_ALLOCATION | 01 January 2024 | 500 | 0 | FLAT | SAME_AS_REPAYMENT_PERIOD | EQUAL_INSTALLMENTS | 45 | DAYS | 15 | DAYS | 3 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | |
| And Admin successfully approves the loan on "01 January 2024" with "500" amount and expected disbursement date on "01 January 2024" |
| When Admin successfully disburse the loan on "01 January 2024" with "500" EUR transaction amount |
| When Admin sets the business date to "24 January 2024" |
| When Admin runs inline COB job for Loan |
| Then Admin checks that delinquency range is: "RANGE_3" and has delinquentDate "2024-01-19" |
| When Admin sets the business date to "25 January 2024" |
| When When Admin creates a Loan re-amortization transaction on current business date |
| Then Admin checks that delinquency range is: "NO_DELINQUENCY" and has delinquentDate "" |
| |
| @TestRailId:C3073 @AdvancedPaymentAllocation |
| Scenario: Verify Loan re-amortization transaction - UC1: re-amortization after charge applied on loan |
| When Admin sets the business date to "01 January 2024" |
| When Admin creates a client with random data |
| When Admin set "PIN4_DOWNPAYMENT_AUTO_ADVANCED_PAYMENT_ALLOCATION" loan product "DEFAULT" transaction type to "NEXT_INSTALLMENT" future installment allocation rule |
| 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 | |
| | PIN4_DOWNPAYMENT_AUTO_ADVANCED_PAYMENT_ALLOCATION | 01 January 2024 | 500 | 0 | FLAT | SAME_AS_REPAYMENT_PERIOD | EQUAL_INSTALLMENTS | 45 | DAYS | 15 | DAYS | 3 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | |
| And Admin successfully approves the loan on "01 January 2024" with "500" amount and expected disbursement date on "01 January 2024" |
| When Admin successfully disburse the loan on "01 January 2024" with "500" EUR transaction amount |
| When Admin sets the business date to "16 January 2024" |
| When Admin adds "LOAN_NSF_FEE" due date charge with "16 January 2024" due date and 10 EUR transaction amount |
| When Admin sets the business date to "25 January 2024" |
| When When Admin creates a Loan re-amortization transaction on current business date |
| Then Loan Repayment schedule has 4 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 | |
| | | | 01 January 2024 | | 500.0 | | | 0.0 | | 0.0 | 0.0 | | | | |
| | 1 | 0 | 01 January 2024 | 01 January 2024 | 375.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | |
| | 2 | 15 | 16 January 2024 | | 375.0 | 0.0 | 0.0 | 0.0 | 10.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | |
| | 3 | 15 | 31 January 2024 | | 187.0 | 188.0 | 0.0 | 0.0 | 0.0 | 188.0 | 0.0 | 0.0 | 0.0 | 188.0 | |
| | 4 | 15 | 15 February 2024 | | 0.0 | 187.0 | 0.0 | 0.0 | 0.0 | 187.0 | 0.0 | 0.0 | 0.0 | 187.0 | |
| Then Loan Repayment schedule has the following data in Total row: |
| | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | |
| | 500.0 | 0.0 | 0.0 | 10.0 | 510.0 | 125.0 | 0.0 | 0.0 | 385.0 | |
| Then Loan Transactions tab has the following data: |
| | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | |
| | 01 January 2024 | Disbursement | 500.0 | 0.0 | 0.0 | 0.0 | 0.0 | 500.0 | |
| | 01 January 2024 | Down Payment | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | 375.0 | |
| | 25 January 2024 | Re-amortize | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| |
| @TestRailId:C3074 @AdvancedPaymentAllocation |
| Scenario: Verify Loan re-amortization transaction - UC2: complete past due principal amount reamortization scenario |
| When Admin sets the business date to "01 January 2024" |
| When Admin creates a client with random data |
| When Admin set "PIN4_DOWNPAYMENT_AUTO_ADVANCED_PAYMENT_ALLOCATION" loan product "DEFAULT" transaction type to "NEXT_INSTALLMENT" future installment allocation rule |
| 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 | |
| | PIN4_DOWNPAYMENT_AUTO_ADVANCED_PAYMENT_ALLOCATION | 01 January 2024 | 500 | 0 | FLAT | SAME_AS_REPAYMENT_PERIOD | EQUAL_INSTALLMENTS | 45 | DAYS | 15 | DAYS | 3 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | |
| And Admin successfully approves the loan on "01 January 2024" with "500" amount and expected disbursement date on "01 January 2024" |
| When Admin successfully disburse the loan on "01 January 2024" with "500" EUR transaction amount |
| When Admin sets the business date to "01 February 2024" |
| When When Admin creates a Loan re-amortization transaction on current business date |
| Then Loan Repayment schedule has 4 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 | |
| | | | 01 January 2024 | | 500.0 | | | 0.0 | | 0.0 | 0.0 | | | | |
| | 1 | 0 | 01 January 2024 | 01 January 2024 | 375.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | |
| | 2 | 15 | 16 January 2024 | 01 February 2024 | 375.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| | 3 | 15 | 31 January 2024 | 01 February 2024 | 375.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| | 4 | 15 | 15 February 2024 | | 0.0 | 375.0 | 0.0 | 0.0 | 0.0 | 375.0 | 0.0 | 0.0 | 0.0 | 375.0 | |
| Then Loan Repayment schedule has the following data in Total row: |
| | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | |
| | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 | 125.0 | 0.0 | 0.0 | 375.0 | |
| Then Loan Transactions tab has the following data: |
| | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | |
| | 01 January 2024 | Disbursement | 500.0 | 0.0 | 0.0 | 0.0 | 0.0 | 500.0 | |
| | 01 January 2024 | Down Payment | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | 375.0 | |
| | 01 February 2024 | Re-amortize | 250.0 | 250.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| |
| @TestRailId:C3075 @AdvancedPaymentAllocation |
| Scenario: Verify Loan re-amortization transaction - UC3: reverse replay scenario |
| When Admin sets the business date to "01 January 2024" |
| When Admin creates a client with random data |
| When Admin set "PIN4_DOWNPAYMENT_AUTO_ADVANCED_PAYMENT_ALLOCATION" loan product "DEFAULT" transaction type to "NEXT_INSTALLMENT" future installment allocation rule |
| 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 | |
| | PIN4_DOWNPAYMENT_AUTO_ADVANCED_PAYMENT_ALLOCATION | 01 January 2024 | 500 | 0 | FLAT | SAME_AS_REPAYMENT_PERIOD | EQUAL_INSTALLMENTS | 45 | DAYS | 15 | DAYS | 3 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | |
| And Admin successfully approves the loan on "01 January 2024" with "500" amount and expected disbursement date on "01 January 2024" |
| When Admin successfully disburse the loan on "01 January 2024" with "500" EUR transaction amount |
| When Admin sets the business date to "01 February 2024" |
| When When Admin creates a Loan re-amortization transaction on current business date |
| Then Loan Repayment schedule has 4 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 | |
| | | | 01 January 2024 | | 500.0 | | | 0.0 | | 0.0 | 0.0 | | | | |
| | 1 | 0 | 01 January 2024 | 01 January 2024 | 375.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | |
| | 2 | 15 | 16 January 2024 | 01 February 2024 | 375.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| | 3 | 15 | 31 January 2024 | 01 February 2024 | 375.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| | 4 | 15 | 15 February 2024 | | 0.0 | 375.0 | 0.0 | 0.0 | 0.0 | 375.0 | 0.0 | 0.0 | 0.0 | 375.0 | |
| Then Loan Repayment schedule has the following data in Total row: |
| | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | |
| | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 | 125.0 | 0.0 | 0.0 | 375.0 | |
| Then Loan Transactions tab has the following data: |
| | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | |
| | 01 January 2024 | Disbursement | 500.0 | 0.0 | 0.0 | 0.0 | 0.0 | 500.0 | |
| | 01 January 2024 | Down Payment | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | 375.0 | |
| | 01 February 2024 | Re-amortize | 250.0 | 250.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| When Admin sets the business date to "02 February 2024" |
| And Customer makes "AUTOPAY" repayment on "15 January 2024" with 125 EUR transaction amount |
| Then Loan Repayment schedule has 4 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 | |
| | | | 01 January 2024 | | 500.0 | | | 0.0 | | 0.0 | 0.0 | | | | |
| | 1 | 0 | 01 January 2024 | 01 January 2024 | 375.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | |
| | 2 | 15 | 16 January 2024 | 15 January 2024 | 250.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | 125.0 | 125.0 | 0.0 | 0.0 | |
| | 3 | 15 | 31 January 2024 | 01 February 2024 | 250.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| | 4 | 15 | 15 February 2024 | | 0.0 | 250.0 | 0.0 | 0.0 | 0.0 | 250.0 | 0.0 | 0.0 | 0.0 | 250.0 | |
| Then Loan Repayment schedule has the following data in Total row: |
| | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | |
| | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 | 250.0 | 125.0 | 0.0 | 250.0 | |
| Then Loan Transactions tab has the following data: |
| | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | |
| | 01 January 2024 | Disbursement | 500.0 | 0.0 | 0.0 | 0.0 | 0.0 | 500.0 | |
| | 01 January 2024 | Down Payment | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | 375.0 | |
| | 15 January 2024 | Repayment | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | 250.0 | |
| | 01 February 2024 | Re-amortize | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| |
| @TestRailId:C3076 @AdvancedPaymentAllocation |
| Scenario: Verify Loan re-amortization transaction - UC4: N+1 Installment scenario |
| When Admin sets the business date to "01 January 2024" |
| When Admin creates a client with random data |
| When Admin set "PIN4_DOWNPAYMENT_AUTO_ADVANCED_PAYMENT_ALLOCATION" loan product "DEFAULT" transaction type to "NEXT_INSTALLMENT" future installment allocation rule |
| 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 | |
| | PIN4_DOWNPAYMENT_AUTO_ADVANCED_PAYMENT_ALLOCATION | 01 January 2024 | 500 | 0 | FLAT | SAME_AS_REPAYMENT_PERIOD | EQUAL_INSTALLMENTS | 45 | DAYS | 15 | DAYS | 3 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | |
| And Admin successfully approves the loan on "01 January 2024" with "500" amount and expected disbursement date on "01 January 2024" |
| When Admin successfully disburse the loan on "01 January 2024" with "500" EUR transaction amount |
| When Admin sets the business date to "01 February 2024" |
| When Admin adds "LOAN_NSF_FEE" due date charge with "27 February 2024" due date and 10 EUR transaction amount |
| When When Admin creates a Loan re-amortization transaction on current business date |
| Then Loan Repayment schedule has 5 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 | |
| | | | 01 January 2024 | | 500.0 | | | 0.0 | | 0.0 | 0.0 | | | | |
| | 1 | 0 | 01 January 2024 | 01 January 2024 | 375.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | |
| | 2 | 15 | 16 January 2024 | 01 February 2024 | 375.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| | 3 | 15 | 31 January 2024 | 01 February 2024 | 375.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| | 4 | 15 | 15 February 2024 | | 0.0 | 375.0 | 0.0 | 0.0 | 0.0 | 375.0 | 0.0 | 0.0 | 0.0 | 375.0 | |
| | 5 | 12 | 27 February 2024 | | 0.0 | 0.0 | 0.0 | 0.0 | 10.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | |
| Then Loan Repayment schedule has the following data in Total row: |
| | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | |
| | 500.0 | 0.0 | 0.0 | 10.0 | 510.0 | 125.0 | 0.0 | 0.0 | 385.0 | |
| Then Loan Transactions tab has the following data: |
| | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | |
| | 01 January 2024 | Disbursement | 500.0 | 0.0 | 0.0 | 0.0 | 0.0 | 500.0 | |
| | 01 January 2024 | Down Payment | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | 375.0 | |
| | 01 February 2024 | Re-amortize | 250.0 | 250.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| |
| @TestRailId:C3077 @AdvancedPaymentAllocation |
| Scenario: Verify Loan re-amortization transaction - UC5: re-amortization on same day of installment |
| When Admin sets the business date to "01 January 2024" |
| When Admin creates a client with random data |
| When Admin set "PIN4_DOWNPAYMENT_AUTO_ADVANCED_PAYMENT_ALLOCATION" loan product "DEFAULT" transaction type to "NEXT_INSTALLMENT" future installment allocation rule |
| 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 | |
| | PIN4_DOWNPAYMENT_AUTO_ADVANCED_PAYMENT_ALLOCATION | 01 January 2024 | 500 | 0 | FLAT | SAME_AS_REPAYMENT_PERIOD | EQUAL_INSTALLMENTS | 45 | DAYS | 15 | DAYS | 3 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | |
| And Admin successfully approves the loan on "01 January 2024" with "500" amount and expected disbursement date on "01 January 2024" |
| When Admin successfully disburse the loan on "01 January 2024" with "500" EUR transaction amount |
| When Admin sets the business date to "16 January 2024" |
| When Admin adds "LOAN_NSF_FEE" due date charge with "16 January 2024" due date and 10 EUR transaction amount |
| When Admin sets the business date to "31 January 2024" |
| When When Admin creates a Loan re-amortization transaction on current business date |
| Then Loan Repayment schedule has 4 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 | |
| | | | 01 January 2024 | | 500.0 | | | 0.0 | | 0.0 | 0.0 | | | | |
| | 1 | 0 | 01 January 2024 | 01 January 2024 | 375.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | |
| | 2 | 15 | 16 January 2024 | | 375.0 | 0.0 | 0.0 | 0.0 | 10.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | |
| | 3 | 15 | 31 January 2024 | 31 January 2024 | 375.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| | 4 | 15 | 15 February 2024 | | 0.0 | 375.0 | 0.0 | 0.0 | 0.0 | 375.0 | 0.0 | 0.0 | 0.0 | 375.0 | |
| Then Loan Repayment schedule has the following data in Total row: |
| | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | |
| | 500.0 | 0.0 | 0.0 | 10.0 | 510.0 | 125.0 | 0.0 | 0.0 | 385.0 | |
| Then Loan Transactions tab has the following data: |
| | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | |
| | 01 January 2024 | Disbursement | 500.0 | 0.0 | 0.0 | 0.0 | 0.0 | 500.0 | |
| | 01 January 2024 | Down Payment | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | 375.0 | |
| | 31 January 2024 | Re-amortize | 250.0 | 250.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| |
| @TestRailId:C3078 @AdvancedPaymentAllocation |
| Scenario: Verify Loan re-amortization transaction - UC6: Parital Paid Scenario |
| When Admin sets the business date to "01 January 2024" |
| When Admin creates a client with random data |
| When Admin set "PIN4_DOWNPAYMENT_AUTO_ADVANCED_PAYMENT_ALLOCATION" loan product "DEFAULT" transaction type to "NEXT_INSTALLMENT" future installment allocation rule |
| 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 | |
| | PIN4_DOWNPAYMENT_AUTO_ADVANCED_PAYMENT_ALLOCATION | 01 January 2024 | 500 | 0 | FLAT | SAME_AS_REPAYMENT_PERIOD | EQUAL_INSTALLMENTS | 45 | DAYS | 15 | DAYS | 3 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | |
| And Admin successfully approves the loan on "01 January 2024" with "500" amount and expected disbursement date on "01 January 2024" |
| When Admin successfully disburse the loan on "01 January 2024" with "500" EUR transaction amount |
| When Admin sets the business date to "17 January 2024" |
| And Customer makes "AUTOPAY" repayment on "17 January 2024" with 50 EUR transaction amount |
| Then Loan Repayment schedule has 4 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 | |
| | | | 01 January 2024 | | 500.0 | | | 0.0 | | 0.0 | 0.0 | | | | |
| | 1 | 0 | 01 January 2024 | 01 January 2024 | 375.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | |
| | 2 | 15 | 16 January 2024 | | 250.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | 50.0 | 0.0 | 50.0 | 75.0 | |
| | 3 | 15 | 31 January 2024 | | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | |
| | 4 | 15 | 15 February 2024 | | 0.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | |
| Then Loan Repayment schedule has the following data in Total row: |
| | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | |
| | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 | 175.0 | 0.0 | 50.0 | 325.0 | |
| Then Loan Transactions tab has the following data: |
| | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | |
| | 01 January 2024 | Disbursement | 500.0 | 0.0 | 0.0 | 0.0 | 0.0 | 500.0 | |
| | 01 January 2024 | Down Payment | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | 375.0 | |
| | 17 January 2024 | Repayment | 50.0 | 50.0 | 0.0 | 0.0 | 0.0 | 325.0 | |
| When Admin sets the business date to "30 January 2024" |
| When When Admin creates a Loan re-amortization transaction on current business date by loan external ID |
| Then Loan Repayment schedule has 4 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 | |
| | | | 01 January 2024 | | 500.0 | | | 0.0 | | 0.0 | 0.0 | | | | |
| | 1 | 0 | 01 January 2024 | 01 January 2024 | 375.0 | 125.0 | 0.0 | 0.0 | 0.0 | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | |
| | 2 | 15 | 16 January 2024 | 30 January 2024 | 325.0 | 50.0 | 0.0 | 0.0 | 0.0 | 50.0 | 50.0 | 0.0 | 50.0 | 0.0 | |
| | 3 | 15 | 31 January 2024 | | 162.0 | 163.0 | 0.0 | 0.0 | 0.0 | 163.0 | 0.0 | 0.0 | 0.0 | 163.0 | |
| | 4 | 15 | 15 February 2024 | | 0.0 | 162.0 | 0.0 | 0.0 | 0.0 | 162.0 | 0.0 | 0.0 | 0.0 | 162.0 | |
| Then Loan Repayment schedule has the following data in Total row: |
| | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | |
| | 500.0 | 0.0 | 0.0 | 0.0 | 500.0 | 175.0 | 0.0 | 50.0 | 325.0 | |
| Then Loan Transactions tab has the following data: |
| | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | |
| | 01 January 2024 | Disbursement | 500.0 | 0.0 | 0.0 | 0.0 | 0.0 | 500.0 | |
| | 01 January 2024 | Down Payment | 125.0 | 125.0 | 0.0 | 0.0 | 0.0 | 375.0 | |
| | 17 January 2024 | Repayment | 50.0 | 50.0 | 0.0 | 0.0 | 0.0 | 325.0 | |
| | 30 January 2024 | Re-amortize | 75.0 | 75.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| |
| @TestRailId:C3089 @AdvancedPaymentAllocation |
| Scenario: Verify Loan re-amortization transaction - Event check |
| When Admin sets the business date to "01 January 2024" |
| When Admin creates a client with random data |
| When Admin set "PIN4_DOWNPAYMENT_AUTO_ADVANCED_PAYMENT_ALLOCATION" loan product "DEFAULT" transaction type to "NEXT_INSTALLMENT" future installment allocation rule |
| 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 | |
| | PIN4_DOWNPAYMENT_AUTO_ADVANCED_PAYMENT_ALLOCATION | 01 January 2024 | 500 | 0 | FLAT | SAME_AS_REPAYMENT_PERIOD | EQUAL_INSTALLMENTS | 45 | DAYS | 15 | DAYS | 3 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | |
| And Admin successfully approves the loan on "01 January 2024" with "500" amount and expected disbursement date on "01 January 2024" |
| When Admin successfully disburse the loan on "01 January 2024" with "500" EUR transaction amount |
| When Admin sets the business date to "31 January 2024" |
| When Admin runs inline COB job for Loan |
| Then LoanDelinquencyRangeChangeBusinessEvent is created |
| When Admin sets the business date to "01 February 2024" |
| When When Admin creates a Loan re-amortization transaction on current business date |
| Then LoanDelinquencyRangeChangeBusinessEvent is created |
| Then LoanReAmortizeBusinessEvent is created |