import { Rule } from "../availabilityRules";



export type AddOnType = {
    id: number,
    title: string,
    is_icon: boolean,
    icon_value: string,
    price: number,
    currency: string,
    scope: 'booking' | 'all_rooms' | 'room_category' | 'room',
    is_published: boolean;
    updated_at?: string,
    created_at?: string
};

export type CALCULATION_TYPE = 'per_booking' | 'per_room' | 'per_room_per_night' | 'per_night' | 'per_person' | 'per_person_per_night' | 'per_quantity'
export type APPLY_ON_TYPE = 'booking' | 'check_in' | 'check_out' | 'entire_stay' | 'dont_apply'

export type AddOnFormType = {
    sort_order: number
    title: string
    description: string
    price: number
    currency: string
    unit: number
    min_quantity: number | null
    max_quantity: number | null
    allow_qantity: boolean
    min_guests: number | null
    max_guests: number | null
    allow_guests: boolean
    calculation_type: CALCULATION_TYPE,
    scope: 'booking' | 'all_rooms' | 'room_category' | 'room',
    apply_on: APPLY_ON_TYPE,
    tag: string
    is_icon: boolean,
    icon_value: string,
    is_variant: boolean
    is_published: boolean
    default_active: boolean
    images: { id: number; role: string; sort_order: number }[]
    availabilityRules: Rule[],
    variants: AddOnVariantType[]
}

export type AddOnVariantType = {
    id?: number | string,
    sort_order: number
    title: string
    description?: string
    price: number
    currency: string
    unit: number
    min_quantity: number | null
    max_quantity: number | null
    min_guests: number | null
    max_guests: number | null
    icon?: string
    icon_url?: string
    is_active: boolean
}