3 Commits
Author SHA1 Message Date
David Santos 228d97db78 fix(admin-ui): keep dashboard totals from stats summary
Fetch stats summary first and tolerate trend/recurrence failures with Promise.allSettled so KPI totals no longer fall back to the 500-row incidents list cap.
2026-04-10 23:25:40 +00:00
David Santos 5fede9ddd9 fix(admin-ui): derive dashboard KPI row from stats summary aggregates
Top KPI cards used the paginated incidents list, so totals stuck near the API list cap. When operational stats load, sum byProject rollups from GET /v1/stats/summary instead.

Paperclip-Issue: BIT-2202
Paperclip-Run: 4c8f9b0e-4283-4fd7-9c20-f032f14f3719
2026-04-10 23:00:26 +00:00
David Santos de68f68103 feat(admin): operational stats — hourly trends, recurrence, dashboard
Extend GET /v1/stats/trend with granularity=hour (UTC buckets) and granularity=day
response envelope. Enrich GET /v1/stats/summary per-project totals and critical
counts. Add GET /v1/stats/recurrence for top incidents by occurrence volume in
a sliding window. Add index on er_incident_occurrences(occurred_at) for range
queries. Wire admin dashboard to summary, 24h/14d trends, and recurrence table.
Document contract in docs/ADMIN_STATS_API.md.

Paperclip-Agent: Pedro Alves (urlKey pedro-alves; id d706f4e6-5d05-4cec-b6e8-f8fb1f203aae)
Paperclip-Issue: BIT-728
Paperclip-Run: 948904bb-20d7-4d29-9cd7-4c22544f7570
Made-with: Cursor
2026-04-02 11:00:51 +00:00