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 Chefs API provides read-only access to chef records stored in the restaurant’s employee hierarchy. All routes are mounted under the base path /api/chefs and are CORS-enabled with no authentication required. Chef cédulas are the primary key used when assigning a chef to a new recipe through the Menu API’s alimento-completo workflow — retrieve the list of chefs first, let the user choose, then pass the chosen chef’s cedula field in the request body.

Endpoints

List all chefs


GET /api/chefs Returns all Chef records ordered by name (ascending), as supplied by ChefRepository.buscarTodosOrdenados(). This endpoint is used by the Add Food Item modal to populate the chef selection dropdown.
curl http://localhost:8080/api/chefs
Response — 200 OK
[
  {
    "id": 2,
    "nombre": "Andrés Martínez",
    "cedula": "2345678901",
    "salario": 2500.00,
    "fechaVinculacion": "2021-03-15",
    "horaIngreso": "2024-01-10T08:00:00",
    "horaSalida": "2024-01-10T17:00:00",
    "telefono": "0987654321",
    "correo": "andres.martinez@restorante.com"
  },
  {
    "id": 3,
    "nombre": "Carina Sosa",
    "cedula": "3456789012",
    "salario": 2800.00,
    "fechaVinculacion": "2020-07-01",
    "horaIngreso": "2024-01-10T07:30:00",
    "horaSalida": "2024-01-10T16:30:00",
    "telefono": "0976543210",
    "correo": "carina.sosa@restorante.com"
  }
]

Response fields

id
integer
Auto-generated primary key of the chef record.
nombre
string
Full display name of the chef (max 100 characters, inherited from Persona).
cedula
string
Unique identity number (cédula) used as a business key across the API. Required when creating food items via the Menu API.
salario
number
Monthly salary with up to two decimal places (inherited from Empleado).
fechaVinculacion
string
ISO-8601 date (YYYY-MM-DD) recording when the chef joined the restaurant (inherited from Empleado).
horaIngreso
string
ISO-8601 datetime of the chef’s shift start (inherited from Empleado).
horaSalida
string
ISO-8601 datetime of the chef’s shift end (inherited from Empleado).
telefono
string
Contact phone number (max 20 characters, inherited from Persona). May be null.
correo
string
Email address (max 100 characters, inherited from Persona). May be null.

Get chef by ID


GET /api/chefs/{id} Retrieves a single Chef by its numeric primary key.

Path parameters

id
integer
required
The unique numeric identifier of the chef to retrieve.
curl http://localhost:8080/api/chefs/2
Response — 200 OK — a single Chef object (same shape as entries in the list response). Returns 404 Not Found when no chef exists with the given id.

Get chef by cédula


GET /api/chefs/cedula/{cedula} Retrieves a single Chef by their cédula (national identity number). Because cedula is declared as a unique column in the personas table, this lookup always returns at most one record. This route is used internally by the Menu API when processing an AlimentoCompletoRequest — it resolves chefCedula to the full Chef entity before creating the linked recipe.

Path parameters

cedula
string
required
The chef’s cédula string exactly as stored (max 20 characters). Must be URL-safe; encode any special characters before passing in the path segment.
curl http://localhost:8080/api/chefs/cedula/2345678901
Response — 200 OK — a single Chef object. Returns 404 Not Found when no chef’s cédula matches the given value.

Get recipes for a chef


GET /api/chefs/{id}/recetas Returns all Receta records associated with the specified chef, each with its full ingredient list. This is the same data served by GET /api/recetas/chef/{chefId} but scoped to the Chefs resource path. It is used by the chef detail panel in the menu UI.

Path parameters

id
integer
required
The numeric primary key of the chef whose recipes should be returned.
curl http://localhost:8080/api/chefs/2/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": 9, "descripcion": "Guanciale", "cantidadStock": 25  }
    ]
  },
  {
    "id": 3,
    "nombreReceta": "Risotto ai Funghi",
    "descripcionProceso": "Sofreír la cebolla con mantequilla...",
    "ingredientes": [
      { "id": 2, "descripcion": "Cebolla",   "cantidadStock": 80 },
      { "id": 6, "descripcion": "Arroz",     "cantidadStock": 95 }
    ]
  }
]
Returns an empty array [] when the chef has no recipes assigned.
Chefs inherit from Empleado, which in turn inherits from Persona. The Persona → Empleado link uses JPA JOINED inheritance (separate personas and empleados tables joined by primary key), while the Empleado → Chef link uses SINGLE_TABLE inheritance with a tipo_empleado discriminator column. This means the full set of Empleado fields — fechaVinculacion, horaIngreso, horaSalida, and salario — plus all Persona fields (nombre, cedula, telefono, correo) are included in every Chef response. The recetas back-reference on Empleado is annotated @JsonIgnore and will not appear in serialised output; use GET /api/chefs/{id}/recetas to retrieve a chef’s recipes.
When building a form to add a new food item, call GET /api/chefs first to populate a chef selection dropdown with the ordered list of available chefs. Once the user selects a chef, pass the chosen chef’s cedula field as AlimentoCompletoRequest.chefCedula in your POST /api/menu/{menuId}/alimento-completo request. The API will resolve the cédula to the full Chef entity and create the recipe association automatically.

Build docs developers (and LLMs) love