diff --git a/src/repository.ts b/src/repository.ts index b8dfb77..f0aafd3 100644 --- a/src/repository.ts +++ b/src/repository.ts @@ -67,6 +67,7 @@ export interface Repository { getShuttlesBySystemId(systemId: string): Promise; getShuttleById(shuttleId: string): Promise; + getShuttlesByRouteId(routeId: string): Promise; getEtasForShuttleId(shuttleId: string): Promise; getEtasForStopId(stopId: string): Promise; diff --git a/src/unoptimizedInMemoryRepository.ts b/src/unoptimizedInMemoryRepository.ts index d550843..e7f919f 100644 --- a/src/unoptimizedInMemoryRepository.ts +++ b/src/unoptimizedInMemoryRepository.ts @@ -41,6 +41,10 @@ export class UnoptimizedInMemoryRepository implements Repository { 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) { return this.findEntityById(shuttleId, this.shuttles); }