import { RequestMode } from './enums';

export type IPopularRequestType = 'Schedule' | 'Onlineboard';

type IRequestRouteMode =
    | RequestMode.ROUTE
    | RequestMode.SCHEDULE_ROUTE_BOTH_DIRECTIONS;

export type IPopularRequest =
    | IPopularRouteRequest
    | IPopularArrivalRequest
    | IPopularDepartureRequest
    | IPopularFlightNumberRequest;

export type IPopularRouteRequest = {
    mode: IRequestRouteMode;
    departure: string;
    arrival: string;
    type: IPopularRequestType;
};

export type IPopularArrivalRequest = {
    mode: RequestMode.ARRIVAL;
    arrival: string;
    type: 'Onlineboard';
};

export type IPopularDepartureRequest = {
    mode: RequestMode.DEPARTURE;
    departure: string;
    type: 'Onlineboard';
};

export type IPopularFlightNumberRequest = {
    mode: RequestMode.FLIGHT_NUMBER;
    carrier: string;
    flightNumber: string;
    type: 'Onlineboard';
};
