API to check which types of loans a person has access to based on their information.
- Grant the personal loan if the client's salary is equal to or less than R$3000.
- Grant the personal loan if the client's salary is between R$3000 and R$5000, if the client is under 30 years old and lives in São Paulo (SP).
- Grant the consignment loan if the client' salary is equal to or higher than R$5000
- Grant the loan with guarantee if the client's salary is equal to or less than R$3000.
- Grant the loan with guarantee if the client's salary is between R$3000 and R$5000, if the client is under 30 years old and resides in São Paulo (SP).
{
"age": 26,
"cpf": "275.484.389-23",
"name": "Vuxaywua Zukiagou",
"income": 7000.00,
"location": "SP"
}
HTTP/1.1 200 Ok
{
"customer": "Vuxaywua Zukiagou",
"loans": [
{
"type": "PERSONAL",
"interest_rate": 4
},
{
"type": "GUARANTEED",
"interest_rate": 3
},
{
"type": "CONSIGNMENT",
"interest_rate": 2
}
]
}
- POST
{host}/customer-loans
- Request body parameters:
age: number
,cpf: string
,name: string
,income: number
,location: string
. - Responses
- 200 OK: Returns json with the available loans for that person, example:
- 400 Bad Request if body parameters fails validation
- Install dependencies using:
npm install
- Use the following command to build the
dist
folder:npm run build
- Start the server using the following command:
npm run start:dev
http:https://localhost:3000/customer-loans