Analytics endpoints aggregate the liveDocumentation 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.
InventoryEngine state into actionable KPIs and restock guidance. All values are computed on-demand from the in-memory event log and current stock levels — there is no caching layer, so every response reflects the exact state at request time.
GET /api/analytics
Returns a live KPI snapshot of the entire shelf: capacity utilization, event throughput, active alerts, and per-product fill rates.Top-level Response Fields
ISO 8601 datetime when this analytics snapshot was generated.
Sum of all
stock_initial values across the 7 products (stock_initial × 7, typically 56).Sum of
stock_current across all 7 products.Global shelf fill rate:
total_current / total_capacity, rounded to 2 decimal places. Range 0.0–1.0.Total number of events (retiros + devoluciones) recorded since the last reset.
Rolling event throughput in events per minute, computed from the span between the first and last recorded events. Returns
0.0 if fewer than 2 events exist.Number of products currently in alert state (
is_alert = true).sku_id of the product with the highest number of retiro events. null if no events yet.sku_id of the product with the fewest retiro events. null if no events yet.Per-product breakdown. See sub-fields below.
Product Analytics Object (within products array)
Unique SKU identifier.
Human-readable product name.
Current units on the shelf.
Initial stock level (always
8).Per-product fill rate:
stock_current / stock_initial, rounded to 2 decimal places.Total number of
retiro events recorded for this SKU since the last reset.Internal sales velocity index from the product catalog. Higher values indicate faster-selling products (e.g.,
nachos_naturasol = 22, agua_burst = 6).GET /api/restock
Returns a restock priority list for all products that are not at full stock, sorted bypriority_score in descending order (most urgent first). If all products are fully stocked, the response is an empty array.
Priority Score Formula
iventa (fast sellers) and low fill_rate (nearly empty) rank highest.
Response Fields (per item)
Unique SKU identifier.
Human-readable product name.
Physical shelf slot number (1–7).
Current units remaining on the shelf.
Target stock level (always
8).Units needed to reach full stock:
stock_initial - stock_current.Current fill rate:
stock_current / stock_initial, rounded to 2 decimal places.Internal sales velocity index from the product catalog.
Computed restock urgency score. Higher = more urgent.
true when the product has crossed the alert threshold.Human-readable urgency tier:
"CRITICA"— product is in alert state (is_alert = true)"MEDIA"— fill rate is 50% or below (fill_rate ≤ 0.5)"BAJA"— fill rate is above 50%
Products at full stock (
units_missing = 0) are excluded from the response entirely. An empty array [] means all 7 products are fully stocked.