Skip to main content

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

The config endpoint lets operators adjust alert sensitivity live during operation. Changing the threshold immediately re-evaluates every product’s 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 by InventoryEngine.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.
threshold
float
required
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.”
curl -X PUT http://localhost:8000/api/config/threshold \
  -H 'Content-Type: application/json' \
  -d '{"threshold": 0.25}'
status
string
Always "ok" on success.
threshold
float
The new threshold value that is now active.
Example response:
{
  "status": "ok",
  "threshold": 0.25
}

Threshold Interpretation

With stock_initial = 8, the alert triggers when stock_current ≤ 8 × threshold. Because stock is an integer, effective alert levels are:
thresholdAlert triggers when…
0.20 (default)stock_current ≤ 1.6 → effectively ≤ 1 unit
0.25stock_current ≤ 2.0 → ≤ 2 units
0.50stock_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 polling GET /api/analytics and GET /api/restock via fetch.
# Open in your default browser (macOS)
open http://localhost:8000/dashboard

# Or simply navigate to:
# http://localhost:8000/dashboard
The dashboard displays:
  • 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 iventa values
  • Restock table — priority-sorted restock recommendations with urgency badges (CRITICA, MEDIA, BAJA)
Visit http://localhost:8000/dashboard in any browser for an instant operations view — no API client needed. It is especially useful during demos or when the full React frontend is not running.

Build docs developers (and LLMs) love