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.

The Recetas API provides read and association endpoints for the restaurant’s recipe catalogue. All routes are mounted under the base path /api/recetas and are CORS-enabled with no authentication required. Recipes are not created directly through this API — they are created implicitly when using the Menu API’s alimento-completo endpoints, which provision both the food item and its linked recipe in a single request.

Endpoints

List all recipes


GET /api/recetas Returns every Receta record in the database, each with its full ingredient list and associated chef eagerly fetched.
curl http://localhost:8080/api/recetas
Response — 200 OK
[
  {
    "id": 1,
    "nombreReceta": "Pasta Carbonara",
    "descripcionProceso": "Cocinar la pasta al dente en agua con sal...",
    "ingredientes": [
      { "id": 4, "descripcion": "Pasta", "cantidadStock": 120 },
      { "id": 7, "descripcion": "Huevo", "cantidadStock": 60 }
    ]
  },
  {
    "id": 2,
    "nombreReceta": "Tiramisú",
    "descripcionProceso": "Preparar el mascarpone con yemas y azúcar...",
    "ingredientes": [
      { "id": 11, "descripcion": "Mascarpone", "cantidadStock": 30 }
    ]
  }
]

Get recipe by ID


GET /api/recetas/{id} Retrieves a single Receta by its numeric primary key, including its full ingredient list and chef reference.

Path parameters

id
integer
required
The unique numeric identifier of the recipe.
Response — 200 OK
{
  "id": 1,
  "nombreReceta": "Pasta Carbonara",
  "descripcionProceso": "Cocinar la pasta al dente en agua con sal...",
  "ingredientes": [
    { "id": 4, "descripcion": "Pasta", "cantidadStock": 120 }
  ]
}
Returns 404 Not Found when no recipe exists with the given id.
curl http://localhost:8080/api/recetas/1

Get recipe by name


GET /api/recetas/nombre/{nombre} Retrieves a single Receta by its exact nombreReceta value. This endpoint is used by the menu detail panel to load the full ingredient list for editing a food item.

Path parameters

nombre
string
required
The exact recipe name to look up, case-sensitive and URL-encoded. Must match the stored nombreReceta value character for character.
Response — 200 OK — a single Receta object (same shape as the by-ID response). Returns 404 Not Found when no recipe matches the name exactly.
curl http://localhost:8080/api/recetas/nombre/Pasta%20Carbonara

Get recipes by chef


GET /api/recetas/chef/{chefId} Returns all recipes authored by the specified chef, each with its full ingredient list. The list is unordered; apply client-side sorting if needed.

Path parameters

chefId
integer
required
The numeric primary key of the chef whose recipes should be returned.
Response — 200 OK — an array of Receta objects (empty array [] when the chef has no recipes).
curl http://localhost:8080/api/recetas/chef/2
Sample response
[
  {
    "id": 1,
    "nombreReceta": "Pasta Carbonara",
    "descripcionProceso": "Cocinar la pasta al dente en agua con sal...",
    "ingredientes": [
      { "id": 4, "descripcion": "Pasta", "cantidadStock": 120 }
    ]
  }
]

List recipes by complexity


GET /api/recetas/complejidad Returns all recipes sorted by ingredient count in descending order. Each entry is a RecetaComplejidadDTO — a concrete DTO class defined inside RecetaRepository — rather than the full Receta entity, making this endpoint suitable for dashboards and summary views.

Response fields

id
integer
The unique identifier of the recipe.
nombreReceta
string
The display name of the recipe.
nombreChef
string
The full name of the chef who owns the recipe.
totalIngredientes
integer (Long)
Total number of ingredients linked to the recipe. Recipes are sorted by this value, highest first.
curl http://localhost:8080/api/recetas/complejidad
Response — 200 OK
[
  {
    "id": 3,
    "nombreReceta": "Risotto ai Funghi",
    "nombreChef": "Andrés Martínez",
    "totalIngredientes": 8
  },
  {
    "id": 1,
    "nombreReceta": "Pasta Carbonara",
    "nombreChef": "Andrés Martínez",
    "totalIngredientes": 5
  },
  {
    "id": 2,
    "nombreReceta": "Tiramisú",
    "nombreChef": "Carina Sosa",
    "totalIngredientes": 3
  }
]

Add ingredient to recipe


POST /api/recetas/{recetaId}/ingredientes/{ingredienteId} Links an existing Ingrediente to an existing Receta by appending it to the recipe’s ingredient list. Both the recipe and the ingredient must already exist; this endpoint only creates the association.

Path parameters

recetaId
integer
required
The numeric primary key of the recipe to update.
ingredienteId
integer
required
The numeric primary key of the ingredient to add.
Response — 200 OK
"Ingrediente agregado"
Response — 400 Bad Request (recipe or ingredient not found)
"No se pudo agregar"
curl -X POST http://localhost:8080/api/recetas/1/ingredientes/4

Recipes are typically created via POST /api/menu/{menuId}/alimento-completo rather than directly through this API. That endpoint accepts a complete AlimentoCompletoRequest payload — including recipe name, process description, chef cédula, and ingredient IDs — and creates the Alimento, Receta, and all associations in a single transaction.

Build docs developers (and LLMs) love