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

feat: added GtfsRiderCategoriesSchema #1989

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,9 @@ public interface GtfsFareProductSchema extends GtfsEntity {
@ForeignKey(table = "fare_media.txt", field = "fare_media_id")
@PrimaryKey(translationRecordIdType = UNSUPPORTED)
String fareMediaId();

@FieldType(FieldTypeEnum.ID)
@ForeignKey(table = "rider_categories.txt", field = "rider_category_id")
@PrimaryKey(translationRecordIdType = UNSUPPORTED)
String riderCategoryId();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package org.mobilitydata.gtfsvalidator.table;

import org.mobilitydata.gtfsvalidator.annotation.*;

@GtfsTable("rider_categories.txt")
public interface GtfsRiderCategoriesSchema extends GtfsEntity {
@FieldType(FieldTypeEnum.ID)
@PrimaryKey
@Required
String riderCategoryId();

@Required
String riderCategoryName();

@Required
GtfsRiderCategory isDefaultRiderCategory();
Copy link
Contributor

Choose a reason for hiding this comment

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

@qcdyx @skalexch figured it out! It looks like this needs to be isDefaultFareCategory not isDefaultRiderCategory in order to match the spec: https://github.com/google/transit/pull/511/files#diff-3ecf0760eb54b4953728042a1e30586705dc2335807be94faae0de5829cd12a1R411 and make sure https://mobilitydatabase.org/feeds/mdb-258 doesn't trigger the error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, it is rider_categories.is_default_rider_category in the requirement. Shall I proceed to make the change?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I see what you mean from the requirements. Yes please - the spec is always the source of truth, so is_default_fare_category is the right field name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! image


@FieldType(FieldTypeEnum.URL)
String eligibilityUrl();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.mobilitydata.gtfsvalidator.table;

import org.mobilitydata.gtfsvalidator.annotation.GtfsEnumValue;

@GtfsEnumValue(name = "NOT_DEFAULT", value = 0)
@GtfsEnumValue(name = "IS_DEFAULT", value = 1)
public interface GtfsRiderCategoryEnum {}
Loading