import { nanoid } from "nanoid";
import { writable } from "svelte/store";
import {
	CabinClass,
	TicketType,
	type FlightTicket,
	type TicketSearchPayload,
} from "./entities";

export const flightTicketStore = writable<FlightTicket>();

export const ticketSearchStore = writable<TicketSearchPayload>({
	loadMore: false,
	sessionId: nanoid(),
	ticketType: TicketType.Return,
	cabinClass: CabinClass.Economy,
	passengerCounts: { adults: 1, children: 0 },
	departure: "",
	arrival: "",
	departureDate: "",
	returnDate: "",
	meta: {},
});
