Skip to content

Commit

Permalink
Add accessibilityScore
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardehrenfried committed Nov 20, 2023
1 parent 1681c20 commit fd8a447
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package org.opentripplanner.client.model;

import java.util.List;
import java.util.OptionalDouble;

public record Itinerary(List<Leg> legs) {
public record Itinerary(List<Leg> legs, OptionalDouble accessibilityScore) {

/** Does this itinerary contain any legs that contain public transport? */
public boolean hasTransit() {
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/opentripplanner/client/model/Leg.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.time.Duration;
import java.time.OffsetDateTime;
import java.util.List;
import java.util.OptionalDouble;
import org.opentripplanner.client.model.TripPlan.Place;

public record Leg(
Expand All @@ -14,7 +15,8 @@ public record Leg(
Duration duration,
double distance,
Route route,
List<FareProductUse> fareProducts) {
List<FareProductUse> fareProducts,
OptionalDouble accessibilityScore) {

/** Is this leg using public transport? */
public boolean isTransit() {
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/queries/plan.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ query {
itineraries {
startTime
endTime
accessibilityScore
legs {
startTime
endTime
Expand Down Expand Up @@ -61,6 +62,7 @@ query {
}
}
}
accessibilityScore
}
}
}
Expand Down

0 comments on commit fd8a447

Please sign in to comment.