Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/DragonesMagicos/ferromax_v0.8/llms.txt

Use this file to discover all available pages before exploring further.

The Dashboard API provides aggregated business metrics and stock alert management for the Ferromax ERP back-office. Every endpoint in this group is restricted to the ADMIN role — requests authenticated with an EMPLEADO or CLIENTE token will receive 403 Forbidden. All dates and timestamps are serialized in ISO 8601 format using the America/Argentina/Buenos_Aires timezone.

KPI Summary

GET /api/dashboard/resumen

Returns a snapshot of the key business indicators computed for the current calendar day (midnight → midnight, Argentine time). Authentication: Bearer JWT — ADMIN role required.
ventasHoy
number (BigDecimal)
Total revenue from completed sales today, in ARS.
cantidadVentasHoy
integer
Number of completed sale transactions processed today.
productosStockCritico
integer
Count of active products whose current stock is at or below their configured minimum threshold.
pedidosPendientes
integer
Number of customer orders currently in PENDIENTE or CONFIRMADO state.
saldoCaja
number (BigDecimal)
Cash-only revenue for today — sum of completed sales paid with EFECTIVO.
curl -X GET http://localhost:8081/api/dashboard/resumen \
  -H "Authorization: Bearer <ADMIN_TOKEN>"
{
  "ventasHoy": 154320.50,
  "cantidadVentasHoy": 23,
  "productosStockCritico": 4,
  "pedidosPendientes": 7,
  "saldoCaja": 89200.00
}

7-Day Sales Chart

GET /api/dashboard/ventas-semana

Returns daily sales totals for the last 7 days, ordered from oldest to most recent (day −6 → today). Each entry represents one full calendar day in Argentine time. Days with no completed sales return null for total. Authentication: Bearer JWT — ADMIN role required.
[]
array of VentaDiariaDTO
Ordered array of 7 objects, one per day.
[].fecha
string (LocalDate, ISO 8601)
The calendar date for this entry, e.g. "2024-06-10".
[].total
number (BigDecimal) | null
Total revenue from completed sales on this date. null if no sales were recorded.
curl -X GET http://localhost:8081/api/dashboard/ventas-semana \
  -H "Authorization: Bearer <ADMIN_TOKEN>"
[
  { "fecha": "2024-06-04", "total": 98400.00 },
  { "fecha": "2024-06-05", "total": 112750.50 },
  { "fecha": "2024-06-06", "total": null },
  { "fecha": "2024-06-07", "total": null },
  { "fecha": "2024-06-08", "total": 203100.75 },
  { "fecha": "2024-06-09", "total": 177600.00 },
  { "fecha": "2024-06-10", "total": 154320.50 }
]
Weekends with no activity return null for total rather than 0. Chart components should treat null as zero when rendering.

Recent Transactions

GET /api/dashboard/transacciones

Returns the 10 most recent sale records, regardless of status, ordered by date descending. Used to populate the “Últimas Transacciones” table on the dashboard home page. Authentication: Bearer JWT — ADMIN role required.
[]
array of VentaResponse
Array of up to 10 sale records.
[].id
integer (Long)
Unique sale identifier.
[].fecha
string (OffsetDateTime, ISO 8601)
Timestamp when the sale was created, including UTC offset, e.g. "2024-06-10T14:23:05-03:00".
[].total
number (BigDecimal)
Total monetary value of the sale.
[].estado
string
Sale status. One of: COMPLETADA, ANULADA, PENDIENTE.
[].medioPago
string
Payment method. One of: EFECTIVO, DEBITO, CREDITO, MERCADOPAGO.
[].nombreCajero
string
Full name (nombre + apellido) of the employee who processed the sale.
[].cantidadItems
integer
Number of distinct line items in the sale.
[].origen
string
Sale origin channel. One of: POS (in-store sale by an ADMIN or EMPLEADO), WEB (online order by a CLIENTE).
curl -X GET http://localhost:8081/api/dashboard/transacciones \
  -H "Authorization: Bearer <ADMIN_TOKEN>"
