add type IEntityWithId to implement unified search function later

This commit is contained in:
2024-12-22 14:10:28 -08:00
parent e3d6d71825
commit f792554ae0

View File

@@ -1,8 +1,11 @@
// If types match closely, we can use TypeScript "casting" // If types match closely, we can use TypeScript "casting"
// to convert from data repo to GraphQL schema // to convert from data repo to GraphQL schema
export interface ISystem { export interface IEntityWithId {
id: string; id: string;
}
export interface ISystem extends IEntityWithId {
name: string; name: string;
} }
@@ -11,24 +14,21 @@ export interface ICoordinates {
longitude: number; longitude: number;
} }
export interface IRoute { export interface IRoute extends IEntityWithId {
id: string;
name: string; name: string;
color: string; color: string;
polylineCoordinates: ICoordinates[]; polylineCoordinates: ICoordinates[];
systemId: string; systemId: string;
} }
export interface IStop { export interface IStop extends IEntityWithId {
id: string;
name: string; name: string;
systemId: string; systemId: string;
coordinates: ICoordinates; coordinates: ICoordinates;
} }
export interface IShuttle { export interface IShuttle extends IEntityWithId {
coordinates: ICoordinates; coordinates: ICoordinates;
id: string;
name: string; name: string;
routeId: string; routeId: string;
systemId: string; systemId: string;