https://github.com/gabrielferreira02/simple-loan-checker
SpringBoot aplication for checking which types of loan a user is allowed to use
https://github.com/gabrielferreira02/simple-loan-checker
backend java lombok spring-boot spring-validation
Last synced: 28 days ago
JSON representation
SpringBoot aplication for checking which types of loan a user is allowed to use
- Host: GitHub
- URL: https://github.com/gabrielferreira02/simple-loan-checker
- Owner: gabrielferreira02
- Created: 2024-10-13T15:57:43.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-12-24T21:10:01.000Z (4 months ago)
- Last Synced: 2025-02-06T19:02:34.587Z (3 months ago)
- Topics: backend, java, lombok, spring-boot, spring-validation
- Language: Java
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple loan checker in Java/Spring
# Technologies Used
- Java
- SpringBoot
- Spring Web
- Spring Validation
- Lombok# Description
A simple system that contains only one route responsible for checking which types of loans a user is allowed to use.
Validations were made for the request fields found in RequestEntity, as well as validation error messages were handled to be displayed in a more user-friendly way for those who consume the service. I dont use folders to separate files because it is a small project for study# Business Rule
- 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 payroll loan if the client's salary is equal to or greater than R$5000.
- Grant the loan with collateral if the client's salary is equal to or less than R$3000.
- Grant the loan with collateral 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).# Request Format
```json
{
"name": "example name",
"age": 22,
"cpf": "831.887.100-62",
"location": "SP",
"wage": 3000.0
}
```For this request will return a response 200 OK and the list of types of loan valids to this user
Now for the next request it will return the error formatted for the invalid cpf with a status 400 Bad Request
```json
{
"name": "example name",
"age": 22,
"cpf": "831.887.100-61",
"location": "SP",
"wage": 3000.0
}
```# Run the project
Clone this repository
```
git clone https://github.com/gabrielferreira02/Simple-loan-checker.git
```Go to the directory
```
cd Simple-loan-checker
```Now run with the following command or press the start button in your IDE(Vscode, Intellij, Eclipse)
```
mvn spring-boot:run
```