The config endpoint lets operators adjust alert sensitivity live during operation. Changing the threshold immediately re-evaluates every product’sDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/elzackarias/Hackaton3B-Reto1/llms.txt
Use this file to discover all available pages before exploring further.
is_alert flag — there is no need to restart the server or wait for the next detection event.
PUT /api/config/threshold
Updates the fractional alert threshold used byInventoryEngine.set_threshold(). After the update, all 7 products are synchronously re-evaluated: a product’s is_alert is set to true if stock_current ≤ stock_initial × threshold.
New alert threshold as a fraction of
stock_initial. Must be between 0.0 and 1.0 (inclusive). A value of 0.25 means “alert when stock falls to 25% or below of the starting quantity.”Always
"ok" on success.The new threshold value that is now active.
Threshold Interpretation
Withstock_initial = 8, the alert triggers when stock_current ≤ 8 × threshold. Because stock is an integer, effective alert levels are:
| threshold | Alert triggers when… |
|---|---|
0.20 (default) | stock_current ≤ 1.6 → effectively ≤ 1 unit |
0.25 | stock_current ≤ 2.0 → ≤ 2 units |
0.50 | stock_current ≤ 4.0 → ≤ 4 units |
Threshold changes are in-memory only. The value is not persisted to disk and will revert to the default
MIN_THRESHOLD = 0.20 the next time the server process is restarted.GET /dashboard
Returns a standalone HTML operations dashboard page. No frontend build or React app is required — just open the URL in any browser. The dashboard auto-refreshes every 3 seconds by pollingGET /api/analytics and GET /api/restock via fetch.
- KPI grid — total stock, global fill rate, event count, velocity, and active alerts
- Inventory cards — per-product fill rate progress bars color-coded green/yellow/red, with retiro counts and
iventavalues - Restock table — priority-sorted restock recommendations with urgency badges (
CRITICA,MEDIA,BAJA)