Skip to content

Commit

Permalink
Update agency vehicle events to include event_type_reason.
Browse files Browse the repository at this point in the history
Note: the initial status of a vehicle during and event update
is prescribed, but not enforced, to allow for asynchronous
processing of updates.
  • Loading branch information
ian-r-rose committed Mar 12, 2019
1 parent 2a1b0ac commit c1740a5
Show file tree
Hide file tree
Showing 5 changed files with 418 additions and 50 deletions.
170 changes: 153 additions & 17 deletions agency/get_vehicle.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,162 @@
"scooter"
]
},
"vehicle_status": {
"$id": "#/definitions/vehicle_status",
"type": "string",
"description": "The status of a vehicle",
"enum": [
"available",
"elsewhere",
"inactive",
"removed",
"reserved",
"unavailable"
]
},
"vehicle_event": {
"$id": "#/definitions/vehicle_event",
"type": "string",
"description": "A status event for a vehicle",
"enum": [
"service_start",
"trip_end",
"maintenance_drop_off",
"cancel_reservation",
"reserve",
"trip_start",
"trip_enter",
"trip_leave",
"register",
"low_battery",
"maintenance",
"service_end",
"rebalance_pick_up",
"rebalance_drop_off",
"deregister"
"oneOf": [
{
"properties": {
"event_type": {
"enum": [
"register"
]
}
}
},
{
"properties": {
"event_type": {
"enum": [
"service_start"
]
}
}
},
{
"properties": {
"event_type": {
"enum": [
"service_end"
]
},
"event_type_reason": {
"enum": [
"low_battery",
"maintenance",
"compliance",
"off_hours"
]
}
}
},
{
"properties": {
"event_type": {
"enum": [
"provider_drop_off"
]
}
}
},
{
"properties": {
"event_type": {
"enum": [
"provider_pick_up"
]
},
"event_type_reason": {
"enum": [
"rebalance",
"maintenance",
"charge",
"compliance"
]
}
}
},
{
"properties": {
"event_type": {
"enum": [
"city_pick_up"
]
}
}
},
{
"properties": {
"event_type": {
"enum": [
"reserve"
]
}
}
},
{
"properties": {
"event_type": {
"enum": [
"cancel_reservation"
]
}
}
},
{
"properties": {
"event_type": {
"enum": [
"trip_start"
]
}
}
},
{
"properties": {
"event_type": {
"enum": [
"trip_enter"
]
}
}
},
{
"properties": {
"event_type": {
"enum": [
"trip_leave"
]
}
}
},
{
"properties": {
"event_type": {
"enum": [
"trip_end"
]
}
}
},
{
"properties": {
"event_type": {
"enum": [
"deregister"
]
},
"event_type_reason": {
"enum": [
"missing"
]
}
}
}
]
},
"timestamp": {
Expand Down Expand Up @@ -146,7 +282,7 @@
"description": "Current vehicle status",
"$ref": "#/definitions/vehicle_status"
},
"event": {
"prev_event": {
"$id": "#/properties/prev_event",
"description": "Last vehicle event",
"$ref": "#/definitions/vehicle_event"
Expand Down
155 changes: 139 additions & 16 deletions agency/post_vehicle_event.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,145 @@
"$id": "#/definitions/vehicle_event",
"type": "string",
"description": "A status event for a vehicle",
"enum": [
"service_start",
"trip_end",
"maintenance_drop_off",
"cancel_reservation",
"reserve",
"trip_start",
"trip_enter",
"trip_leave",
"register",
"low_battery",
"maintenance",
"service_end",
"rebalance_pick_up",
"rebalance_drop_off",
"deregister"
"oneOf": [
{
"properties": {
"event_type": {
"enum": [
"register"
]
}
}
},
{
"properties": {
"event_type": {
"enum": [
"service_start"
]
}
}
},
{
"properties": {
"event_type": {
"enum": [
"service_end"
]
},
"event_type_reason": {
"enum": [
"low_battery",
"maintenance",
"compliance",
"off_hours"
]
}
}
},
{
"properties": {
"event_type": {
"enum": [
"provider_drop_off"
]
}
}
},
{
"properties": {
"event_type": {
"enum": [
"provider_pick_up"
]
},
"event_type_reason": {
"enum": [
"rebalance",
"maintenance",
"charge",
"compliance"
]
}
}
},
{
"properties": {
"event_type": {
"enum": [
"city_pick_up"
]
}
}
},
{
"properties": {
"event_type": {
"enum": [
"reserve"
]
}
}
},
{
"properties": {
"event_type": {
"enum": [
"cancel_reservation"
]
}
}
},
{
"properties": {
"event_type": {
"enum": [
"trip_start"
]
}
}
},
{
"properties": {
"event_type": {
"enum": [
"trip_enter"
]
}
}
},
{
"properties": {
"event_type": {
"enum": [
"trip_leave"
]
}
}
},
{
"properties": {
"event_type": {
"enum": [
"trip_end"
]
}
}
},
{
"properties": {
"event_type": {
"enum": [
"deregister"
]
},
"event_type_reason": {
"enum": [
"missing"
]
}
}
}
]
},
"telemetry": {
Expand Down
2 changes: 1 addition & 1 deletion generate_schema/agency/get_vehicle.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"description": "Current vehicle status",
"$ref": "#/definitions/vehicle_status"
},
"event": {
"prev_event": {
"$id": "#/properties/prev_event",
"description": "Last vehicle event",
"$ref": "#/definitions/vehicle_event"
Expand Down
Loading

0 comments on commit c1740a5

Please sign in to comment.