From 5c8966a4914124a4ec74f31b6542d2a362044aaa Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Mon, 24 Apr 2023 17:31:43 -0700 Subject: [PATCH] refactor(event): transitions for passenger-services --- models/modes/passenger-services/event.yaml | 122 +++++++++++++++------ 1 file changed, 86 insertions(+), 36 deletions(-) diff --git a/models/modes/passenger-services/event.yaml b/models/modes/passenger-services/event.yaml index 5876f8c..c7f3702 100644 --- a/models/modes/passenger-services/event.yaml +++ b/models/modes/passenger-services/event.yaml @@ -5,42 +5,92 @@ type: object x-stoplight: id: diqnymt2vyq3m -properties: - vehicle_state: - description: The state of the vehicle. - enum: - - removed - - available - - non_operational - - reserved - - on_trip - - stopped - - non_contactable - - elsewhere - - event_types: - description: Vehicle event types for state change. - items: - type: string - enum: - - comms_lost - - comms_restored - - driver_cancellation - - maintenance - - maintenance_end - - maintenance_pick_up - - passenger_cancellation - - provider_cancellation - - reservation_start - - reservation_stop - - service_end - - service_start - - trip_end - - trip_enter_jurisdiction - - trip_leave_jurisdiction - - trip_resume - - trip_start - - trip_stop +oneOf: + - title: vehicle_state - removed + properties: + vehicle_state: + const: removed + event_types: + items: + enum: + - comms_restored + - decommissioned + - maintenance_pick_up + - title: vehicle_state - available + properties: + vehicle_state: + const: available + event_types: + items: + enum: + - comms_restored + - driver_cancellation + - passenger_cancellation + - provider_cancellation + - service_start + - trip_end + - trip_enter_jurisdiction + - title: vehicle_state - non_operational + properties: + vehicle_state: + const: non_operational + event_types: + items: + enum: + - comms_restored + - maintenance + - maintenance_end + - recommissioned + - service_end + - trip_enter_jurisdiction + - title: vehicle_state - reserved + properties: + vehicle_state: + const: reserved + event_types: + items: + enum: + - comms_restored + - reservation_start + - trip_enter_jurisdiction + - title: vehicle_state - on_trip + properties: + vehicle_state: + const: on_trip + event_types: + items: + enum: + - comms_restored + - trip_enter_jurisdiction + - trip_resume + - trip_start + - title: vehicle_state - non_contactable + properties: + vehicle_state: + const: non_contactable + event_types: + items: + enum: + - comms_lost + - title: vehicle_state - stopped + properties: + vehicle_state: + const: stopped + event_types: + items: + enum: + - comms_restored + - reservation_stop + - trip_stop + - title: vehicle_state - elsewhere + properties: + vehicle_state: + const: elsewhere + event_types: + items: + enum: + - comms_restored + - trip_leave_jurisdiction if: properties: