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