mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-19 08:50:29 +00:00
add additional method to get shuttles by route
This commit is contained in:
@@ -67,6 +67,7 @@ export interface Repository {
|
|||||||
|
|
||||||
getShuttlesBySystemId(systemId: string): Promise<IShuttle[]>;
|
getShuttlesBySystemId(systemId: string): Promise<IShuttle[]>;
|
||||||
getShuttleById(shuttleId: string): Promise<IShuttle | null>;
|
getShuttleById(shuttleId: string): Promise<IShuttle | null>;
|
||||||
|
getShuttlesByRouteId(routeId: string): Promise<IShuttle[]>;
|
||||||
|
|
||||||
getEtasForShuttleId(shuttleId: string): Promise<IEta[]>;
|
getEtasForShuttleId(shuttleId: string): Promise<IEta[]>;
|
||||||
getEtasForStopId(stopId: string): Promise<IEta[]>;
|
getEtasForStopId(stopId: string): Promise<IEta[]>;
|
||||||
|
|||||||
@@ -41,6 +41,10 @@ export class UnoptimizedInMemoryRepository implements Repository {
|
|||||||
return this.shuttles.filter(shuttle => shuttle.systemId === systemId);
|
return this.shuttles.filter(shuttle => shuttle.systemId === systemId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async getShuttlesByRouteId(routeId: string) {
|
||||||
|
return this.shuttles.filter(shuttle => shuttle.routeId === routeId);
|
||||||
|
}
|
||||||
|
|
||||||
public async getShuttleById(shuttleId: string) {
|
public async getShuttleById(shuttleId: string) {
|
||||||
return this.findEntityById(shuttleId, this.shuttles);
|
return this.findEntityById(shuttleId, this.shuttles);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user