Files
monorepo/LCU.WebApps.Indirect.ReserveManagementSystem/Api/ReserveManagementSystemApi.Tests/Features/ChargebackCalculation.feature
T
2026-03-17 08:54:34 -05:00

631 lines
50 KiB
Gherkin

Feature: Chargeback Calculation
Calculate chargeback for a paid loan
Scenario: NC - Calculate Chargeback for Paid Date is within 15 days of Loan date, 30 days to first payment
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 2/10/2021 | 3/12/2021 | 2/12/2028 | NC | 1206.8106 | 2/19/2021 | 84 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 1206.8106 | Paid On or Before Chargeback Date | 84 |
#May 11, 2021 vs. May 12, 2021 First Payment Date wins by one day
Scenario: NC - Calculate Chargeback for Paid Date is within 15 days of Loan date, 30 days to first payment, Compare Loan Date vs. First Pmt Date, First Pmt Date Wins by 1 day
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 2/10/2021 | 3/12/2021 | 2/12/2028 | NC | 1206.8106 | 2/19/2021 | 84 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 1206.8106 | Paid On or Before Chargeback Date | 84 |
Scenario: NC - Calculate Chargeback for Paid Date is after 15 days of Loan date, Compare Loan Date vs. First Pmt Date, Loan Date Wins by 1 day
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 2/1/2021 | 2/15/2021 | 2/15/2028 | NC | 1206.8106 | 2/19/2021 | 85 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 1178.7452372093023255813953488 | Paid On or Before Chargeback Date | 84 |
Scenario: NC - Calculate Chargeback for Paid Date is after 15 days of Loan date, in a different year
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 12/1/2020 | 12/15/2020 | 12/15/2027 | NC | 1206.8106 | 1/19/2021 | 85 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 1151.0100551573187414500683995 | Paid On or Before Chargeback Date | 83 |
Scenario: NC - Calculate Chargeback for Paid Date is within 15 days of Loan date, 30 days to first payment, Compare Loan Date vs. First Pmt Date, Loan Date Wins by 1 day
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 2/10/2021 | 3/10/2021 | 2/10/2028 | NC | 1206.8106 | 2/19/2021 | 84 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 1206.8106 | Paid On or Before Chargeback Date | 84 |
Scenario: NC - Calculate Chargeback for Paid Date is after 15 days of Loan date, Compare Loan Date vs. First Pmt Date, Loan Date Wins by 1 day, Leslie's scenario
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 1/15/2019 | 2/14/2019 | 4/14/2025 | NC | 2141.8721 | 4/15/2019 | 75 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 1975.0315364210526315789473684 | Paid On or Before Chargeback Date | 72 |
Scenario: Calculate Chargeback for Paid Date is within 15 days of Loan date, 30 days to first payment - Missing Loan Type Id
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 2/10/2021 | 3/12/2021 | 2/12/2028 | | 1206.8106 | 2/19/2021 | 84 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 1206.8106 | Paid On or Before Chargeback Date | 84 |
Scenario: NC - Calculate Chargeback for Paid Date is within 15 days of Loan date, 45 days to first payment
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 10/30/2017 | 12/14/2017 | 11/14/2023 | NC | 927.0989 | 11/6/2017 | 72 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 927.0989 | Paid On or Before Chargeback Date | 72 |
Scenario: NC - Calculate Chargeback for Paid Date is within 15 days of Loan date, 90 days to first payment
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 10/7/2020 | 1/5/2021 | 12/5/2025 | NC | 229.0637 | 10/21/2020 | 48 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 238.60802083333333333333333333 | Paid On or Before Chargeback Date | 49 |
Scenario: NC - Calculate Chargeback for Paid Date is exactly 15 days from Loan date, 45 days to first payment
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 12/7/2020 | 1/21/2021 | 12/21/2025 | NC | 878.8602 | 12/22/2020 | 60 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 878.8602 | Paid On or Before Chargeback Date | 60 |
Scenario: NC - Calculate Chargeback for Paid Date more than 15 days past Loan date but before or on the first payment date, 32 days until first payment date
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 1/28/2021 | 3/1/2021 | 5/1/2027 | NC | 855.6368 | 2/25/2021 | 75 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 833.1200421052631578947368421 | Paid On or Before Chargeback Date | 74 |
Scenario: NC - Calculate Chargeback for Paid Date more than 15 days past Loan date but before or on the first payment date, 45 days until first payment date
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 10/15/2019 | 11/29/2019 | 10/29/2025 | NC | 1320.8907 | 10/31/2019 | 72 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 1320.8907 | Paid On or Before Chargeback Date | 72 |
Scenario: NC - Calculate Chargeback for Paid Date more than 15 days past Loan date but before or on the first payment date, 90 days until first payment date
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 12/22/2020 | 3/22/2021 | 2/22/2027 | NC | 1689.8999 | 1/14/2021 | 72 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 1736.8415638888888888888888889 | Paid On or Before Chargeback Date | 73 |
Scenario: NC - Calculate Chargeback for Paid Date more than 15 days past Loan date but before or on the first payment date, 91 days until first payment date
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 10/26/2018 | 1/25/2019 | 12/25/2024 | NC | 203.7054 | 11/15/2018 | 72 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 209.36388333333333333333333333 | Paid On or Before Chargeback Date | 73 |
Scenario: NC - Calculate Chargeback for Paid Date more than 15 days past Loan date after the first payment date, over Feb month example to trigger "not a date" condition.
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 3/11/2021 | 4/25/2021 | 3/25/2027 | NC | 309.4481 | 4/30/2021 | 72 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 300.9700698630136986301369863 | Paid On or Before Chargeback Date | 71 |
Scenario: NC - Calculate Chargeback for Paid Date past the chargeback date - this is day after
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 10/26/2018 | 1/25/2019 | 12/25/2024 | NC | 203.7054 | 3/26/2019 | 72 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 0 | Paid After Chargeback Date | 69 |
Scenario: NC - Calculate Chargeback for Paid Date past the final payment date
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 10/26/2018 | 1/25/2019 | 12/25/2024 | NC | 203.7054 | 3/26/2025 | 72 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 0 | Paid After Chargeback Date | 0 |
Scenario: NR - Calculate Chargeback for NR loan - paid past chargeback date (month before first payment date)
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 10/15/2019 | 11/29/2019 | 10/29/2025 | NR | 0 | 10/31/2019 | 72 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NR | No reserve to be paid | N | 0 | 0 | 0 | 0.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 0 | No Reserve - No Chargeback | 72 |
Scenario: NR - Calculate Chargeback for NR loan - paid before chargeback date, 0 chargeback because reserve is 0
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 10/15/2019 | 11/29/2019 | 10/29/2025 | NR | 0 | 10/20/2019 | 72 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NR | No reserve to be paid | N | 0 | 0 | 0 | 0.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 0 | No Reserve - No Chargeback | 72 |
Scenario: NR - Calculate Chargeback for NR loan - paid after final payment date
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 10/15/2019 | 11/29/2019 | 10/29/2025 | NR | 0 | 12/1/2025 | 72 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NR | No reserve to be paid | N | 0 | 0 | 0 | 0.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 0 | No Reserve - No Chargeback | 0 |
Scenario: BB - Calculate Chargeback for BB loan - 0 chargeback because reserve is 0
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 10/15/2019 | 11/29/2019 | 10/29/2025 | BB | 0 | 10/20/2019 | 72 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| BB | Standard Loan | S | 0 | 0 | 0 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 0 | No Reserve - No Chargeback | 72 |
Scenario: BB - Calculate Chargeback for BB loan - 0 chargeback because it is paid after final payment date.
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 8/24/2017 | 9/23/2017 | 8/23/2020 | BB | 127.24 | 5/18/2021 | 36 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| BB | Standard Loan | S | 0 | 0 | 0 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 0 | Paid After Chargeback Date | 0 |
Scenario: BB - Calculate Chargeback for BB loan - 0 chargeback because it is paid on the final payment date.
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 8/24/2017 | 9/23/2017 | 5/18/2021 | BB | 127.24 | 5/18/2021 | 36 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| BB | Standard Loan | S | 0 | 0 | 0 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 0 | Paid After Chargeback Date | 0 |
Scenario: BB - Calculate Chargeback for BB loan - using BB Chargeback method, past chargeback date, NoChargebackPayments
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 9/11/2018 | 10/24/2018 | 12/24/2024 | BB | 287.3639 | 4/30/2021 | 75 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| BB | Standard Loan | S | 0 | 0 | 0 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 99.82114421052631578947368421 | Paid On or Before Chargeback Date | 44 |
Scenario: BB - Calculate Chargeback for BB loan - using BB Chargeback method, paid before first payment date, NoChargebackPayments
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 10/15/2019 | 11/29/2019 | 10/29/2025 | BB | 500 | 10/20/2019 | 72 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| BB | Standard Loan | S | 0 | 0 | 0 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 500 | Paid On or Before Chargeback Date | 72 |
Scenario: BB - Calculate Chargeback for BB loan - using BB Chargeback method, paid more than a year after first payment.
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 1/18/2018 | 3/4/2018 | 2/4/2023 | BB | 790.4206 | 4/30/2021 | 60 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| BB | Standard Loan | S | 0 | 0 | 0 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 99.77440360655737704918032787 | Paid On or Before Chargeback Date | 21 |
Scenario: BB - Calculate Chargeback for BB loan - using BB Chargeback method, almost to final payment date.
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 5/2/2015 | 6/10/2015 | 5/10/2021 | BB | 26938.75 | 4/30/2021 | 72 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| BB | Standard Loan | S | 0 | 0 | 0 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 0 | Paid After Chargeback Date | 0 |
Scenario: BB - Calculate Chargeback for BB loan - using BB Chargeback method, before final payment date.
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 3/30/2017 | 5/14/2017 | 4/14/2022 | BB | 115.00 | 4/30/2021 | 60 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| BB | Standard Loan | S | 0 | 0 | 0 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 4.1475409836065573770491803279 | Paid On or Before Chargeback Date | 11 |
Scenario: BB - Calculate Chargeback for BB loan - using BB Chargeback method, paid within a year of loan date.
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 12/22/2020 | 2/5/2021 | 4/5/2027 | BB | 265.9569 | 4/26/2021 | 75 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| BB | Standard Loan | S | 0 | 0 | 0 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 238.52134610526315789473684211 | Paid On or Before Chargeback Date | 71 |
Scenario: BB - Calculate Chargeback for BB loan - paid after final pmt date
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 12/22/2020 | 2/5/2021 | 4/5/2027 | BB | 265.9569 | 4/26/2027 | 75 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| BB | Standard Loan | S | 0 | 0 | 0 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 0 | Paid After Chargeback Date | 0 |
Scenario: BB - Calculate Chargeback for Buydown reserve - checking Buydown message buydown reserve below threshold
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term | ReserveMessage |
| 8/4/2017 | 9/3/2017 | 8/3/2022 | NC | 0 | 10/20/2019 | 60 | BuyDown - Reserve - Below Threshold |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve Paid - No charge back- after 90 Days | N | 90 | 3 | 25 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 0 | Buy Down Reserve - No Chargeback | 33 |
Scenario: NC - Calculate Chargeback for Buydown reserve - checking Buydown message buydown reserve and negative value
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term | ReserveMessage |
| 9/30/2019 | 11/14/2019 | 10/14/2025 | NC | -3471.1087 | 3/20/2021 | 72 | BuyDown - Reserve |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve Paid - No charge back- after 90 Days | N | 90 | 3 | 25 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 0 | Buy Down Reserve - No Chargeback | 55 |
Scenario: NC - Calculate Boat Chargeback for Buydown reserve - checking Buydown message buydown reserve and negative value
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term | ReserveMessage | AccountType |
| 9/30/2019 | 11/14/2019 | 10/14/2025 | NC | -3471.1087 | 3/20/2021 | 60 | BuyDown - Reserve | DL10 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve Paid - No charge back- after 90 Days | N | 90 | 3 | 25 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 0 | Buy Down Reserve - No Chargeback | 43 |
Scenario: NC - Calculate Boat Chargeback for paid before chargeback date - Term 63 or less
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term | AccountType |
| 7/4/2019 | 8/3/2019 | 10/3/2024 | NC | 460.04 | 11/21/2019 | 63 | DL12 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 390.44069444444444444444444444 | Paid On or Before Chargeback Date | 58 |
Scenario: NC - Calculate Boat Chargeback for paid before chargeback date - Term greater than 63
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term | AccountType |
| 7/3/2019 | 8/2/2019 | 7/2/2029 | NC | 1163.05 | 5/6/2020 | 120 | DL11 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 978.0193181818181818181818182 | Paid On or Before Chargeback Date | 110 |
Scenario: NC - Calculate Boat Chargeback for after chargeback date - Term 63 or less
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term | AccountType |
| 07/04/2019 | 8/3/2019 | 10/3/2024 | NC | 460.04 | 12/21/2020 | 63 | DL11 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 0 | Paid After Chargeback Date | 45 |
Scenario: NC - Calculate Boat Chargeback for after chargeback date - Term greater than 63
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term | AccountType |
| 7/3/2019 | 8/2/2019 | 7/2/2029 | NC | 1163.05 | 5/6/2021 | 120 | DL09 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 0 | Paid After Chargeback Date | 98 |
Scenario Outline: NC - Calculate Chargeback for paid date between first payment date and chargeback date examples 1 and 2
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 12/26/2020 | 2/9/2021 | 4/9/2027 | NC | 1815.0503 | <PaidLoanDate> | 75 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| <Chargeback> | <ChargebackMessage> | <RemainingMonthsAtClose> |
Examples:
| PaidLoanDate | Chargeback | ChargebackMessage | RemainingMonthsAtClose |
| 2/26/2021 | 1720.1581965964912280701754386 | Paid On or Before Chargeback Date | 73 |
| 2/25/2021 | 1720.1581965964912280701754386 | Paid On or Before Chargeback Date | 73 |
Scenario: NC - Calculate Chargeback for paid date between first payment date and chargeback date - example 3
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 12/29/2020 | 2/12/2021 | 1/12/2027 | NC | 1835.6378 | 2/26/2021 | 72 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 1785.3463534246575342465753425 | Paid On or Before Chargeback Date | 71 |
Scenario: NC - Calculate Chargeback for paid date between first payment date and chargeback date - example 4
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 11/23/2020 | 1/7/2021 |12/7/2025 | NC | 1085.4654 | 2/25/2021 | 60 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 980.477762950819672131147541 | Paid On or Before Chargeback Date | 57 |
Scenario: NC - Calculate Chargeback for paid date between first payment date and chargeback date - example 5
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 12/14/2020 | 1/28/2021 | 12/28/2024 | NC | 58.5443 | 2/19/2021 | 48 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 53.814956037414965986394557823 | Paid On or Before Chargeback Date | 46 |
Scenario: NC - Calculate Chargeback for paid date between first payment date and chargeback date - example 6
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 12/22/2020 | 2/5/2021 | 1/5/2027 | NC | 853.1331 | 2/19/2021 | 72 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 829.7595904109589041095890411 | Paid On or Before Chargeback Date | 71 |
Scenario: NC - Calculate Chargeback for paid date between first payment date and chargeback date - example 7
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 12/4/2020 | 1/18/2021 | 12/18/2025 | NC | 584.2477 | 2/18/2021 | 60 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 546.25563644808743169398907104 | Paid On or Before Chargeback Date | 58 |
Scenario: NC - Calculate Chargeback for paid date between first payment date and chargeback date - example 8 - paid day after first payment date
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 1/2/2021 | 2/16/2021 | 11/16/2024 | NC | 116.0986 | 2/17/2021 | 46 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 111.15823404255319148936170213 | Paid On or Before Chargeback Date | 45 |
Scenario: NC - Calculate Chargeback for paid date between first payment date and chargeback date - example 9 - first payment in a month with 30 days
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 10/14/2020 | 11/28/2020 | 10/28/2023 | NC | 110.7846 | 1/25/2021 | 36 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 93.31855945945945945945945946 | Paid On or Before Chargeback Date | 33 |
Scenario: NC - Calculate Chargeback without using Arbitrary Date (paid loan date 29th, not leap year) for Paid Date after First Payment Date
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 1/16/2020 | 4/15/2020 | 3/15/2025 | NC | 169.0256 | 4/29/2020 | 60 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 163.48377704918032786885245902 | Paid On or Before Chargeback Date | 59 |
Scenario: NC - Calculate Chargeback without using Arbitrary Date (paid loan date 30th, not leap year) for Paid Date after First Payment Date
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 3/17/2017 | 4/16/2017 | 3/16/2019 | NC | 86.4577 | 5/30/2017 | 24 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 72.912660333333333333333333333 | Paid On or Before Chargeback Date | 22 |
Scenario: NC - Calculate Chargeback without using Arbitrary Date (paid loan date 31st, not leap year) for Paid Date after First Payment Date
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 3/17/2017 | 4/16/2017 | 3/16/2019 | NC | 86.4577 | 5/31/2017 | 24 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 72.912660333333333333333333333 | Paid On or Before Chargeback Date | 22 |
Scenario: NC - Calculate Chargeback using Arbitrary Date (paid loan date 29th, leap year) for Paid Date after First Payment Date
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 1/16/2019 | 4/15/2019 | 3/15/2024 | NC | 169.0256 | 4/29/2019 | 60 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 163.48377704918032786885245902 | Paid On or Before Chargeback Date | 59 |
Scenario: NC - Calculate Chargeback using Arbitrary Date (paid loan date 30th, leap year) for Paid Date after First Payment Date
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 3/17/2018 | 4/16/2018 | 3/16/2020 | NC | 86.4577 | 5/30/2018 | 24 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 72.912660333333333333333333333 | Paid On or Before Chargeback Date | 22 |
Scenario: NC - Calculate Chargeback without using Arbitrary Date (paid loan date 31st, leap year) for Paid Date after First Payment Date
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 3/17/2018 | 4/16/2018 | 3/16/2020 | NC | 86.4577 | 5/31/2018 | 24 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 72.912660333333333333333333333 | Paid On or Before Chargeback Date | 22 |
Scenario: NC - Calculate Chargeback using Arbitrary Date with Final pmt after Arbitrary Date (paid loan date 31st, not leap year) for Paid Date after First Payment Date
Given a loan that looks like
| Loan Date | First Pmt Date | Final Pmt Date | Loan Type Id | ReserveAmount | PaidLoanDate | Term |
| 11/30/2018 | 1/1/2019 | 3/1/2025 | NC | 2456.5546 | 1/31/2019 | 75 |
And a loan type table that looks like
| LoanTypeId | LoanComment | ChargebackMethod | NoChargebackDays | NoChargebackPayments | ReserveDiscount | FlatFeePercent | NoReserveThreshold |
| NC | 75% Reserve | N | 90 | 3 | 25.00 | 1.00 | 0.25 |
When the chargeback is calculated
Then the chargeback returned is
| ChargebackAmount | ChargebackTypeMessage | RemainingMonthsAtClose |
| 2328.1242016140350877192982456 | Paid On or Before Chargeback Date | 73 |