This is the primary endpoint for adding new food to a menu when the food record does not yet exist. In a single transactional call, the server performs the following steps in order: looks up the chef by cédula, creates and saves a newDocumentation 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.
Receta, links matching Ingrediente records to that recipe by their description strings, instantiates the correct Alimento subclass based on the requested type, saves the food item, and finally associates it with the target menu via the menu_alimentos join table. If any step fails, the entire operation returns 400 and no partial data is committed.
Endpoint
POST/api/menu/{menuId}/alimento-completo
Path parameters
The primary key of the menu to which the new food item will be added after creation.
Request body
Content-Type:application/json
Display name of the new food item. Maximum 100 characters. Stored in the
nombre column of the alimentos table.Price of the food item as a decimal value. Stored as
DECIMAL(10,2).Food category. Determines which JPA subclass is instantiated and sets the
tipo_alimento discriminator column. Accepted values:PLATO_FUERTE— main coursePOSTRE— dessertBEBIDA— beverageADICIONAL— side or add-onGENERAL— baseAlimentowith no subtype
Name of the new recipe that will be created and linked to this food item.
Free-text preparation process description stored on the
Receta entity.The cédula (national ID number) of the chef who will be assigned as the recipe’s owner. The server resolves this to a
Chef entity via an exact match. The request fails with 400 if no matching chef is found.Array of ingredient description strings. Each entry is matched against the
descripcion field of existing Ingrediente records. Only exact matches are linked to the new recipe; non-matching strings are silently skipped.Responses
| Status | Body | Description |
|---|---|---|
200 OK | "Alimento creado correctamente" | The food item, recipe, and all associations were created successfully. |
400 Bad Request | "No se pudo crear el alimento" | The operation failed, most commonly because the chef cédula was not found or an unexpected error occurred. |