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 Low Stock endpoint filters the ingredients of a given pantry and returns only those whose cantidadStock is at or below a caller-supplied threshold. Because the threshold is a request parameter, you can tune the alert level to match your kitchen’s reorder cadence — query conservatively to catch items before they run out, or more aggressively to bulk-order less frequently. An empty array is returned when all ingredients are above the threshold.

Endpoint

GET /api/despensa/{id}/stock-bajo

Parameters

id
integer
required
The unique identifier of the pantry to inspect. Must correspond to an existing Despensa record.
umbral
integer
required
The stock threshold. Any ingredient whose cantidadStock is less than or equal to this value will be included in the response. Must be a non-negative integer.

Request Example

curl "http://localhost:8080/api/despensa/1/stock-bajo?umbral=30"

Response — 200 OK

Returns a JSON array of Ingrediente objects matching the threshold condition. The array may be empty if all pantry ingredients have stock above umbral.
[
  { "id": 12, "descripcion": "Tocino",     "cantidadStock": 30 },
  { "id": 13, "descripcion": "Albahaca",   "cantidadStock": 25 },
  { "id": 14, "descripcion": "Mozzarella", "cantidadStock": 18 }
]

Response Fields

id
integer
Unique identifier of the ingredient.
descripcion
string
Human-readable name of the ingredient (max 100 characters).
cantidadStock
integer
Current stock quantity for this ingredient. Guaranteed to be ≤ the requested umbral.

Threshold vs. Statistics

This endpoint accepts a custom umbral per request, so different clients or dashboards can use different thresholds simultaneously. The stockBajo counter returned by GET /api/despensa/{id}/estadisticas uses a fixed internal threshold of 10 units (cantidadStock < 10) and cannot be changed at runtime. Use this endpoint whenever you need flexible threshold control.
For typical restaurant operations, a threshold of 20–30 units works well as an initial reorder point. Seed data in this project shows ingredient stock levels ranging from the low-20s to 100+, so ?umbral=30 is a good starting value to surface items that need attention without triggering alerts on healthy inventory.

Build docs developers (and LLMs) love