The application is written in Java with Spring-Boot and Swagger-UI to easier explore API.
Build: mvn package
Run: java -jar JAR_FILE.jar
Here are the Endpoints and some example responses:
Endpoint: /api/v1/stylist
Method: POST
Body:
{
"name": "Anna",
"state": "ROOKIE"
}
Body:
{
"name": "Anna",
"state": "ROOKIE"
}
Endpoint: /api/v1/stylists/{id}
Method: GET
Body:
{
"name": "Max",
"state": "READY_TO_STYLE"
}
Endpoint: /api/v1/stylists/{id}
Method: DELETE
Endpoint: /api/v1/stylists/{stylistId}/{styleState}
Method: PUT
StyleState: READY_TO_STYLE
Endpoint: /api/v1/stylists/availability
Method: Post
Body:
TODO
{
"from": "2018-06-04T08:00:00.000Z",
"to": "2018-06-04T19:00:00.000Z"
}
Body:
[
{
"from": "2018-06-04T08:00Z",
"to": "2018-06-04T08:30Z"
},
{
"from": "2018-06-04T08:30Z",
"to": "2018-06-04T09:00Z"
},
{
"from": "2018-06-04T09:00Z",
"to": "2018-06-04T09:30Z"
},
{
"from": "2018-06-04T09:30Z",
"to": "2018-06-04T10:00Z"
}
]
Endpoint: /api/v1/stylists/reservation
Method: Post
Body:
TODO
{
"comment": "Comment",
"customer": "Customer",
"timeslot": {
"from": "2018-06-04T08:00:00.000Z",
"to": "2018-06-04T08:30:00.000Z"
}
}
- The implementation does not fully cover the specification. It has a lot of limitations.
- I did not implement a state machine. The stylist just has different types that can be change through API.