The Pantry Statistics endpoint returns a singleDocumentation 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.
DespensaEstadisticas object that summarises the inventory health of a pantry without listing every ingredient individually. It is designed for dashboards and quick status checks: one HTTP call tells you whether the pantry has any critical shortages (sinStock) or items approaching depletion (stockBajo) alongside the overall item count. All counts are computed server-side from the pantry’s current IngredienteDetalleDTO projection.
Endpoint
Path Parameters
The unique identifier of the pantry for which statistics should be calculated. Must correspond to an existing
Despensa record.Request Example
Response — 200 OK
Returns aDespensaEstadisticas JSON object.
Response Fields
The total number of
Ingrediente records currently associated with this pantry. Equivalent to the length of the array returned by GET /api/despensa/{id}/ingredientes.The number of ingredients whose
cantidadStock is greater than zero. This includes items flagged as stockBajo — an ingredient is counted in conStock as long as at least one unit remains.The number of ingredients with
0 < cantidadStock < 10. These items still have some stock but are approaching depletion under the fixed internal threshold of 10 units.The number of ingredients with
cantidadStock = 0. These items are completely out of stock and need immediate replenishment.Business Logic
The four fields relate to each other as follows:totalIngredientes=conStock+sinStockconStockincludes both fully-stocked ingredients and those flagged asstockBajo- An ingredient counted in
stockBajois also counted inconStock
The
stockBajo field uses a fixed threshold of 10 units (cantidadStock < 10) that is hardcoded in DespensaService. This value cannot be changed via the API. If you need low-stock detection with a custom threshold, use GET /api/despensa/{id}/stock-bajo?umbral={n}, which accepts the threshold as a query parameter at runtime.