Busflow Docs

Internal documentation portal

Skip to content

ADR-008: Vehicle Maintenance Schema Ownership ​

Status: βœ… Accepted Date: 2026-04-09 Triggered by: Level 2 Audit β€” Crew & Fleet Management (Findings M1, M2)

Context ​

The Level 2 Audit identified vehicle maintenance tracking as a High-priority gap in PRODUCT_schema-feature-gaps.md Β§1. Two types of maintenance exist in DACH bus operations:

  1. Scheduled regulatory inspections β€” HU (Hauptuntersuchung), SP (SicherheitsprΓΌfung), tachograph calibration, UVV. These are known in advance, tied to the vehicle's lifecycle, and determine whether a vehicle is legally roadworthy.
  2. Unscheduled field issues β€” Mechanical problems discovered during operation (cracked mirror, engine warning light). Drivers report these via IssueReport (Operations).

The feature gaps document places maintenance in "Operations / Backoffice" without resolving ownership. The dispatch board spec (dispatch-board.md) initially listed vehicle_inspections under the Operations schema.

Decision ​

Split ownership based on data lifecycle:

  • Backoffice owns vehicle_inspections β€” scheduled regulatory deadlines are master data tied to the vehicle's identity and lifecycle. Dispatchers manage these as part of fleet administration.
  • Operations owns issue_reports (already exists) β€” unscheduled field maintenance stays in the execution layer where drivers create it.
  • A cross-context domain event VehicleMaintenanceRequired (Operations β†’ Backoffice) bridges the gap: when a driver flags maintenance_urgency: IMMEDIATE on an IssueReport, Backoffice creates a corresponding VehicleInspection entry.

Consequences ​

  • vehicle_inspections lives in schema: backoffice. This ADR updates the dispatch board data dependencies table accordingly.
  • issue_reports gains a maintenance_urgency field (NONE, IMMEDIATE, SCHEDULED) for cross-context escalation.
  • VehicleMaintenanceRequired domain event added to the context map (Operations β†’ Backoffice).
  • Safety-critical overdue inspections (HU, SP) automatically set blocks_dispatch = true, making them hard dispatch blocks (not just warnings).
  • Hasura scheduled triggers drive QualificationExpiring and VehicleInspectionOverdue notifications (Backoffice β†’ Communications) for proactive manager alerts.

Internal documentation β€” Busflow