The HDB Service dashboard gives operators an at-a-glance view of the entire water dispenser fleet. It aggregates live data from tickets, dispensers, stock entries, and maintenance schedules into a set of purpose-built endpoints. All metrics are automatically scoped to the authenticated user’s accessible plants and clients, so field technicians, client contacts, and company administrators each see a tailored picture without any manual filtering. The dashboard is accessible to every role in the system via theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/GianlucaBessone/HDB-Service/llms.txt
Use this file to discover all available pages before exploring further.
dashboard:read permission.
Summary stats
Response shape
Basic info about the authenticated user.
Ticket volume and SLA health.
Real-time fleet status breakdown.
Low-stock alert count.
Maintenance schedule health.
Analytics
clientId, plantId, sectorId, and dispenserId as optional query filters to progressively narrow the scope.
The response includes three top-level objects:
Aggregated time-based KPIs.
Failure pattern analysis derived from maintenance checklist
fallas arrays.Dispenser health scoring.
getDataFilter, and CLIENT_RESPONSIBLE users are further restricted to their own client’s data.
Performance metrics
clientId, plantId, and an optional failureName filter to isolate trends caused by a specific failure type.
Same
sla, mttr, and mtbf aggregates as the analytics endpoint, but computed exclusively over the filtered data set.Top 10 failure types sorted by count, each with
name, count, avgRepairTime, and severity.Six monthly data points (oldest to newest). Each entry has a
month label (e.g., "Jan 2025"), an average sla in hours, and an average mttr in hours for that calendar month.Fleet health
clientId or plantId are supported.
The health score (0–100) is computed by calculateDispenserHealth using a weighted algorithm:
| Factor | Weight | Target |
|---|---|---|
| MTBF (months between failures) | 30% | ≥ 6 months |
| MTTR (hours to repair) | 20% | ≤ 48 hours (score reaches 0 at 48 h) |
| Maintenance condition rating | 20% | GOOD |
| Failure recurrence (last 6 months) | 15% | 0 recurrences (−20 pts each; zero at 5+) |
| Lifecycle progress consumed | 15% | Near 0% |
ÓPTIMO
Score > 80 — healthy, low failure rate, within expected lifecycle.
ESTABLE
Score 50–80 — acceptable condition, monitor for deterioration.
CRÍTICO
Score < 50 — high failure rate, poor condition, or near end of lifecycle.
All dispensers in scope, sorted ascending by score (most critical first). Each entry includes
id, marca, modelo, serial, planta, score, status, and a details block with raw mtbfDays, mtbfMonths, mttrHours, recurrences, condition, progress, ownerPlantId, and currentPlantId values.Aggregate counts:
optimo, estable, and critico.6-month score trend for the fleet’s global average health score.
PDF reports
@react-pdf/renderer. The response is a binary PDF stream with Content-Type: application/pdf.
Request body:
type value | Report content |
|---|---|
performance | SLA, MTTR, MTBF KPIs with metric definitions |
salud | Dispenser health distribution and top-10 ranking |
- A header with the report title and generation date, plus the active filters.
- A metrics section showing the current KPI values.
- For
saludreports: a ranking table of the worst-scoring dispensers with MTBF detail. - A metric definitions section explaining SLA, MTTR, MTBF, and (for health reports) the scoring algorithm.
The PDF endpoint is a
POST request — it expects the already-fetched analytics data in the request body so it can render the report without making additional database queries.Role-based data scoping
Every dashboard endpoint applies automatic data filters based on the authenticated user’s role using thegetDataFilter utility:
| Role | Data scope |
|---|---|
ADMIN | All clients and plants in the system. |
SUPERVISOR | All clients and plants in the system. |
TECHNICIAN | Only tickets assigned to them (assignedToId). |
CLIENT_RESPONSIBLE | All plants and dispensers belonging to their clientId. |
CLIENT_REQUESTER | Only tickets they reported, scoped to their UserPlantAccess plant list. |
plantId that falls outside the user’s access scope returns 403 — Acceso denegado a esta planta.