Skip to content

Commit cf29c82

Browse files
authored
feat: added contactless emv support feature and updated features doc (#2119)
* added contactless emv support feature and updated features doc
1 parent b3f7c18 commit cf29c82

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

docs/FEATURES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ The validator will produce the [list of features](https://gtfs.org/getting_start
2626
| Fares | Time-Based Fares | One line of data in [timeframes.txt](https://gtfs.org/schedule/reference/#timeframestxt) AND one line of data in [fare_products.txt](https://gtfs.org/schedule/reference/#fare_productstxt) AND one line of data in [fare_leg_rules.txt](https://gtfs.org/schedule/reference/#fare_leg_rulestxt) AND (one **from_timeframe_id** value in [fare_leg_rules.txt](https://gtfs.org/schedule/reference/#fare_leg_rulestxt) OR one **to_timeframe_id** value in [fare_leg_rules.txt](https://gtfs.org/schedule/reference/#fare_leg_rulestxt)) | https://gtfs.org/getting_started/features/fares/#time-based-fares |
2727
| Fares | Zone-Based Fares | One line of data in [areas.txt](https://gtfs.org/schedule/reference/#areastxt) AND one line of data in [fare_products.txt](https://gtfs.org/schedule/reference/#fare_productstxt) AND one line of data in [fare_leg_rules.txt](https://gtfs.org/schedule/reference/#fare_leg_rulestxt) AND (one **from_area_id** value in [fare_leg_rules.txt](https://gtfs.org/schedule/reference/#fare_leg_rulestxt) OR one **to_area_id** value in [fare_leg_rules.txt](https://gtfs.org/schedule/reference/#fare_leg_rulestxt)) | https://gtfs.org/getting_started/features/fares/#zone-based-fares |
2828
| Fares | Fare Transfers | One line of data in [fare_transfer_rules.txt](https://gtfs.org/schedule/reference/#fare_transfer_rulestxt) | https://gtfs.org/getting_started/features/fares/#fare-transfers |
29+
| Fares | Contactless EMV Support | One **cemv_support** value in [agency.txt](https://gtfs.org/schedule/reference/#agencytxt) OR one **cemv_support** value in [routes.txt](https://gtfs.org/schedule/reference/#routestxt) | https://gtfs.org/getting-started/features/fares/#contactless-emv-support |
2930
| Fares | Fares V1 | One line of data in [fare_attributes.txt](https://gtfs.org/schedule/reference/#fare_attributestxt) | https://gtfs.org/getting_started/features/fares/#fares-v1 |
3031
| Pathways | Pathway Connections | One line of data in [pathways.txt](https://gtfs.org/schedule/reference/#pathwaystxt) | https://gtfs.org/getting_started/features/pathways/#pathway-connections |
3132
| Pathways | Pathway Details | One value of **max_slope**<br/>OR<br/>**min_width** <br/>OR<br/>**length** <br/>OR<br/>**stair_count** in [pathways.txt](https://gtfs.org/schedule/reference/#pathwaystxt) | https://gtfs.org/getting_started/features/pathways/#pathway-details |

main/src/main/java/org/mobilitydata/gtfsvalidator/reportsummary/model/FeedMetadata.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,24 @@ private void loadSpecFeaturesBasedOnFieldPresence(GtfsFeedContainer feedContaine
273273
loadRiderCategoriesFeature(feedContainer);
274274
loadTimeBasedFaresFeature(feedContainer);
275275
loadZoneBasedFaresFeature(feedContainer);
276+
loadContactlessEMVSupportFeature(feedContainer);
276277
loadFixedStopsDemandResponseTransit(feedContainer);
277278
loadCarsAllowedFeature(feedContainer);
278279
}
279280

281+
private void loadContactlessEMVSupportFeature(GtfsFeedContainer feedContainer) {
282+
specFeatures.put(
283+
new FeatureMetadata("Contactless EMV Support", "Fares"),
284+
hasAtLeastOneRecordForFields(
285+
feedContainer,
286+
GtfsAgency.FILENAME,
287+
List.of((Function<GtfsAgency, Boolean>) (GtfsAgency::hasCemvSupport)))
288+
|| hasAtLeastOneRecordForFields(
289+
feedContainer,
290+
GtfsRoute.FILENAME,
291+
List.of((Function<GtfsRoute, Boolean>) (GtfsRoute::hasCemvSupport))));
292+
}
293+
280294
/**
281295
* Determines the presence of the "Cars Allowed" feature, which requires that the field
282296
* cars_allowed exists in at least one entry in trips.txt.

0 commit comments

Comments
 (0)