Recetas (recipes) are the connective tissue between Restorante’s kitchen staff and the food items on any given menu. Each recipe names the chef responsible for preparing it, documents the step-by-step process, and carries a list of the ingredients it requires. Because recipes are referenced byDocumentation 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.
Alimento entities, every food item on a menu traces back to a recipe — and through that recipe, to a chef and a set of pantry ingredients.
Recipe Structure
AReceta entity is mapped to the recetas table and has the following fields:
| Field | Type | Description |
|---|---|---|
id | Integer | Auto-generated primary key |
nombreReceta | String (100 chars, required) | The name of the recipe |
descripcionProceso | TEXT | Step-by-step preparation instructions |
chef | Empleado | The employee (chef) responsible for this recipe (ManyToOne) |
ingredientes | List<Ingrediente> | Ingredients this recipe uses, linked via the receta_ingredientes join table (ManyToMany) |
nombreReceta is a non-nullable column. A recipe without a name or without a chef cannot be persisted — the service layer enforces both constraints before calling the repository.Operations
List All Recipes
Retrieve every recipe in the system, fully hydrated with chef and ingredient data.200 OK list of Receta objects.
Get Recipe by ID
Receta with its complete data, or 404 Not Found if the ID does not exist.
Get Recipe by Name
Look up a single recipe using its exactnombreReceta value. This endpoint is used internally by the Thymeleaf frontend to pre-load ingredient details for a recipe detail panel.
Receta, or 404 Not Found if no recipe with that exact name exists.
Get Recipes by Chef
Retrieve all recipes assigned to a specific chef, identified by their numeric employee ID.Receta objects (empty list if the chef has no assigned recipes).
Recipe Complexity
Rank all recipes by the number of ingredients they contain, from most complex to least complex.RecetaComplejidadDTO objects sorted in descending order by ingredient count. This is useful for meal-planning workflows where kitchen capacity or prep time must be considered before adding a new item to the menu.
Add Ingredient to a Recipe
Link an existingIngrediente to a recipe by inserting a row into receta_ingredientes.
200 OK with "Ingrediente agregado" on success, or 400 Bad Request if either the recipe or ingredient ID does not exist.
Seed Data Reference
The following recipes are included in the application’s seed data:Pasta Carbonara
Chef: Carina SosaIngredients: Pasta, Queso Parmesano, Huevos, Tocino, Sal, Pimienta
Bistec a la Parrilla
Chef: Andrés MartínezIngredients: Carne de Res, Ajo, Aceite de Oliva, Sal, Pimienta
Ensalada Caprese
Chef: Carina SosaIngredients: Tomate, Mozzarella, Albahaca, Aceite de Oliva, Sal
Pollo al Horno
Chef: Andrés MartínezIngredients: Pollo, Ajo, Aceite de Oliva, Sal, Pimienta
Integration with Menu Creation
When you callPOST /api/menu/{menuId}/alimento-completo, the MenuService orchestrates recipe creation as part of a single @Transactional operation:
Resolve the Chef
The service calls
ChefRepository.findByCedula(chefCedula) using the chefCedula from the request body. If no matching Chef is found, the entire operation is aborted and false is returned.Create the Recipe
A new
Receta is instantiated with nombreReceta, descripcionProceso, and the resolved Chef, then persisted to the recetas table.Resolve and Link Ingredients
Each string in
ingredientesDescripciones is used to look up an Ingrediente by its descripcion field via IngredienteRepository.findByDescripcion(descripcion). Any match is added to the recipe’s ingredientes collection. Unmatched descriptions are silently skipped.Create the Typed Food Item
The correct
Alimento subclass is instantiated based on the tipo field (PLATO_FUERTE → PlatoFuerte, POSTRE → Postres, BEBIDA → Bebida, ADICIONAL → Adicionales) and linked to the new recipe.