import { RouteType } from '@typings/enums';

export function getFlightMock(arrival: string, departure: string, pId: string) {
    return {
        routeType: RouteType.DIRECT,
        pId,
        leg: {
            arrival: {
                scheduled: {
                    cityCode: arrival,
                },
            },
            departure: {
                scheduled: {
                    cityCode: departure,
                },
            },
        },
    } as any;
}

type IStationCodes = {
    arrival: string;
    departure: string;
};
export function getMultiLegFlightMock(stations: IStationCodes[], pId: string) {
    return {
        routeType: RouteType.MULTI_LEG,
        pId,
        legs: stations.map((station) => {
            return {
                arrival: {
                    scheduled: {
                        cityCode: station.arrival,
                    },
                },
                departure: {
                    scheduled: {
                        cityCode: station.departure,
                    },
                },
            };
        }),
    } as any;
}
