Skip to main content

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.

Two GET endpoints serve menu data at different levels of detail. The first returns the raw Menu entity — including the assigned manager and the list of associated Alimento objects. The second returns a flat AlimentoDetalleDTO projection per food item that enriches each record with recipe metadata, chef information, and an ingredient count, sorted alphabetically by food name. A third endpoint lets you fetch a single food item with its full Receta association eager-loaded, which is useful for pre-populating edit forms.

GET /api/menu/{id}

Retrieves a complete Menu entity by its primary key, including the eager-loaded Gerente and the list of associated Alimento records.

Path parameters

id
integer
required
The primary key of the menu to retrieve.

Responses

StatusDescription
200 OKReturns the full Menu object as JSON.
404 Not FoundNo menu with the given ID exists.

Example request

curl http://localhost:8080/api/menu/1

Example response

{
  "id": 1,
  "nombreMenu": "Menú Principal del Día",
  "gerente": {
    "id": 1,
    "nombre": "Martín Vargas",
    "cedula": "1234567890"
  },
  "alimentos": [
    {
      "id": 1,
      "nombre": "Pasta Carbonara Premium",
      "precio": 18.50
    },
    {
      "id": 2,
      "nombre": "Tiramisú Artesanal",
      "precio": 9.00
    }
  ]
}

GET /api/menu/{id}/alimentos

Returns a list of AlimentoDetalleDTO objects for every food item linked to the menu. Results are sorted alphabetically by alimentoNombre. This endpoint is intended for displaying enriched food listings and for pre-populating edit UIs.

Path parameters

id
integer
required
The primary key of the menu whose food items you want to list.

Response fields

Each object in the returned array contains the following fields.
alimentoId
integer
Primary key of the food item in the alimentos table.
alimentoNombre
string
Display name of the food item.
precio
number
Price of the food item as a BigDecimal (two decimal places).
tipoAlimento
string
Derived food category. One of PLATO_FUERTE, POSTRE, BEBIDA, ADICIONAL, or GENERAL. Resolved from the JPA subclass name at runtime.
recetaId
integer
Primary key of the associated Receta. null when the food item has no recipe.
nombreReceta
string
Name of the recipe. Returns "Sin receta" when no recipe is linked.
descripcionProceso
string
Preparation process description from the recipe. Returns "No requiere preparación" when no recipe is linked.
totalIngredientes
integer
Number of Ingrediente records linked to the recipe. Returns 0 when no recipe is linked.
chefId
integer
Primary key of the chef who owns the recipe. null when no recipe or no chef is assigned.
chefNombre
string
Full name of the chef. Returns "N/A" when no chef is assigned.

Responses

StatusDescription
200 OKReturns a JSON array of AlimentoDetalleDTO objects, sorted A–Z by food name.

Example request

curl http://localhost:8080/api/menu/1/alimentos

Example response

[
  {
    "alimentoId": 3,
    "alimentoNombre": "Agua Mineral",
    "precio": 2.50,
    "tipoAlimento": "BEBIDA",
    "recetaId": null,
    "nombreReceta": "Sin receta",
    "descripcionProceso": "No requiere preparación",
    "totalIngredientes": 0,
    "chefId": null,
    "chefNombre": "N/A"
  },
  {
    "alimentoId": 1,
    "alimentoNombre": "Pasta Carbonara Premium",
    "precio": 18.50,
    "tipoAlimento": "PLATO_FUERTE",
    "recetaId": 5,
    "nombreReceta": "Carbonara Clásica",
    "descripcionProceso": "Cocer pasta. Mezclar huevos, queso pecorino y panceta.",
    "totalIngredientes": 4,
    "chefId": 2,
    "chefNombre": "Laura Méndez"
  }
]

GET /api/menu/{menuId}/alimentos/{alimentoId}

Retrieves a single Alimento entity from a menu with its associated Receta eager-loaded. This is the recommended endpoint for pre-populating food-item edit forms, as it provides the full entity graph rather than the summary DTO.

Path parameters

menuId
integer
required
The primary key of the menu that contains the food item.
alimentoId
integer
required
The primary key of the food item to retrieve.

Responses

StatusDescription
200 OKReturns the full Alimento entity (with Receta) as JSON.
404 Not FoundThe food item does not exist in the specified menu.

Example request

curl http://localhost:8080/api/menu/1/alimentos/1

Example response

{
  "id": 1,
  "nombre": "Pasta Carbonara Premium",
  "precio": 18.50,
  "receta": {
    "id": 5,
    "nombreReceta": "Carbonara Clásica",
    "descripcionProceso": "Cocer pasta. Mezclar huevos, queso pecorino y panceta.",
    "chef": {
      "id": 2,
      "nombre": "Laura Méndez",
      "cedula": "2345678901"
    },
    "ingredientes": [
      { "id": 1, "descripcion": "Pasta Linguine" },
      { "id": 2, "descripcion": "Panceta" },
      { "id": 3, "descripcion": "Huevo" },
      { "id": 4, "descripcion": "Queso Pecorino" }
    ]
  }
}

Build docs developers (and LLMs) love