This repository contains the implementation of a credit payment system for an enterprise. The enterprise offers two payment options for its customers, each governed by specific rules and conditions.
The enterprise provides the following payment methods:
- Immediate: Customers make the payment immediately.
- Credit: Customers can make the payment later, subject to additional interest.
To avail of the credit option, customers must satisfy one of the following conditions:
- Long-term customer: The customer has been doing business with the enterprise for more than 24 months.
Interest is applied to the invoice amount based on the duration from the invoice date to the current date as follows:
| Duration | Interest Rate |
|---|---|
| Duration ≤ 14 days | 4% |
| 14 days < Duration ≤ 30 days | 6% |
| 30 days < Duration ≤ 60 days | 10% |
| 60 days < Duration ≤ 180 days | 16% |
| Duration > 180 days | 20% |
When a customer with an outstanding credit makes a payment:
- The earliest outstanding amount is reduced first.
- This repository focuses on business logic, design, test cases, and extension points.
- UI considerations are not within the scope of this implementation.
- Clone the repository:
git clone https://github.com/imparthibank/clean-architecture.git