diff --git a/src/entities/entities.ts b/src/entities/entities.ts index 4f1f1dc..1feef84 100644 --- a/src/entities/entities.ts +++ b/src/entities/entities.ts @@ -1,9 +1,12 @@ -export interface IEntityWithIdAndOptionalTimestamp { - id: string; +export interface IEntityWithOptionalTimestamp { millisecondsSinceEpoch?: number; } -export interface ISystem extends IEntityWithIdAndOptionalTimestamp { +export interface IEntityWithId { + id: string; +} + +export interface ISystem extends IEntityWithId, IEntityWithOptionalTimestamp { name: string; } @@ -12,33 +15,33 @@ export interface ICoordinates { longitude: number; } -export interface IRoute extends IEntityWithIdAndOptionalTimestamp { +export interface IRoute extends IEntityWithId, IEntityWithOptionalTimestamp { name: string; color: string; polylineCoordinates: ICoordinates[]; systemId: string; } -export interface IStop extends IEntityWithIdAndOptionalTimestamp { +export interface IStop extends IEntityWithId, IEntityWithOptionalTimestamp { name: string; systemId: string; coordinates: ICoordinates; } -export interface IShuttle extends IEntityWithIdAndOptionalTimestamp { +export interface IShuttle extends IEntityWithId, IEntityWithOptionalTimestamp { coordinates: ICoordinates; name: string; routeId: string; systemId: string; } -export interface IEta { +export interface IEta extends IEntityWithOptionalTimestamp { secondsRemaining: number; shuttleId: string; stopId: string; } -export interface IOrderedStop { +export interface IOrderedStop extends IEntityWithId, IEntityWithOptionalTimestamp { nextStop?: IOrderedStop; previousStop?: IOrderedStop; routeId: string;