-
Notifications
You must be signed in to change notification settings - Fork 209
Description
Uniqueness of fare_product_id
This GitHub issue was raised in response to a discussion in #286, and has been prioritized by MobilityData, who is going to work on it with the agenda described below. MobilityData is trying this format to resolve open issues with GTFS extensions - if you have any feedback regarding this format, please reach out to specifications@mobilitydata.org.
The need
A clear way to model how fare products work for different rider categories (for example: the cost of the same one way ticket, but for adults, seniors, students, etc.).
The issue
No agreement on how this is modeled in fare_products.txt.
Potential options
- Option 1: Make the field
fare_products.fare_product_idunique - so the samefare_product_idcannot be used in more than one record. For this, a differentfare_product_idis required for each instance. For example:
fare_product_id |
rider_category |
amount |
currency |
|---|---|---|---|
| one_way_ticket_adult | adult | 3 | CAD |
| one_way_ticket_senior | senior | 2.5 | CAD |
- Option 2: Make the field
fare_products.fare_product_idnot unique - so that the samefare_product_idcan be used in more than one record. For this, onefare_product_idis required per fare product, however, multiple records with the samefare_product_iddefine the different costs for different rider categories. For example:
fare_product_id |
rider_category |
amount |
currency |
|---|---|---|---|
| one_way_ticket | adult | 3 | CAD |
| one_way_ticket | senior | 2.5 | CAD |
Recommendation:
Even though this will not directly affect the base implementation of GTFS-Fares v2, this affects the future modeling of fare_products.txt. MobilityData recommends Option 2. This serves the following benefits:
- Keeps the data lighter by only requiring one
fare_product_idper fare product - Keeps
fare_leg_rules.txtsignificantly lighter by only requiring one record to define a leg with onefare_product_idinstead of multiple records; each with a differentfare_product_id - Provides the flexibility to enable data producers to produce data with unique
fare_products.fare_product_ids if needed and express the fare legs explicitly infare_leg_rules.txt