Re-implement the Loan Interest Calculator for banking customers using functional programming, domain-driven design, and test-driven development.
- Produce a small console application.
- Use an in-memory store.
- Simple interest formula: https://www.investopedia.com/terms/s/simple_interest.asp
- A user can provide input parameters to calculate a loan.
- The system should generate an output containing the loan calculation results.
- A user can access historic calculations that they can update with new input parameters.
- Start Date (date)
- End Date (date)
- Loan Amount (amount field)
- Loan Currency (currency)
- Base Interest Rate (percentage)
- Margin (percentage), where Total Interest Rate = Base Interest Rate + Margin
The output data structure should include the daily accrued interest for each day between the start and end date of the loan:
- Daily Interest Amount without margin
- Daily Interest Amount Accrued
- Accrual Date
- Number of Days elapsed since the Start Date of the loan
- Total Interest - calculated over the given period
- Functional Programming information - https://www.bastienfoucher.net/series/functional-ddd-csharp
- Functional programming approach inspired by https://github.com/BastienFoucher/Grenat.Functional.DDD