The Dashboard module exposes a single aggregation endpoint that gives every authenticated user an instant snapshot of store health. The response is computed in real time from live database queries — sales totals, product counts, low-stock alerts, active client count, monthly sales trends, product distribution by category, and pending purchase orders are all returned in one call as nine top-level keys. No date range parameters are required; the service usesDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/interezante456-pixel/Miercoles-Proyecto/llms.txt
Use this file to discover all available pages before exploring further.
LocalDateTime.now() to scope “today” and “this year” queries automatically.
GET /api/dashboard/stats
Returns a map of real-time business KPIs for the current store state.GET http://localhost:8080/api/dashboard/stats
Authorization
Bearer token — accessible by all authenticated roles (
ADMIN, VENDEDOR, ALMACENERO).Response 200 OK
Total monetary amount (sum of
total) for all sales registered today.Cumulative count of all sales ever recorded in the system (including voided).
Total number of active products registered in the catalog.
Total number of active clients registered in the system.
Count of purchase orders currently in
PENDIENTE state — awaiting stock receipt.List of products whose
stockActual is at or below their stockMinimo. Each entry contains:Numeric count of products with stock below minimum — equivalent to
productosStockBajo.length. Useful for badge counters in a UI.Monthly sales totals for the current year, keyed by month number (1–12). Months with no sales are included with a value of
0. Useful for rendering bar charts or trend lines.Product count grouped by category. Each entry contains:
Example response — 200 OK
cURL
Error Codes
| Status | Meaning |
|---|---|
401 Unauthorized | Token missing, invalid, or expired. |
403 Forbidden | Request reached the endpoint without a valid authenticated principal. |