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.

These endpoints expose the InventoryEngine state via HTTP. The engine maintains a thread-safe in-memory store for all 7 shelf products, applying business logic (stock decrements, alert thresholds, event deduplication) before surfacing data through these routes. Every response reflects the most current state at request time.

GET /api/health

Returns the server’s operational status and how many seconds it has been running since startup.
curl http://localhost:8000/api/health
status
string
Always "ok" when the server is running.
uptime
float
Seconds elapsed since the server process started.
{
  "status": "ok",
  "uptime": 142.37
}

GET /api/inventory

Returns the complete InventoryState for all 7 products currently tracked on the shelf.
curl http://localhost:8000/api/inventory
last_updated
string
ISO 8601 timestamp of when the state snapshot was taken.
products
array
Array of ProductStock objects, one per SKU. See fields below.

ProductStock Object

sku_id
string
Unique machine-readable identifier for the product (e.g., "nachos_naturasol").
sku_name
string
Human-readable product name (e.g., "Nachos Con Sal Naturasol 200gr").
slot_id
integer
Physical shelf slot number (1–7).
stock_initial
integer
Starting stock level. Always 8 unless overridden at engine initialization.
stock_current
integer
Current stock units remaining on the shelf (0–stock_initial).
stock_min_threshold
float
Alert threshold as a fraction of stock_initial (default 0.20). An alert fires when stock_current ≤ stock_initial × stock_min_threshold.
is_alert
boolean
true when the product is at or below the alert threshold.
last_event
string | null
ISO 8601 timestamp of the most recent event for this SKU, or null if no events have occurred yet.
Example response (one product shown):
{
  "last_updated": "2024-11-15T10:32:05.123456",
  "products": [
    {
      "sku_id": "nachos_naturasol",
      "sku_name": "Nachos Con Sal Naturasol 200gr",
      "slot_id": 4,
      "stock_initial": 8,
      "stock_current": 5,
      "stock_min_threshold": 0.2,
      "is_alert": false,
      "last_event": "2024-11-15T10:28:41.009123"
    }
  ]
}

GET /api/inventory/

Returns the ProductStock for a single SKU. Returns HTTP 404 if the SKU does not exist.
sku_id
string
required
The unique SKU identifier. Valid values are:
sku_idProduct
agua_burstAgua Natural Burst 1500ml
burst_energetica_rojaBebida Energetica Red Burst 473ml
burst_energyBebida Energetica Original Burst Energy 600ml
nachos_naturasolNachos Con Sal Naturasol 200gr
nebraska_mangoBebida Mango-Durazno Nebraska 460ml
sisi_colaRefresco Cola Sin Azucar Sisi 355ml
sun_paradise_naranjaBebida Naranja Sun Paradise 900ml
curl http://localhost:8000/api/inventory/burst_energy
200 — Success:
{
  "sku_id": "burst_energy",
  "sku_name": "Bebida Energetica Original Burst Energy 600ml",
  "slot_id": 3,
  "stock_initial": 8,
  "stock_current": 8,
  "stock_min_threshold": 0.2,
  "is_alert": false,
  "last_event": null
}
404 — SKU not found:
{
  "detail": "SKU 'unknown_sku' no encontrado"
}

POST /api/inventory/reset

Resets all 7 products to their initial stock level (stock_current = 8), clears all recorded events, clears the HeatmapEngine data, and clears all NarrativeEngine messages. Useful for resetting state between demos or test runs.
curl -X POST http://localhost:8000/api/inventory/reset
status
string
Always "ok" on success.
message
string
Human-readable confirmation string.
{
  "status": "ok",
  "message": "Inventario reseteado a stock inicial"
}
This operation is irreversible. All event history, heatmap data, and narrative messages accumulated since the last reset are permanently discarded from memory.

Build docs developers (and LLMs) love