/**
 * Data model types for the Popular Requests feature.
 *
 * Ported from Angular typings (ClientApp/src/typings/popular-request.ts,
 * ClientApp/src/typings/enums.ts) — flattened into minimal, UI-oriented
 * types with no Angular dependencies.
 */

// ---------------------------------------------------------------------------
// Enums & literals
// ---------------------------------------------------------------------------

/** Request mode — discriminator for the popular request union */
export type RequestMode =
  | "FlightNumber"
  | "Route"
  | "RouteWithBack"
  | "Departure"
  | "Arrival";

/** Which feature area the request navigates to */
export type PopularRequestType = "Schedule" | "Onlineboard";

// ---------------------------------------------------------------------------
// Request sub-types (discriminated by `mode`)
// ---------------------------------------------------------------------------

export interface PopularRouteRequest {
  mode: "Route" | "RouteWithBack";
  departure: string;
  arrival: string;
  type: PopularRequestType;
}

export interface PopularArrivalRequest {
  mode: "Arrival";
  arrival: string;
  type: "Onlineboard";
}

export interface PopularDepartureRequest {
  mode: "Departure";
  departure: string;
  type: "Onlineboard";
}

export interface PopularFlightNumberRequest {
  mode: "FlightNumber";
  carrier: string;
  flightNumber: string;
  type: "Onlineboard";
}

// ---------------------------------------------------------------------------
// Union type
// ---------------------------------------------------------------------------

/** Any popular request returned by the API */
export type PopularRequest =
  | PopularRouteRequest
  | PopularArrivalRequest
  | PopularDepartureRequest
  | PopularFlightNumberRequest;
