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 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

MethodPathDescription
GET/api/despensa/{id}Retrieve a full pantry entity by ID
GET/api/despensa/{id}/ingredientesList 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}/estadisticasGet 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

MethodPathDescription
GET/api/ingredientesList all ingredients in the system
POST/api/ingredientesCreate 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.
FieldTypeDescription
ingredienteIdintegerUnique identifier of the ingredient
descripcionstringHuman-readable ingredient name (max 100 chars)
cantidadStockintegerCurrent quantity in stock

DespensaEstadisticas

Returned by the /estadisticas endpoint. Provides a quick health snapshot of the pantry without listing every ingredient individually.
FieldTypeDescription
totalIngredientesintegerTotal number of ingredients associated with the pantry
conStockintegerNumber of ingredients with cantidadStock > 0 (includes low-stock items)
stockBajointegerNumber of ingredients with 0 < cantidadStock < 10 (fixed threshold)
sinStockintegerNumber 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.

Build docs developers (and LLMs) love