M2: implement vehicle return vertical slice

Transactional return command with idempotency, row-lock concurrency control, odometer-regression handling, vehicle status derivation, outbox event, audit trail. Result-summary UI on booking detail. 26 backend tests passing, ruff clean. Verified end-to-end via browser against S1 demo scenario; fixed two real defects found only through browser testing (UI state loss on status transition, unflushed UUID default).
This commit is contained in:
NuklearRabbit
2026-08-01 21:49:46 +02:00
parent 03c5b60235
commit 0091c57c7f
14 changed files with 763 additions and 10 deletions
+26
View File
@@ -118,6 +118,32 @@ export interface Dashboard {
recent_automation: AutomationRun[];
}
export interface RegisterReturnRequest {
end_odometer_km: number;
fuel_level_percent: number;
cleanliness_ok: boolean;
damage_reported: boolean;
technical_warning: boolean;
notes?: string;
}
export interface NextBookingRisk {
booking_ref: string;
starts_at: string;
at_risk: boolean;
}
export interface RegisterReturnResult {
booking_ref: string;
vehicle_ref: string;
inspection_ref: string;
resulting_vehicle_status: string;
odometer_regression: boolean;
quality_issue_ref: string | null;
workflow_event_id: string;
next_booking_risk: NextBookingRisk | null;
}
export interface AuditEvent {
id: string;
actor_type: string;