Skip to content

Commit

Permalink
Deprecate fields with "bike" in the name, add new fields
Browse files Browse the repository at this point in the history
  • Loading branch information
testower committed Jun 4, 2024
1 parent 9d7c3f8 commit be6a816
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ public Station mapStation(
? stationStatus.getNumVehiclesAvailable()
: null
);
station.setNumVehiclesAvailable(
stationStatus.getNumVehiclesAvailable() != null
? stationStatus.getNumVehiclesAvailable()
: null
);
station.setVehicleTypesAvailable(
stationStatus.getVehicleTypesAvailable() != null
? mapVehicleTypesAvailable(
Expand All @@ -162,6 +167,11 @@ public Station mapStation(
? stationStatus.getNumVehiclesDisabled()
: null
);
station.setNumVehiclesDisabled(
stationStatus.getNumVehiclesDisabled() != null
? stationStatus.getNumVehiclesDisabled()
: null
);
station.setNumDocksAvailable(
stationStatus.getNumDocksAvailable() != null
? stationStatus.getNumDocksAvailable()
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/org/entur/lamassu/model/entities/Station.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ public class Station implements LocationEntity {
private Boolean isChargingStation;
private RentalUris rentalUris;
private Integer numBikesAvailable;
private Integer numVehiclesAvailable;
private List<VehicleTypeAvailability> vehicleTypesAvailable;
private Integer numBikesDisabled;
private Integer numVehiclesDisabled;
private Integer numDocksAvailable;
private List<VehicleDocksAvailability> vehicleDocksAvailable;
private Integer numDocksDisabled;
Expand Down Expand Up @@ -236,6 +238,14 @@ public void setNumBikesAvailable(Integer numBikesAvailable) {
this.numBikesAvailable = numBikesAvailable;
}

public Integer getNumVehiclesAvailable() {
return numVehiclesAvailable;
}

public void setNumVehiclesAvailable(Integer numVehiclesAvailable) {
this.numVehiclesAvailable = numVehiclesAvailable;
}

public List<VehicleTypeAvailability> getVehicleTypesAvailable() {
return vehicleTypesAvailable;
}
Expand All @@ -254,6 +264,14 @@ public void setNumBikesDisabled(Integer numBikesDisabled) {
this.numBikesDisabled = numBikesDisabled;
}

public Integer getNumVehiclesDisabled() {
return numVehiclesDisabled;
}

public void setNumVehiclesDisabled(Integer numVehiclesDisabled) {
this.numVehiclesDisabled = numVehiclesDisabled;
}

public Integer getNumDocksAvailable() {
return numDocksAvailable;
}
Expand Down
6 changes: 4 additions & 2 deletions src/main/resources/graphql/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,11 @@ type Station {
isValetStation: Boolean
isChargingStation: Boolean
rentalUris: RentalUris
numBikesAvailable: Int!
numBikesAvailable: Int! @deprecated(reason: "Use numVehiclesAvailable")
numVehiclesAvailable: Int!
vehicleTypesAvailable: [VehicleTypeAvailability]
numBikesDisabled: Int
numBikesDisabled: Int @deprecated(reason: "Use numVehiclesDisabled")
numVehiclesDisabled: Int
numDocksAvailable: Int
vehicleDocksAvailable: [VehicleDocksAvailability]
numDocksDisabled: Int
Expand Down

0 comments on commit be6a816

Please sign in to comment.