A REST API using NodeJS, TypeScript, Express, TypeORM and Postgres. Other technologies employed are: jsonwebtoken, swagger, tsyringe, uuid, jest and others!
- RF => Functional Requisites
- RNF => Non Functional Requisites
- RN => Business Rules
RF
- It should be possible to register a new car in the database.
RN
- Should not be possible to register more than one car with the same license plate.
- Every car should be registered as available for rental by default.
- Only admin users can register a car.
RF
- It should be possible to list all available cars.
- It should be possible to list all available cars by name.
- It should be possible to list all available cars by category.
- It should be possible to list all available cars by brand.
RN An user does not need to be logged in to list all available cars.
RF
- It should be possible to register a new specification for a car.
RN
- Should not be able to register a specification for a non existing car.
- Should not be able to register an existing specification for the same car.
- Only admin users can register a specification for a car.
RF
- It should be possible to register a new image for a car.
RNF
- Use multer for uploading files.
RN Should not be able to register an image for a non existing car. It should be possible to register multiple images for the same car.
- Only admin users can register an image for a car.
RF
- It should be possible to register a new car rental.
RN
- The minimun duration of a rental must be 24 hours.
- Should not be able to register a new car rental for an user already renting a car.
- Should not be able to register a new car rental for a non available car.
- Once a rental is created, the car status should change to unavailable.
RF
- It should be possible to return a car.
RN
- If a car is returned within 24 hrs, a full 24hrs fee must be charged.
- Once returned, the car must be set as available for rent.
- Once returned, the user must be listed with no current rental.
- Once returned, the total amount due must be calculated.
- If the car is returned after the expected date, a fee must be calculated according to the number of late days.
- If the car is returned after the expected date, the calculated fee must be added to the total.
- User must be logged in to return a car.
RF
- It should be possible lo list an user's rentals.
RN
- User must be logged in to lis his rentals.
RF
- It should be able to recover a misplaced password with an user's email
- It should be able to send an e-mail to the user with a step-by-step guide to revocer the password
- It should be able to let the user create a new password
RN
- User must provide a new password
- The recovery link must expire after 3 hours