Skip to content

Commit

Permalink
Add rideStartAllowed and rideEndAllowed to gql api
Browse files Browse the repository at this point in the history
  • Loading branch information
testower committed Jun 4, 2024
1 parent 22b568b commit 12f01b4
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ private org.entur.lamassu.model.entities.GeofencingZones.Rule mapRule(GBFSRule r
var mapped = new org.entur.lamassu.model.entities.GeofencingZones.Rule();
mapped.setVehicleTypeIds(rule.getVehicleTypeIds());
mapped.setRideAllowed(rule.getRideStartAllowed() && rule.getRideEndAllowed());
mapped.setRideStartAllowed(rule.getRideStartAllowed());
mapped.setRideEndAllowed(rule.getRideEndAllowed());
mapped.setRideThroughAllowed(rule.getRideThroughAllowed());
mapped.setMaximumSpeedKph(
rule.getMaximumSpeedKph() != null ? rule.getMaximumSpeedKph() : null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ public static class Rule implements Serializable {

private List<String> vehicleTypeIds;
private Boolean rideAllowed;
private Boolean rideStartAllowed;
private Boolean rideEndAllowed;
private Boolean rideThroughAllowed;
private Integer maximumSpeedKph;
private Boolean stationParking;
Expand All @@ -168,6 +170,22 @@ public void setRideAllowed(Boolean rideAllowed) {
this.rideAllowed = rideAllowed;
}

public Boolean getRideStartAllowed() {
return rideStartAllowed;
}

public void setRideStartAllowed(Boolean rideStartAllowed) {
this.rideStartAllowed = rideStartAllowed;
}

public Boolean getRideEndAllowed() {
return rideEndAllowed;
}

public void setRideEndAllowed(Boolean rideEndAllowed) {
this.rideEndAllowed = rideEndAllowed;
}

public Boolean getRideThroughAllowed() {
return rideThroughAllowed;
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/graphql/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,9 @@ type GeofencingZoneProperties {

type GeofencingZoneRule {
vehicleTypeIds: [String]
rideAllowed: Boolean!
rideAllowed: Boolean! @deprecated(reason: "Use rideStartAllowed and rideEndAllowed")
rideStartAllowed: Boolean!
rideEndAllowed: Boolean!
rideThroughAllowed: Boolean!
maximumSpeedKph: Int
stationParking: Boolean
Expand Down

0 comments on commit 12f01b4

Please sign in to comment.