Application for creating individual Third-Party Liability (OC) and Comprehensive (AC) insurance policies for customers.
During the initial step, customers are required to register with the application to obtain an authentication token. This token grants customers access to the application's functionalities.
In the subsequent step, the client is prompted to input their personal information along with details about the vehicle. The application utilizes the provided data to calculate the vehicle insurance premium.
The application offers a choice between two insurance types: OC or OC and AC. The algorithms used to calculate the insurance price incorporate data such as the client's age, engine capacity, vehicle type, garage type, vehicle price, year of production, and average kilometers driven per year.
The client is eligible for a 5% discount on OC and a 2% discount on AC when insuring an additional vehicle. The maximum discount for OC insurance is 40%, and for AC insurance, it is 25%.
In the subsequent step, the application generates an individual policy for the client. The policy includes a unique name, policy type, start and end dates, and the corresponding insurance price .
I used a My SQL database to implement the relationships in the database. The application is deployed on Docker and has an implemented swagger.
Core:
- Install IntelliJ IDEA and Docker Desktop on your computer.
- Run Docker Desktop.
- Clone the repository in IntelliJ IDEA using the link https://github.com/Gimi818/InsuranceCompany
- Run docker-compose up in the terminal.
- Run the applications in IntelliJ IDEA.
- Try the applications in Postaman, the steps on how to do it are below.
Step 1 :
POST localhost:8080/register
Enter your username and password.
JSON:
{"username":"User",
"password":"Password"}
Step 2 :
POST localhost:8080/token
Enter your username and password to get the token.
JSON:
{
"username":"User",
"password":"Password"
}
Step 3.1 :
Select the authorization field and select the Bearer token option
and paste the token you received into the all next steps.
Step 3.2 :
POST localhost:8080/clients
Enter personal data.
JSON:
{
"firstname": "John",
"lastname": "Williams",
"age": 38}
}
Step 4 :
POST localhost:8080/cars/1
Enter the Client ID into the URL and enter vehicle details.
Available options for:
carModel: CAR, LORRY.
parkingType: GARAGE, DRIVEWAY, ROAD.
JSON:
{"brand": "Bmw",
"model": "X5",
"carValue": 83500,
"carModel": "CAR",
"parkingType": "GARAGE",
"yearOfManufacture": 2016,
"enginCapacity": 3.0,
"averageKmTraveledPerYear": 19500}
Step 5 :
Enter the Client ID into the URL
Choose policy: OC or OC and AC and create an individual policy.
POST localhost:8080/policies/OC/1
or
POST localhost:8080/policies/OC/AC/1
Step 6 :
GET localhost:8080/clients/1
Get the result.
Endpoints available in the application :