Finloan
Table of Contents
Introduction
This service is simulating loan processing that supports the following operations through the RESTful APIs:
- Initiate loan: with arguments for initial amount, annual interest rate, and start date.
- Add payment: with arguments for amount and date.
- Get balance: takes a date as an argument and returns the total balance as of that date.
API documentation
API documentation
How to
Start the project
Make sure you have Docker
and Docker Compose
installed!
After cloning the project and entering the root directory, you can run the project by the following command:
make run
You can start interacting with the APIs when you see app is running at localhost:8080
in the console.
To stop the project use Ctrl+C
.
Run tests
Make sure you have Docker
and Docker Compose
installed!
make test
Notes
- The balance returned is based on all payments and the interest added up to the requested date.
- The interest is not compounding, i.e. the interest calculation is based on the principal balance and exclude already added interest balance.
- The interest added for a day is defined as:
annual interest rate / 100 / 365 * principal balance.