The main objective of this project was to create an API to manage clients and the loan payments control system from a fin-tech.
The program was made to create and manage the clients and keep track of the amount of money loaned and the missed/made payments from a fin-tech. It also retrieves the volume of outstanding debt at some point in time.
1- If a client contracted a loan in the past and paid all without missing any payment, you can decrease by 0.02% his tax rate.
2- If a client contracted a loan in the past and paid all but missed until 3 monthly payments, you can increase by 0.04% his tax rate.
3- If a client contracted a loan in the past and paid all but missed more than 3 monthly payments or didn't pay all the loan, you need to deny the new one.
Loans are paid back in monthly instalments.
Get a specific client or, if an PK (ID) wasn't provided, lists all clients.
- data of the client(s)
{
"client_id": 1,
“name”: “Felicity”,
“surname”: “Jones”,
“email”: “[email protected]”,
“telephone”: “11984345678”,
“cpf”: “34598712387”
}
Create a client in the system.
- name: the client name.
- surname: the client surname.
- email: the client email.
- telephone: the client telephone.
- cpf: the client (Cadastro de Pessoa Física) identification.
{
“name”: “Felicity”,
“surname”: “Jones”,
“email”: “[email protected]”,
“telephone”: “11984345678”,
“cpf”: “34598712387”
}
- client_id: unique id of a client.
{
"client_id": 1
}
Create a loan application. Loans are automatically accepted.
- client_id: the client's identification that contracted a loan.
- amount: loan amount in dollars.
- term: number of months that will take until the loan gets paid-off.
- rate: interest rate as decimal.
- date: when the loan was requested (origination date as an ISO 8601 string).
{
“client_id”: 1,
“amount”: 1000,
“term”: 12,
“rate”: 0.05,
“date”: “2019-05-09 03:18Z”
}
- loan_id: unique id of the loan.
- instalment: monthly loan payment.
{
“loan_id”: “000-0000-0000-0000”,
“instalment”: 85.60
}
Loan payment formula
r = rate / term instalment = [r + r / ((1 + r) ^ term - 1)] x amount
For repaying a loan of $1000 at 5% interest for 12 months, the equation would be:
instalment = [(0.05 / 12) + (0.05 / 12) / ((1 + (0.05 / 12)) ^ 12 - 1] x 1000 instalment = 85.60
Create a record of a payment made or missed
- payment: type of payment: made or missed.
- date: payment date.
- amount: amount of the payment made or missed in dollars.
{
“payment”: “made”,
“date”: “2019-05-07 04:18Z”,
“amount”: 85.60
}
{
“payment”: “missed”,
“date”: “2019-05-07 04:18Z”,
“amount”: 85.60
}
Get the volume of outstanding debt (i.e., debt yet to be paid) at the moment of requisition.
balance: outstanding debt of loan.
{
“balance”: 40
}