Files
parking_solution/wiki/concepts/reporting-analytics.md
julian 8a8e74561d wiki: design the business layer (session, tariff, permit, vision, shift, ops)
Pivot from the hardware/integrity layer to the parking operation. All
wiki-only; no code yet. Core principle throughout: business entities are
projections over the signed append-only event log, never mutable tables.

New concepts: parking-session, tariff (composable/versioned, FX-ready),
shift (manned-only Z-report), capacity-occupancy, validation-discounts,
reporting-analytics, clock-integrity, ticket-encoding, anti-passback.
New entities: permit, opencv-anpr-service, blocklist.
Decisions: session-model, vision-service (host-side ANPR + vehicle
verification; scoped AGPL exception for the isolated service).

Updates: append-only-event-chain (new event types + vision witness),
local-jwt-auth (drop 8h expiry -> until logout; code change pending),
lpr-camera (host-side recognition supersedes edge-AI), standing-decisions
(AGPL exception), open-questions (+FX, +pay-station money corners, backup).

Deferred + flagged: intercom/help-call, receipts/refunds/change, FX engine,
lane topology (#1).
2026-06-15 17:41:38 +02:00

2.3 KiB

type, tags, sources, updated, status
type tags sources updated status
concept
parking
domain
business
reporting
2026-06-15 open

Reporting & Analytics

Turning the signed event log into the numbers an owner runs the business on. All reports are projections over the append-only-event-chain — the chain is the single source, reports are derived and rebuildable, never a separate ledger.

Reports (driven by the events already designed)

  • Revenue — by day/week/shift, by tender (cash vs. card), gross vs. discounts vs. net. Source: payment events + validation-discounts events + shift_z_report (shift).
  • Occupancy — current (capacity-occupancy) and historical curve; peak times; turnover.
  • Stay analytics — average/median duration, distribution; transient vs. permit split.
  • Permit usage — active permits, utilisation, concurrency vs. maxConcurrent.
  • Anomalies — out-of-band opens, never-exited sessions, occupancy drift, over-validation — the anomaly events + reconciliation findings (reconciliation).

Plate / entry search (admin lookup) — user-requested 2026-06-15

The admin can search for an entry/session by licence plate — if the plate was captured (by the opencv-anpr-service or an LPR read; a pure-ticket transient has no plate). Returns the matching session(s): entry/exit times, fee, payment, snapshot image. Useful for disputes ("I was charged for a car that left earlier"), lost-ticket lookup, and incident review.

  • Search keys: plate (when captured), ticket id, session id, time range.
  • Read-only over the chain; surfaces the linked snapshot (lpr-camera imageRef) as evidence.
  • Honest limit: no plate → no plate-search hit. The UI must say "not captured", not "no such car", so the absence isn't mistaken for a missing record.

Properties

  • Offline (offline-first): all computed locally from the local DB; no cloud BI dependency.
  • Reproducible: a report run twice over the same chain gives the same answer; figures trace to signed events.
  • Export for reconciliation / accounting (CSV/PDF) — the periodic external-authority path (open-questions #4).

Open

  • Which reports matter at launch vs. later; the export format/cadence.
  • Dashboard (live) vs. on-demand reports.