Skip to content

Reconcile more Agency and Provider fields #531

@thekaveman

Description

@thekaveman

Is your feature request related to a problem? Please describe.

This is a follow-up item from #506 and related to the work for #526.

In updating the JSON Schemas for the Reconciliation work in #506, it has become apparent that there are more areas of Agency and Provider that "almost" overlap. Since we're taking this opportunity in 1.0.0 to introduce breaking changes to the state machine, I propose the following additional breaking changes to a few additional fields. These will allow for more reuse in the schema generation process and generally further improve alignment between Agency and Provider.

Describe the solution you'd like

1. Vehicle model

Agency GET /vehicles and POST /vehicles uses the following fields to model a vehicle (omitting some for brevity):

provider_id
device_id
vehicle_id
type
propulsion

While in all of the Provider endpoints, the vehicle model looks like:

provider_id
device_id
vehicle_id
vehicle_type
propulsion_type

Proposal: rename Agency fields type and propulsion to match their Provider corollaries. The field propulsion_type will be renamed to propulsion_types to more clearly indicate that it allows an array of values.

2. Conditional Trip references

In Agency POST /vehicles/{device_id}/event we have the field trip_id:

trip_id: UUID provided by Operator to uniquely identify the trip. Required for trip_start, trip_end, trip_enter_jurisdiction, and trip_leave_jurisdiction event types

And in Provider /status_changes we have the field associated_trip:

associated_trip: Trip UUID (foreign key to Trips API), required if event_type is trip_start or trip_end, or for any other status change event that marks the end of a trip.

Proposal: rename Provider associated_trip to trip_id to align with Agency, and add the event trip_cancel to the list of event_types that make this trip reference required in either case.

Is this a breaking change

  • Yes, breaking

Impacted Spec

For which spec is this feature being requested?

  • agency
  • provider

Metadata

Metadata

Assignees

Labels

AgencySpecific to the Agency APIProviderSpecific to the Provider APISchemaImplications for JSON Schema or OpenAPIdocumentationdocumentation change can be for code and/or markdown pages

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions