Menu management is at the heart of Restorante’s daily operations. Each menu belongs to a Gerente (manager) and holds a curated collection of food items — from main courses and desserts to beverages and add-ons. The menu API lets you inspect the full item list, create richly-detailed food entries in a single request, update them in place, or remove them without losing the underlying record.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/NicolasMPP/restorante-springboot/llms.txt
Use this file to discover all available pages before exploring further.
Menu Structure
AMenu entity carries the following fields:
| Field | Type | Description |
|---|---|---|
id | Integer | Auto-generated primary key |
nombreMenu | String (100 chars) | Display name of the menu |
gerente | Gerente | The manager who owns this menu (ManyToOne) |
alimentos | List<Alimento> | All food items on the menu, linked via the menu_alimentos join table (ManyToMany) |
alimentos is a typed subclass of Alimento:
PlatoFuerte
Main courses — mapped with tipo
PLATO_FUERTE.Postres
Desserts — mapped with tipo
POSTRE.Bebida
Beverages — mapped with tipo
BEBIDA.Adicionales
Add-on extras — mapped with tipo
ADICIONAL.Alimento has a nombre (name), precio (BigDecimal), and an optional Receta that links the item to a chef and ingredient list.
Common Operations
Get the Full Menu
Retrieve the complete Returns a
Menu object including its Gerente and all Alimento entries.200 OK with the serialised Menu entity, or 404 Not Found if the menu does not exist.Get Menu Items with Details
Fetch a richer summary of every food item on the menu, including its associated recipe name, chef, and ingredient count.Returns a list of
AlimentoDetalleDTO objects sorted alphabetically by food name. See the response shape below for the full field list.Get a Single Food Item
Retrieve one food item from a menu with its full Returns the
Receta and ingredient data pre-loaded — useful for populating an edit form.Alimento entity with its recipe and chef hydrated, or 404 Not Found if either the menu or the item does not exist.Add an Existing Food to the Menu
Link a food item that already exists in the database to a menu. No new records are created; only a row in Returns
menu_alimentos is written.200 OK with "Alimento agregado correctamente" on success, or 400 Bad Request if either ID is not found.Create a Complete Food Item
Create a recipe, resolve its ingredients by description, create the typed food item, and add it to the menu — all in one atomic transaction.Request body (The service performs these steps in order:
AlimentoCompletoRequest):- Looks up the
Chefentity bychefCedula— returns400if not found. - Creates and persists a new
Recetawith the given name, process description, and chef. - Resolves each entry in
ingredientesDescripcionesto an existingIngredienteby itsdescripcionfield and attaches it to the recipe. - Instantiates the correct
Alimentosubclass determined bytipo. - Persists the
Alimentoand inserts themenu_alimentosrow.
200 OK with "Alimento creado correctamente" on success, or 400 Bad Request if any step fails.Update a Food Item
Update the name, price, type, recipe, chef, and ingredient list of an existing food item. If the item had no recipe, one is created. If the The request body uses the same
tipo changed, the JPA discriminator column is updated via a native SQL query within the same transaction.AlimentoCompletoRequest shape as the create endpoint.Returns 200 OK with "Alimento actualizado correctamente" on success, or 400 Bad Request if the alimento or chef is not found.Remove a Food from the Menu
Unlink a food item from the menu by deleting the corresponding row in Returns
menu_alimentos. The Alimento record itself is preserved in the database and can be re-linked to any menu later.200 OK with "Alimento removido del menú" on success, or 400 Bad Request if either ID is not found.AlimentoCompletoRequest Fields
| Field | Type | Description |
|---|---|---|
nombreAlimento | String | Display name of the food item |
precio | BigDecimal | Price of the item |
tipo | String | One of PLATO_FUERTE, POSTRE, BEBIDA, or ADICIONAL |
nombreReceta | String | Name for the associated recipe |
descripcionProceso | String | Step-by-step preparation instructions |
chefCedula | String | National ID of the chef responsible for the recipe |
ingredientesDescripciones | List<String> | Exact description strings of the ingredients to link |
AlimentoDetalleDTO Response Shape
The /api/menu/{id}/alimentos endpoint returns a list of objects with the following fields:
| Field | Type | Description |
|---|---|---|
alimentoId | Integer | Primary key of the food item |
alimentoNombre | String | Name of the food item |
precio | BigDecimal | Price |
tipoAlimento | String | Derived type string (PLATO_FUERTE, POSTRE, BEBIDA, ADICIONAL) |
recetaId | Integer | ID of the linked recipe, or null if none |
nombreReceta | String | Recipe name, or "Sin receta" |
descripcionProceso | String | Preparation description, or "No requiere preparación" |
totalIngredientes | Long | Number of ingredients on the recipe |
chefId | Integer | ID of the assigned chef, or null |
chefNombre | String | Chef’s name, or "N/A" |
The
AlimentoDetalleDTO list returned by GET /api/menu/{id}/alimentos is always sorted alphabetically by alimentoNombre. This ordering is applied in the service layer after mapping and cannot be overridden via query parameters.Web Interface
The Thymeleaf menu interface at/menu provides a visual view of the same data and calls these same API endpoints under the hood. You can use the web UI to browse items, open an edit modal pre-populated via GET /api/menu/{menuId}/alimentos/{alimentoId}, and submit changes through the REST layer.