Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconcile more Agency and Provider fields #531

Closed
thekaveman opened this issue Jun 25, 2020 · 5 comments · Fixed by #534
Closed

Reconcile more Agency and Provider fields #531

thekaveman opened this issue Jun 25, 2020 · 5 comments · Fixed by #534
Assignees
Labels
Agency Specific to the Agency API documentation documentation change can be for code and/or markdown pages Provider Specific to the Provider API Schema Implications for JSON Schema or OpenAPI
Milestone

Comments

@thekaveman
Copy link
Collaborator

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
@thekaveman thekaveman added Provider Specific to the Provider API Agency Specific to the Agency API Schema Implications for JSON Schema or OpenAPI documentation documentation change can be for code and/or markdown pages labels Jun 25, 2020
@thekaveman thekaveman added this to the 1.0.0 milestone Jun 25, 2020
@thekaveman thekaveman self-assigned this Jun 25, 2020
@schnuerle
Copy link
Member

If we do this we should make these changes now for the 1.0.0 release. I like all of these changes, and a PR should be made Friday.

Agree, anything with an array type should be plural (eg, the change from propulsion_type to propulsion_types, event_type in status_changes should be event_types, etc), and it's normal practice and how GBFS does it for vehicle_types.

@marie-x
Copy link
Collaborator

marie-x commented Jun 26, 2020

I am strongly in favor

@schnuerle schnuerle linked a pull request Jun 26, 2020 that will close this issue
@Retzoh
Copy link
Contributor

Retzoh commented Jun 29, 2020

👍 to this !

@jfh01
Copy link
Contributor

jfh01 commented Jun 29, 2020

Makes sense to me. @Karcass should we notify the reconciliation temp WG about this?

@schnuerle
Copy link
Member

I notified the email list earlier today, and now this PR is merged and done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Agency Specific to the Agency API documentation documentation change can be for code and/or markdown pages Provider Specific to the Provider API Schema Implications for JSON Schema or OpenAPI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants