From 8c9920e91b77fb7d4b7f5985bcc75f9684407e89 Mon Sep 17 00:00:00 2001 From: Brendan Chen Date: Tue, 7 Jan 2025 15:11:24 -0800 Subject: [PATCH] split IEntityWithOptionalTimestamp into a separate interface --- src/entities/entities.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) 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;