1- Open Intellij and select "File ->New->Project from version control->GitHub"
2- In "Git Repository URL" paste the link of this repository.
3- Clone!
4- Build the project in Intellij
5- Run Main.class
6- In Postman (Application to test the API ) type the URLs and headers needed to run the application.
Returns in JSON a list of all vehicles by dealers.
Retunrs in JSON a list of all vehicles by model.
Retunrs in JSON a list of all vehicles by transmission.
Retunrs in JSON a list of all vehicles by fuel.
Key | Value(Example) |
---|---|
lat | 38.1044 |
long | -9.10 |
Returns in JSON the closest dealer.
Returns in JSON all bookings.
Key | Value(Example) |
---|---|
id | 846f2d9b-be82-47ac-88dc-3bb20581d777 |
vehicleId | 136fbb51-8a06-42fd-b839-c01ab87e2c6c |
firstName | Joao |
lastName | Figueira |
pickupDate | 2018-03-20T10:30:00 |
createdAt | 2018-02-27T08:42:46.296 |
Creates a new booking.
Key | Value(Example) |
---|---|
id | 846f2d9b-be82-47ac-88dc-3bb20581d777 |
vehicleId | 2018-02-29T08:42:46.291 |
cancelledReason | Weather |
Cancel a booking.
-
The source code is in Jave because is the languague that I am more familiar.
-
The Server is multithreaded so it handles multiple request at the same time.
-
It is possible to do a booking with the same characteristics as long it has been cancelled before the "createdAt" date
-
To prevent data races and data omission I implement a lock system to create/delete/see bookings.
-
"Improvement suggestions" are not implemented.