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

[GTFS Fares v2] Add rider_categories.txt #511

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tzujenchanmbd
Copy link
Collaborator

@tzujenchanmbd tzujenchanmbd commented Oct 16, 2024

The rider_categories.txt file is part of the GTFS-Fares v2 proposal, aimed at modeling rider categories that are eligible for certain fares.

In the August and September meetings, the working group reached the following consensus:

  • rider_category_id will be referenced in fare_products.txt
  • Not include min_age and max_age fields for now
  • Add a field to indicate the default rider category

Changes in this PR

  • Add rider_categories.txt file
  • Add fare_products.rider_category_id field and update the primary key of fare_products.txt
  • Add content to the description of fare_product_id

For previous discussions please see the working group meeting note
Comments and questions welcome!

Side note: Currently the fares working group is primarily discussing fare use cases. However, in the future this file may be used for use cases such as service eligibility.

@tzujenchanmbd tzujenchanmbd added Extension: GTFS-Fares Issues and Pull Requests that focus on GTFS-Fares Extension Change: Addition New function proposed to the specification. Support: Needs Review Needs support to review proposal. labels Oct 16, 2024
@tzujenchanmbd tzujenchanmbd linked an issue Oct 16, 2024 that may be closed by this pull request
| ------ | ------ | ------ | ------ |
| `rider_category_id` | Unique ID | **Required** | Identifies a rider category. |
| `rider_category_name` | Text | **Required** | Rider category name as displayed to the rider. |
| `is_default_fare_category` | Enum | **Required** | Specifies if an entry in [rider_categories.txt](#rider_categoriestxt) should be considered the default category (i.e. the main category that should be displayed to riders). For example: Adult fare, Regular fare, etc. Valid options are:<br><br>`0` or empty - Category is not considered the default.<br>`1` - Category is considered the default one.<br><br>When multiple rider categories are eligible for a single fare product specified by a `fare_product_id`, there must be only one of these rider categories indicated as the default rider category (`is_default_fare_category = 1`). |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be a bit clearer (as well as in the definition for fare_products.rider_category_id), should it be "there must be at most one" or "there must be exactly one"? In other words, should it be permissible to not have any categories as is_default_fare_category = 1?

Copy link
Collaborator Author

@tzujenchanmbd tzujenchanmbd Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the idea is that multiple entries in rider_categories.txt may have is_default_fare_category = 1. However, when a fare_product_id in fare_products.txt references multiple rider_category_ids, exactly one of these referenced rider_category_ids must have is_default_fare_category = 1. When entries in the fare_products.txt and rider_categoies.txt files exist, it is not allowed to have no categories set as is_default_fare_category = 1.

Does it look clearer if we just modify the sentence from

there must be only one of these rider categories indicated as the default rider category (is_default_fare_category = 1).

to

there must be exactly one of these referenced rider categories indicated as the default rider category (is_default_fare_category = 1)?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @tzujenchanmbd, the explanation makes a lot of sense, I think in my initial reading I missed the context that this was among those rider categories filtered for a specified fare product ID.

I like your proposed clarification, though might suggest changing "referenced" to "eligible" to make even more clear which rider categories we're talking about.


Used to describe the range of fares available for purchase by riders or taken into account when computing the total fare for journeys with multiple legs, such as transfer costs.

| Field Name | Type | Presence | Description |
| ------ | ------ | ------ | ------ |
| `fare_product_id` | ID | **Required** | Identifies a fare product or set of fare products.<br><br>Multiple records in [fare_products.txt](#fare_productstxt) may share the same `fare_product_id`, in which case all records with that ID will be retrieved when referenced from another file.<br><br>Multiple records may share the same `fare_product_id` but with different `fare_media_id`s, indicating various methods available for employing the fare product, potentially at different prices. |
| `fare_product_id` | ID | **Required** | Identifies a fare product or set of fare products.<br><br>Multiple records in [fare_products.txt](#fare_productstxt) may share the same `fare_product_id`, in which case all records with that ID will be retrieved when referenced from another file.<br><br>Multiple records may share the same `fare_product_id` but with different `fare_media_id`s, indicating various methods available for employing the fare product, potentially at different prices.<br><br>Multiple records may share the same `fare_product_id` but with different `rider_categories_id`s, indicating multiple rider categories are eligible for the fare product, potentially at different prices. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there’s an opportunity here to clarify both existing language and new language around what is permitted with shared fare_product_ids. Would the following language be an improvement, and does it accurately describe what is allowed?

Multiple records sharing the same fare_product_id are permitted as long as they contain different fare_media_ids or rider_category_ids. Differing fare_media_ids would indicate various methods are available for employing the fare product, potentially at different prices. Differing rider_category_ids would indicate multiple rider categories are eligible for the fare product, potentially at different prices.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion @westontrillium!
This looks great to me - changes on 8068e8c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Change: Addition New function proposed to the specification. Extension: GTFS-Fares Issues and Pull Requests that focus on GTFS-Fares Extension Support: Needs Review Needs support to review proposal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add rider_category_id to fare_products.txt
3 participants