Car Rental Company has many cars of the same model type and the user can book the car of a particular model depending on availability of that car model. Authentication is required to update, delete and add the cars in the database.
How to Run
- Clone the repo
- Goto that directory
- run command npm install
- run command npm run start
Add the new car:
Step1) Login to get token
The token is put into the Authorization header to serve the update request.
Step2) Add the car
Issue the particular car to the user:
Number of Bookings of the car is updated and stock is updated when the issue is submitted:
The return status of the issue is changed when the id put in URL and returned date is today’s date:
Number of Bookings of the car is updated and stock is updated when the car is returned:
GET the Car Rentals history for user:
GET particular car rental history by its id:
Update the car details when the bookings are not there:
The token is put into the Authorization header to serve this request.
Delete the card details when the bookings are not there:
The token is put into the Authorization header to serve the delete request.