feat(analytics): statistics period summary KPIs #83
Labels
No labels
blocked
bug
enhancement
high-priority
low-priority
needs-info
needs-triage
ready-for-agent
ready-for-human
referenced
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gabogg/hikcentral#83
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Route
GET /api/statistics/periods/{granularity}/{start}/summaryReturns the KPI strip for one closed period, including the comparisons the deck shows.
Fields needed by the mockup
nullwith a reason when its reference period has no data.Context
Part of the statistics deck redesign, draft RFC in #80 (
docs/architecture/rfc-statistics-deck-display-model.md; mockup linked there). Period selection was decided in #81 (closed): a period is identified bygranularity(day/week/month) and its first business day; see the glossary terms Complete Period and Partial Period. A year period is out of scope.Shared constraints (all statistics-deck routes)
daily_reset_timeboundaries,app/facility_time.py); an in-progress cycle is never returned._COUNTED_CAMERA_JOIN/_COUNTED_CAMERA_FILTER); quarantined events never do.require_auth). Deck routes live in a separate/api/statistics/router so admin-only/api/analytics/routes can't leak into the deck.analytics_service, SQL in repositories.Triage decisions (2026-09-24)
GET /api/statistics/periods/{granularity}/{start}/summary.nullplus a reason code (for exampleNO_DATA_PREVIOUS_PERIOD); the deck shows "—" with the reason. Last-year comparisons are omitted when last year has no data.covered_days/business_days.Implemented by #92, merged into
masterascf20ef2after two review passes (Standards + Spec). Non-blocking follow-ups are tracked in #96–#100. Closing; this unblocks #80.🤖 Generated with Claude Code