https://espresso-food-delivery-backend-cc3e106e2d34.herokuapp.com/
For information on the Data Transfer Objects (DTOs) used in the requests and responses, check out the DTOs here.
- POST
/register- Description: Registers a new user with the provided details.
- Request Body:
UserRegisterDto(Object) - Data Transfer Object containing user registration details. - Responses:
201 Createdif registration is successful.400 Bad Requestwith error message if registration fails.
- POST
/login- Description: Authenticates a user and returns a user identifier upon successful login.
- Request Body:
UserLoginDto(Object) - Data Transfer Object containing user login credentials. - Responses:
200 OKwith user identifier if login is successful.401 Unauthorizedwith error message if login fails.
- GET
/profile/{userId}- Description: Retrieves the profile details of a specific user.
- Path Parameters:
userId(UUID) - The unique identifier of the user. - Responses:
200 OKwith user profile details if found.404 Not Foundwith error message if user profile is not found.
- POST
/profile/{userId}/location- Description: Updates the location details for a specific user's profile.
- Path Parameters:
userId(UUID) - The unique identifier of the user. - Request Body:
UserUpdateLocationDto(Object) - Data Transfer Object containing new location details. - Responses:
200 OKif the location is successfully updated.404 Not Foundwith error message if the user profile is not found or update fails.
- POST
/orders/{userId}/items- Adds a food item to the user's order.
- Path:
userId(UUID as string) - Body:
foodId(Integer) - Response:
200 OKwith order ID,500 Internal Server Errorwith error message.
- POST
/orders/items/{itemId}- Updates the quantity of an item in the order.
- Path:
itemId(Integer) - Body: Quantity (Integer)
- Response:
200 OKwith item details,500 Internal Server Errorwith error message.
- GET
/orders/{userId}- Retrieves the user's active order.
- Path:
userId(UUID as string) - Response:
200 OKwith order details,404 Not Foundwith error message.
- GET
/orders/{userId}/all- Retrieves all orders for the specified user.
- Path:
userId(UUID as string) - Response:
200 OKwith a list of all orders,404 Not Foundwith error message if no orders are found.
- GET
/orders/{userId}/complete- Completes the user's current order.
- Path:
userId(UUID as string) - Response:
200 OKwith completion status,500 Internal Server Errorwith error message.
- DELETE
/orders/{userId}/current- Deletes the user's current order.
- Path:
userId(UUID as string) - Response:
200 OKwith deletion status,500 Internal Server Errorwith error message.
- DELETE
/orders/{userId}/{orderId}- Deletes a specific order for the user.
- Path:
userId(UUID as string),orderId(Integer) - Response:
200 OKwith deletion status,500 Internal Server Errorwith error message.
- GET
/orders/{userId}/all- Retrieves all orders for the specified user.
- Path:
userId(UUID as string) - Response:
200 OKwith a list of all orders,404 Not Foundwith error message if no orders are found.
- GET
/foods/{foodId}- Retrieves details for a specific food item.
- Path:
foodId(Integer) - Response:
200 OKwith food details,404 Not Foundwith error message.
- GET
/foods- Lists all foods or returns search results based on query.
- Query:
search(String, optional) - Search term for food items. - Response:
200 OKwith list of foods or search results,404 Not Foundwith error message.
-
GET
/foods/categories- Retrieves foods filtered by category.
- Query:
type(String, optional) - Category type, defaults to "all". - Response:
200 OKwith foods by category,404 Not Foundwith error message.
-
GET
/foods/categories/list- Retrieves a list of all food categories.
- Response:
200 OKwith list of food categories,404 Not Foundwith error message.