[
  {
    "id": 1042,
    "fecha": "2024-06-10T14:23:05-03:00",
    "total": 8750.00,
    "estado": "COMPLETADA",
    "medioPago": "EFECTIVO",
    "nombreCajero": "Laura Gómez",
    "cantidadItems": 3,
    "origen": "POS"
  },
  {
    "id": 1041,
    "fecha": "2024-06-10T13:55:30-03:00",
    "total": 23400.50,
    "estado": "COMPLETADA",
    "medioPago": "MERCADOPAGO",
    "nombreCajero": "Carlos Ferreyra",
    "cantidadItems": 7,
    "origen": "WEB"
  }
]

Stock Alerts

Stock alerts are generated automatically when a product’s stockActual falls to or below its stockMinimo. The following endpoints allow admins to monitor and dismiss these alerts.

GET /api/alertas

Returns all unread stock alerts. This is the count reflected in the badge on the dashboard sidebar. Authentication: Bearer JWT — ADMIN role required.
[]
array of AlertaStockDTO
Array of unread alert objects. Empty array [] if no unread alerts exist.
[].id
integer (Long)
Unique alert identifier.
[].nombreProducto
string
Display name of the product that triggered the alert.
[].stockActual
integer
The product’s stock level at the time the alert was generated.
[].stockMinimo
integer
The configured minimum stock threshold for this product.
[].tipoAlerta
string
Alert severity. "SIN_STOCK" when stockActual is 0; "STOCK_BAJO" otherwise.
[].fechaGeneracion
string (OffsetDateTime, ISO 8601)
Timestamp when the alert was created.
[].lida
boolean
false for all results returned by this endpoint (by definition, only unread alerts are returned).
curl -X GET http://localhost:8081/api/alertas \
  -H "Authorization: Bearer <ADMIN_TOKEN>"
[
  {
    "id": 87,
    "nombreProducto": "Taladro Bosch 500W",
    "stockActual": 0,
    "stockMinimo": 3,
    "tipoAlerta": "SIN_STOCK",
    "fechaGeneracion": "2024-06-10T11:42:00-03:00",
    "lida": false
  },
  {
    "id": 91,
    "nombreProducto": "Amoladora Dewalt 750W",
    "stockActual": 2,
    "stockMinimo": 5,
    "tipoAlerta": "STOCK_BAJO",
    "fechaGeneracion": "2024-06-10T14:05:22-03:00",
    "lida": false
  }
]

GET /api/alertas/todas

Returns all stock alerts created within the last 30 days, both read and unread. Used by the alert history panel. Authentication: Bearer JWT — ADMIN role required. Response shape is identical to GET /api/alertas. The lida field will be true for previously dismissed alerts.
curl -X GET http://localhost:8081/api/alertas/todas \
  -H "Authorization: Bearer <ADMIN_TOKEN>"

PUT /api/alertas//leer

Marks a single stock alert as read. The frontend AlertaStockPanel calls this when the admin clicks the checkmark button on an individual alert card. Authentication: Bearer JWT — ADMIN role required.
id
integer (Long)
required
The numeric ID of the alert to mark as read.
Returns the updated AlertaStockDTO with lida: true.
curl -X PUT http://localhost:8081/api/alertas/87/leer \
  -H "Authorization: Bearer <ADMIN_TOKEN>"
{
  "id": 87,
  "nombreProducto": "Taladro Bosch 500W",
  "stockActual": 0,
  "stockMinimo": 3,
  "tipoAlerta": "SIN_STOCK",
  "fechaGeneracion": "2024-06-10T11:42:00-03:00",
  "lida": true
}
Returns 404 Not Found if the given id does not correspond to an existing alert.

PUT /api/alertas/leer-todas

Marks all currently unread alerts as read in a single operation. Returns a count of how many alerts were updated. Authentication: Bearer JWT — ADMIN role required.
marcadas
integer
The number of alerts that were transitioned from unread to read. 0 if there were no unread alerts.
curl -X PUT http://localhost:8081/api/alertas/leer-todas \
  -H "Authorization: Bearer <ADMIN_TOKEN>"
{
  "marcadas": 5
}

Build docs developers (and LLMs) love