Use following commands to run the application on the command line:
- To build the application -> mvn clean package
- To run the tests -> mvn test
- To run the application -> mvn spring-boot:run
These are the CURL for some of the APIs.
- API to create a car
curl --location --request POST 'http://localhost:8080/cims/admin/add-car' \ --header 'Content-Type: application/json' \ --data-raw '{ "make" : "maruti", "year" : "3433", "price" : 343.234 }'
- API to list cars
curl --location --request GET 'http://localhost:8080/cims/car/list'
- API to remove cars from inventory
curl --location --request POST 'http://localhost:8080/cims/admin/remove' \ --header 'Content-Type: application/json' \ --data-raw '["27f8af20-a122-4a77-afb4-f533e5692df4"]'
- API to buy a car
curl --location --request POST 'http://localhost:8080/cims/car/buy' \ --header 'Content-Type: application/json' \ --data-raw '{ "id": "aa43eded-07c6-4bf1-bd16-495c7fa0008b", "buyingPrice" : 500 }'