
export type AddonSelected = { id: number, title: string, price: number, calculation_type: string, unit: number }

export type MealPackageVariantSelected = {
    id: number,
    title: string,
    price: number
}

export type MealPackageSelected = {
    id: number,
    title: string,
    price: number,
    is_entire_stay: boolean
    selected_days: string[]
    is_variant_selected: boolean
    variant: MealPackageVariantSelected | null
}

export type BookingPriceAdjustment = {
    id: number;             // optional, for DB reference
    type: string; // type of adjustment
    name: string;
    description: string;          // e.g., 'Early Bird Discount', 'VAT 15%'
    value: number;          // numeric value
    value_type: 'fixed' | 'percentage'; // fixed amount or % of total
    direction: 'add' | 'subtract'; // fixed amount or % of total
};


export interface RoomDailyPriceType {
    date: string,
    price: number
}

export interface RoomSelected {
    adults: number
    children: number

    room_id: number
    room_number: string

    slug: string
    title: string
    image_url: string

    meal_package: MealPackageSelected | null
    addons: AddonSelected[]

    room_daily_prices: RoomDailyPriceType[]
}

export interface CheckoutBookingInput {

    check_in: string
    check_out: string
    nights: number

    rooms: RoomSelected[]

    guest: {
        title: string,
        first_name: string,
        last_name: string,
        email: string,
        phone: string,
        passport: string,
        country: string,
        special_requests: string,
    },

    price_data: BookingPriceAdjustment[]

    base_currency: string | null,
    total_price: number | null,
    display_total_price: number | null,
    display_currency: string | null,
    exchange_rate: number | null,
    currency_rate_id: number | null,

    // Payment
    payment_option: string,
    note: string
}
