mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
33 lines
1.4 KiB
TypeScript
33 lines
1.4 KiB
TypeScript
// If types match closely, we can use TypeScript "casting"
|
|
// to convert from data repo to GraphQL schema
|
|
|
|
import { ShuttleGetterRepository } from "./ShuttleGetterRepository";
|
|
import { IEta, IOrderedStop, IRoute, IShuttle, IStop } from "../../entities/ShuttleRepositoryEntities";
|
|
|
|
/**
|
|
* ShuttleGetterRepository interface for data derived from Passio API.
|
|
* The repository is not designed to have write locks in place.
|
|
* Objects passed from/to the repository should be treated
|
|
* as disposable.
|
|
*/
|
|
export interface ShuttleGetterSetterRepository extends ShuttleGetterRepository {
|
|
// Setter methods
|
|
addOrUpdateRoute(route: IRoute): Promise<void>;
|
|
addOrUpdateShuttle(shuttle: IShuttle): Promise<void>;
|
|
addOrUpdateStop(stop: IStop): Promise<void>;
|
|
addOrUpdateOrderedStop(orderedStop: IOrderedStop): Promise<void>;
|
|
addOrUpdateEta(eta: IEta): Promise<void>;
|
|
|
|
removeRouteIfExists(routeId: string): Promise<IRoute | null>;
|
|
removeShuttleIfExists(shuttleId: string): Promise<IShuttle | null>;
|
|
removeStopIfExists(stopId: string): Promise<IStop | null>;
|
|
removeOrderedStopIfExists(stopId: string, routeId: string): Promise<IOrderedStop | null>;
|
|
removeEtaIfExists(shuttleId: string, stopId: string): Promise<IEta | null>;
|
|
|
|
clearRouteData(): Promise<void>;
|
|
clearShuttleData(): Promise<void>;
|
|
clearStopData(): Promise<void>;
|
|
clearOrderedStopData(): Promise<void>;
|
|
clearEtaData(): Promise<void>;
|
|
}
|