# Baleinev - Hot wine week API The Baleinev Hot wine week API allows to manage the drinks available during the Hot wine week. It uses the HTTP protocol on port `8080`. The JSON format is used to exchange data. The `Content-Type` header must be set to `application/json` when sending data to the API. The `Accept` header must be set to `application/json` when receiving data from the API. The API is based on the CRUD pattern. It has the following operations: - Create a new drink - Get many drinks that you can filter by price - Get one drink by its ID - Update a drink - Delete a drink The API also allows to check the schedules of the Hot wine week per day. ## Endpoints ### Create a new drink - `POST /drinks` Create a new drink. #### Request The request body must contain a JSON object with the following properties: - `name` - The name of the drink - `description` - The description of the drink - `price` - The price of the drink (double) #### Response The response body contains a JSON object with the following properties: - `id` - The unique identifier of the drink - `name` - The name of the drink - `description` - The description of the drink - `price` - The price of the drink (double) #### Status codes - `201` (Created) - The drink has been successfully created - `400` (Bad Request) - The request body is invalid - `409` (Conflict) - The drink already exists ### Get many drinks - `GET /drinks` Get many drinks. #### Request The request can contain the following query parameters: - `price` - Filter the drinks by price (double) #### Response The response body contains a JSON array with the following properties: - `id` - The unique identifier of the drink - `name` - The name of the drink - `description` - The description of the drink - `price` - The price of the drink (double) #### Status codes - `200` (OK) - The drinks have been successfully retrieved ### Get one drink - `GET /drinks/{id}` Get one drink by its ID. #### Request The request path must contain the ID of the drink. #### Response The response body contains a JSON object with the following properties: - `id` - The unique identifier of the drink - `name` - The name of the drink - `description` - The description of the drink - `price` - The price of the drink (double) #### Status codes - `200` (OK) - The drink has been successfully retrieved - `404` (Not Found) - The drink does not exist ### Update a drink - `PUT /drinks/{id}` Update a drink by its ID. #### Request The request path must contain the ID of the drink. The request body must contain a JSON object with the following properties: - `name` - The name of the drink - `description` - The description of the drink - `price` - The price of the drink (double) #### Response The response body contains a JSON object with the following properties: - `id` - The unique identifier of the drink - `name` - The name of the drink - `description` - The description of the drink - `price` - The price of the drink (double) #### Status codes - `200` (OK) - The drink has been successfully updated - `400` (Bad Request) - The request body is invalid - `404` (Not Found) - The drink does not exist ### Delete a drink - `DELETE /drinks/{id}` Delete a drink by its ID. #### Request The request path must contain the ID of the drink. #### Response The response body is empty. #### Status codes - `204` (No Content) - The drink has been successfully deleted - `404` (Not Found) - The drink does not exist ### Get the schedules - `GET /schedules` The response body contains a JSON array with the following properties: - `id` - The unique identifier of the schedule - `day` - The day of the week for the schedule - `start` - The start time of the schedule (HH:mm) - `end` - The end time of the schedule (HH:mm) #### Status codes - `200` (OK) - The schedules have been successfully retrieved