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 Despensa (Pantry) API manages the restaurant’s ingredient inventory. Each pantry (Despensa) belongs to a manager (Gerente) and holds a collection of Ingrediente records through a many-to-many join table (despensa_ingredientes). All endpoints are CORS-enabled and require no authentication. The base path for pantry operations is /api/despensa, and the base path for ingredient operations is /api/ingredientes. The base URL for all requests is http://localhost:8080.
Despensa Endpoints
| Method | Path | Description |
|---|
GET | /api/despensa/{id} | Retrieve a full pantry entity by ID |
GET | /api/despensa/{id}/ingredientes | List all ingredients in a pantry with stock details |
GET | /api/despensa/{id}/stock-bajo?umbral={n} | Get ingredients whose stock is at or below a threshold |
GET | /api/despensa/{id}/estadisticas | Get a summary of inventory health |
POST | /api/despensa/{despensaId}/ingredientes/{ingredienteId} | Add an existing ingredient to a pantry |
DELETE | /api/despensa/{despensaId}/ingredientes/{ingredienteId} | Remove an ingredient from a pantry |
Ingrediente Endpoints
| Method | Path | Description |
|---|
GET | /api/ingredientes | List all ingredients in the system |
POST | /api/ingredientes | Create a new ingredient record |
PUT | /api/ingredientes/{id}/stock?stock={n} | Set the stock level for an ingredient |
Data Shapes
IngredienteDetalleDTO
Returned by the /ingredientes sub-resource endpoint. Provides a lightweight projection of an ingredient tailored for inventory display.
| Field | Type | Description |
|---|
ingredienteId | integer | Unique identifier of the ingredient |
descripcion | string | Human-readable ingredient name (max 100 chars) |
cantidadStock | integer | Current quantity in stock |
DespensaEstadisticas
Returned by the /estadisticas endpoint. Provides a quick health snapshot of the pantry without listing every ingredient individually.
| Field | Type | Description |
|---|
totalIngredientes | integer | Total number of ingredients associated with the pantry |
conStock | integer | Number of ingredients with cantidadStock > 0 (includes low-stock items) |
stockBajo | integer | Number of ingredients with 0 < cantidadStock < 10 (fixed threshold) |
sinStock | integer | Number of ingredients with cantidadStock = 0 |
The stockBajo count in DespensaEstadisticas always uses a hardcoded threshold of 10 units. To query with a custom threshold, use the /stock-bajo?umbral={n} endpoint instead.
Relationship Model
A Despensa has a ManyToOne relationship with Gerente (one manager owns the pantry) and a ManyToMany relationship with Ingrediente through the despensa_ingredientes join table. Adding or removing an ingredient from a pantry only modifies the join table — the Ingrediente record itself is never deleted by pantry operations.