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:
- 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.
- 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 flagsmaintenance_urgency: IMMEDIATEon anIssueReport, Backoffice creates a correspondingVehicleInspectionentry.
Consequences β
vehicle_inspectionslives inschema: backoffice. This ADR updates the dispatch board data dependencies table accordingly.issue_reportsgains amaintenance_urgencyfield (NONE,IMMEDIATE,SCHEDULED) for cross-context escalation.VehicleMaintenanceRequireddomain 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
QualificationExpiringandVehicleInspectionOverduenotifications (Backoffice β Communications) for proactive manager alerts.