update imports and create ApiBasedRepository.ts stub

This commit is contained in:
2025-01-06 21:01:22 -08:00
parent 359f8fe192
commit d10ad92907
6 changed files with 85 additions and 6 deletions

View File

@@ -1,4 +1,13 @@
import { IEntityWithId, IEta, IOrderedStop, IRoute, IShuttle, IStop, ISystem, GetterSetterRepository } from "./GetterSetterRepository";
import { GetterSetterRepository } from "./GetterSetterRepository";
import {
IEntityWithIdAndOptionalTimestamp,
IEta,
IOrderedStop,
IRoute,
IShuttle,
IStop,
ISystem
} from "../entities/entities";
/**
* An unoptimized in memory repository.
@@ -73,7 +82,7 @@ export class UnoptimizedInMemoryRepository implements GetterSetterRepository {
return this.orderedStops.filter((value) => value.routeId === routeId);
}
private findEntityById<T extends IEntityWithId>(entityId: string, arrayToSearchIn: T[]) {
private findEntityById<T extends IEntityWithIdAndOptionalTimestamp>(entityId: string, arrayToSearchIn: T[]) {
return this.findEntityByMatcher((value) => value.id === entityId, arrayToSearchIn);
}