export interface ContactLabel {
    id: number;
    contact_id: number;
    label_id: number;
    created_at: string;
    updated_at: string;
    whatsapp_account_id: number;
    name: string;
    color: string;
    status: string;
    text_color: string | null;
    label: {
        id: number;
        whatsapp_account_id: number;
        name: string;
        color: string;
        status: string;
        text_color: string | null;
    };
}

export interface WhatsappAccount {
    id: number;
    account_id: string;
    phone_number_id: string;
    phone_number: string;
    business_name: string;
    access_token: string;
    webhook_verify_token: string;
    is_active: boolean;
    created_at: string;
    updated_at: string;
    profile_pic_url: string;
    about: string;
    vertical: string;
    email: string | null;
    address: string | null;
    api_path: string;
}

export interface Message {
    id: number;
    conversation_id: number;
    contact_id: number;
    whatsapp_account_id: number;
    direction: 'inbound' | 'outbound';
    message_text: string;
    message_id: string;
    status: 'delivered' | 'read' | 'sent' | 'failed';
    created_at: string;
    updated_at: string;
    media_id: string;
    message_type: 'text' | 'image' | 'video' | 'document' | 'audio' | 'sticker' | 'location' | 'contacts' | 'interactive' | 'template';
    media_url: string | null;
    media_filename: string | null;
    media_caption: string | null;
    media_size: number | null;
    media_mime_type: string | null;
    message_template: any | null; // specific type unknown from example
    message_template_id: string | null;
    message_template_name: string | null;
    ref_message_id: string;
    deleted_at: string | null;
    duration: number | null;
    message_json: any | null;
    maded_by_json: any | null;
    sent_at_format: {
        original: string;
        format: string;
    };
    read_at_format: {
        original: string | null;
        format: string;
    };
    ref_maded_by_json: any | null;
    ref_message_json: any | null;
    delivered_at_format: {
        original: string;
        format: string;
    };
    created_at_date: {
        original: string;
        format: string;
    };
}

export interface Conversation {
    id: number;
    contact_id: number;
    whatsapp_account_id: number;
    last_message: string;
    last_message_at: string;
    created_at: string;
    updated_at: string;
    last_message_id: number;
    last_messages: Message;
    first_messages: Message;
}

export interface Contact {
    id: number;
    wa_id: string;
    name: string;
    phone_number: string;
    whatsapp_account_id: number;
    last_contacted_at: string | null;
    message_count: number | null;
    created_at: string;
    updated_at: string;
    last_name: string | null;
    deleted_at: string | null;
    profile_pic_url: string | null;
    calling_permission: string;
    calling_expired: string | null;
    branch_id: number;
    branch_name: string;
    branch_alias:string;
    branch_bg_color:string;
    is_available: boolean;
    is_customer?: boolean;
    deal?: boolean | number;
    labels: ContactLabel[];
    whatsapp_account: WhatsappAccount | null;
    current_conversation: Conversation | null;
    province_id: string | null;
    city_id: string | null;
    address: string | null;
    city: {
        id: number;
        name: string;
    },
    province: {
        id: number;
        name: string;
    }
    inbound_messages_count:number;
    outbound_messages_count:number;
}


export interface BussinessProfile {
    id:number;
    account_id:string;
    phone_number:string;
    phone_number_id:string;
    business_name:string;
    access_token:string;
    webhook_verify_token:string;
    is_active:boolean;
    about:string;
    profile_pic_url:string;
}

export interface LabelContact {
   id:number;
   name:string;
   status:string;
   text_color:string;
   color:string;
   whatsapp_account_id:number;
   keywords?:string[];
}


export interface CallIntiate {
    message_id:string;
    contacts:Contact;
 }