export interface Timestamped {
  readonly createdAt: string;
  readonly updatedAt: string;
}

export interface Identified extends Timestamped {
  readonly id: string;
}

export interface Station extends Identified {
  readonly name: string;
  readonly latitude: number;
  readonly longitude: number;
  readonly code?: string | null;
  readonly osmId?: string | null;
  readonly elevationM?: number | null;
  readonly isActive?: boolean;
}

export interface Track extends Identified {
  readonly startStationId: string;
  readonly endStationId: string;
  readonly lengthMeters: number;
  readonly maxSpeedKph: number;
  readonly status?: string | null;
  readonly isBidirectional?: boolean;
  readonly coordinates: readonly [number, number][];
}

export interface Train extends Identified {
  readonly designation: string;
  readonly capacity: number;
  readonly maxSpeedKph: number;
  readonly operatingTrackIds: readonly string[];
}

export type NetworkEntity = Station | Track | Train;
