Skip to content

Commit

Permalink
added GtfsNetworkSchema
Browse files Browse the repository at this point in the history
  • Loading branch information
qcdyx committed Jan 25, 2024
1 parent 15df3ee commit 7e192d5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public class FeedMetadata {
new Pair<>("Zone-Based Fares", GtfsArea.FILENAME),
new Pair<>("Transfer Fares", GtfsFareTransferRule.FILENAME),
new Pair<>("Time-Based Fares", GtfsTimeframe.FILENAME),
new Pair<>("Route-Based Fares", GtfsNetwork.FILENAME),
new Pair<>("Levels", GtfsLevel.FILENAME));

protected FeedMetadata() {}
Expand Down Expand Up @@ -189,7 +190,8 @@ private void loadRouteBasedFaresComponent(GtfsFeedContainer feedContainer) {
hasAtLeastOneRecordForFields(
feedContainer,
GtfsRoute.FILENAME,
List.of((Function<GtfsRoute, Boolean>) GtfsRoute::hasNetworkId)));
List.of((Function<GtfsRoute, Boolean>) GtfsRoute::hasNetworkId))
|| hasAtLeastOneRecordInFile(feedContainer, GtfsNetwork.FILENAME));
}

private void loadBlocksComponent(GtfsFeedContainer feedContainer) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.mobilitydata.gtfsvalidator.table;

import org.mobilitydata.gtfsvalidator.annotation.*;

@GtfsTable("networks.txt")
@Required
public interface GtfsNetworkSchema extends GtfsEntity {
@FieldType(FieldTypeEnum.ID)
@PrimaryKey
@Required
String networkId();

@MixedCase
String networkName();
}

0 comments on commit 7e192d5

Please sign in to comment.