Database is denormalized and has no duplicates check. All the data is in JSON format.
GET http://localhost:8080/available
- get all non-booked phones
GET http://localhost:8080/unavailable
- get all booked phones
GET http://localhost:8080
- get all phones
Book a phone: phone ID, user name is required
curl -X POST -H "Content-Type: application/json" -d '{"id":"beff85af-488e-4df0-a652-af468f7cbda0", "name":"John"}' --location "http://localhost:8080/book"
Unbook (release) a phone: phone ID is required
curl -X POST -H "Content-Type: application/json" -d '{"id":"beff85af-488e-4df0-a652-af468f7cbda0"}' --location "http://localhost:8080/unbook"
fill_db.sh
is to fill database with mock phones