Analytics & Utilization (PL-T199)
En resumen
The operations-analytics console for chain venues. Per-resource revenue, occupancy heatmap, no-show trend KPI, 7×24 peak-time grid, conversion funnel from public visit to paid booking with session-de-dupe, customer cohorts (repeat vs first-time), and PDF/CSV/XLSX export. Backed by pre-computed AnalyticsRollup buckets (hourly/daily/monthly cron jobs) plus an in-memory live-delta layer on top of the latest hourly bucket so today's KPIs include the last few minutes.
Cómo funciona
Behind the dashboard is an AnalyticsRollup model that pre-aggregates bookings, revenue, no-shows, customer cohorts, and funnel events into day / week / month buckets with idempotent upserts so re-runs are safe. Three cron jobs maintain it: analytics_rollup_hourly recomputes the current hour's bucket, _daily closes the previous day at midnight, and _monthly_close finalizes the previous month on the 1st. On read, the dashboard's compute_rollup function adds an in-memory live-delta on top of the latest hourly rollup so today's KPIs include the last few minutes' activity without waiting for the next cron run.
The endpoints — GET /chain/analytics/dashboard / utilization / revenue / customers / conversion / heatmap and POST /chain/analytics/export — are gated by chain.analytics.read and chain.analytics.export capabilities so a viewer role can browse but not export. The dashboard surfaces KPIs (revenue, AOV, no_show_rate, NPS, utilization) plus drill-down views: AnalyticsUtilization with per-resource occupancy, AnalyticsRevenue with group_by=resource_type or color_type, AnalyticsHeatmap for the 7×24 ISO-week peak-time grid, ConversionFunnel reading BookingFunnelEvent rows (unique-session-deduped) for visit → wizard → submit → paid drop-off, and CustomerCohortChart for repeat-vs-first-time analysis. Exports under 92 days run synchronously; longer ranges queue to a background job and email the operator when the file is ready.
The PDF export uses a templated monthly-report layout that managers can attach straight to a board pack.
Capacidades clave
- Per-resource revenue dashboard + occupancy rate + no-show trend
- Peak-time heatmap (7×24 ISO-week) + conversion funnel + customer cohorts
- PDF / CSV / XLSX export (sync ≤ 92 days, async beyond)
- Pre-computed AnalyticsRollup (day/week/month) with idempotent upsert
- BookingFunnelEvent with unique-session-de-dupe + hourly/daily/monthly cron
- Live-delta in-memory compute on top of latest hourly rollup
- Capability gating (chain.analytics.read + chain.analytics.export)
En la práctica
Monday morning the operations director opens the analytics dashboard. The KPI strip shows revenue 412k SEK MTD (+18% vs prior month), no-show rate 3.1% (down from 4.4%), utilization 62%. They drill into the heatmap and see Wednesday lunch is at 22% — well below the 50% target — and Saturday 20:00 is consistently full.
They open the conversion funnel: 18,000 visits → 4,200 wizard starts → 2,800 submitted → 2,650 paid; the wizard-to-submit drop is 33%, mostly on the time-picker step. They cross-reference utilization and confirm the cause is unavailable peak slots. Action plan: enable wait-list (already on) and run a Wednesday-lunch promotion via marketing automation.
They export the month as PDF and email it to the board.
Funcionalidades de este subsistema
12| ID | Status | Funcionalidades |
|---|---|---|
| F22.17.01 | Entregado | Per-resource revenue dashboard (GET /chain/analytics/revenue med group_by=resource_type + RevenueChart) ✅ |
| F22.17.02 | Entregado | Occupancy rate per resource (GET /chain/analytics/utilization + AnalyticsUtilization-vy) ✅ |
| F22.17.03 | Entregado | No-show rate trend (KPI på AnalyticsDashboard, AnalyticsMetrics.no_show_rate) ✅ |
| F22.17.04 | Entregado | Peak-time heatmap (GET /chain/analytics/heatmap + UtilizationHeatmap-komponent, 7×24 ISO-vecka) ✅ |
| F22.17.05 | Entregado | Conversion funnel (visit → booking) (GET /chain/analytics/conversion + ConversionFunnel-komponent) ✅ |
| F22.17.06 | Entregado | Customer cohorts (repeat vs first-time) (GET /chain/analytics/customers + CustomerCohortChart) ✅ |
| F22.17.07 | Entregado | PDF monthly report export (POST /chain/analytics/export med format=pdf/csv/xlsx, sync ≤ 92 dagar) ✅ |
| F22.17.08 | Entregado | Pre-computed AnalyticsRollup (day/week/month) + idempotent upsert ✅ |
| F22.17.09 | Entregado | BookingFunnelEvent + unique session-de-dupe + _aggregate_funnel ✅ |
| F22.17.10 | Entregado | analytics_rollup_hourly / _daily / _monthly_close cron-jobb ✅ |
| F22.17.11 | Entregado | Live-delta för dagens bucket (in-memory compute_rollup ovanpå hourly-rollup) ✅ |
| F22.17.12 | Entregado | Capability-gating (chain.analytics.read + chain.analytics.export) ✅ |
Subsistemas relacionados
Partes interesadas que necesitan este subsistema
Aparece en 1 análisis de partes interesadas