import type { ListMeta } from '@/interfaces/common';
import { storeDataI } from './add-launch/page';

export interface Launch {
    id: number
    name: string
    launch_projects: Array<{
        city_id: number
        launch_id: number
        project_id: number
        project_name: string
    }>
    location_name: string
    created_by_name: string
    created_at: string
    status: string
}

export interface LaunchDataI {
    launchName: string
    location: string
    project_id: [number, number]
}

export interface LaunchPayload {
    pageSize?: number
    page?: number
    sortColumn?: string
    sortOrder?: string
    city_id?: string

    // sort: any;
    filters?: any
    search?: string | undefined
    location?: any
    created_by?: number
    status?: any
}

export interface citiesI {
    id: number
    name: string
}
export interface roleI {
    id: number
    name: string
    status: string
}

export interface designationI {
    id: number
    name: string
    status: string
}
export interface clusterI {
    id: number
    name: string
    status: string
}

export interface UserStates {

    regionList: any
    projectEmpList: any
    launchEmpList: any
    leadList?: any
    leadsRequest?: any
    faceBookList: any[]
    launches: Launch[]
    projects: any[]
    projectId: any
    projectMeta: ListMeta
    launchMeta: ListMeta
    faceBookMeta: ListMeta
    launchesId: any
    switch: any
    listLoading: boolean
    status: 'loading' | 'succeeded' | 'failed'
    loading: boolean
    error: string | null
    launchLoading: boolean
    channelLoading: boolean
    channelID: any
}

export interface LaunchTeamI {
    created_at?: string
    field_sales_id: number
    field_sales_leads: number | null
    field_sales_name: string
    field_sales_status?: string
    field_sales_is_blocked?: boolean
    id?: number
    launch_id?: number
    pre_sales_id: number | string
    pre_sales_leads: number | null
    pre_sales_name: string
    pre_sales_status?: string
    pre_sales_is_blocked?: boolean
    updated_at?: string | null
}

export interface LaunchFilter {
    launch_name?: string
    location?: string
    created_by?: number | undefined | null
    created_on?: number | undefined | null
    status?: string | undefined | null
}

export interface ProjectFilter {
    search: string
    created_by: string
    region_id: string
    builder_id: string
    status: string
    page: number
    location: string
    pageSize: number
    pagination: boolean
    sortColumn: string
    sortOrder: string
    city_id?: string
}
export interface ProjectPayload {
    current_page: number
    per_page: number
    sort: any
    filters?: ProjectFilter
}

export interface launchSalesI {
    preSalesUser: number
    fieldSalesUser: number
    preSalesInput: number
    fieldSalesInput: number
    sales_type: string
    user_id: number
    leads: number
}

export interface launchResponseI {
    type: string
    payload: {
        data: {
            id: number
            name: string
            location: 20
            cluster_manager_id: 36
            team_lead_id: 69
            status: string
            created_by: 47
            created_at: string
            updated_at: null
            cluster_manager_name: string
            team_head_name: string
            created_by_name: string
            location_name: string
            launch_projects: [
                {
                    id: 1
                    name: string
                }
            ]
            launch_sales: [
                {
                    id: 148
                    sales_type: string
                    leads: 23
                    user_id: 58
                    user_name: string
                }
            ]
        }
    }
    meta: {
        arg: {
            id: string
        }
        requestId: string
        requestStatus: string
    }
}

export interface tablePreFieldTypesI {
    id: number
    sales_type: string
    leads: number
    user_id: number
    user_name: string
    pre_sales_id: number
    field_sales_id: number
}

export interface launchProjectI {
    id: number
    name: string
}
export interface launchPaginationI {
    current: number
    pageSize: number
    total: number
    showSizeChanger: boolean
    pageSizeOptions: [string, string, string, string]
    defaultPageSize: number
}
export interface launchSorterI {
    column: {
        title: string
        dataIndex: string
        key: string
        sortDirections: [string]
        sorter: boolean
    }
    order: string
    field: string
    columnKey: string
}

export interface teamLaunchConfigI {
    pre_sales_id: number | string
    field_sales_id: number
    pre_sales_leads: number | null
    field_sales_leads: number | null
    pre_sales_name: string
    field_sales_name: string
    pre_sales_status?: string
    pre_sales_is_blocked?: boolean
    field_sales_status?: string
    field_sales_is_blocked?: boolean
}

export interface launchProjectsItemsI {
    id: number
    name: string
}

export interface launchProjectsDropdownI {
    label: string
    value: number
}

export interface launch_salesI {
    id: number
    leads: number
    sales_type: string
    user_id: number
    user_name: string
}
export interface launchValuesI {
    cluster_manager_id: number
    team_lead_id: number
    status: string
    preSalesUser: string
    preSalesInput: string
    fieldSalesUser: string
    fieldSalesInput: string
    city_id: string
}
export interface LaunchSearchFilterI {
    page: number
    search: string
    location: null
}
export interface SearchLaunchValuesI {
    page: number
    search?: string
    city_id?: string | null
    cluster_manager_id?: number | null
    team_lead_id?: number | null
    location?: string | null
    created_by?: number | string
}
export interface updatedLaunchFilterI {
    created_by?: number | null | undefined
    location?: string | null | undefined
}
export interface Project {
    id: number
    name: 'string'
    location: 'string'
    builder_id: number
    region_id: number
    status: 'string'
    created_at: 'string'
    updated_at: 'string'
    created_by: number
    builder_name: 'string'
    region_name: 'string'
    created_by_name: 'string'
    created_on: any
    projectMeta: ListMeta
}

export interface ProjectMeta {
    total: number
    count: number
    current: number
    pageSize: number
    per_page: number
    current_page: number
    total_pages: number
    links: {
        next: 'string'
        prev: 'string'
    }
}

export interface ConfigurationDropdownProps {
    label: string
    value: number | string
}
export interface Configurations {
    configuration_id: string
    configuration_name: string
    ticket_size?: string
}

export interface ProjectFormDataI {
    name: string
    location: string
    location1: string
    location2?: string
    location3?: string
    location4?: string
    builder_name: number
    region: number
    city: number
    [key: `ticket_size_${any}`]: string | number
}

export interface ChannelI {
    id: number
    project_id: number
    channel: string
    channel_id: number
    status: string
    created_at: Date
    updated_at: null
    channel_name: string
    enabled?: string
    inputType?: string
    updatedChannel?: channelI
}

export interface updateChannelI {
    enabled: boolean
    id?: number
    channel_id: string
    channel: string
    inputType: string
}

export interface ProjectFormValuesI {
    id: number
    form_id: string
    name: string
    status: string
    paging_after: string
    created_at: string
    updated_at: string
}

export interface ChannelFormDataI {
    [key: string]: string | boolean | undefined
    enabled: string
    name: string
    inputType: string
}

export interface channelI {
    name?: string
    enabled: string
    id?: number
    channel_id?: string
    channel_name?: string
    inputType?: string
    updatedChannel?: updateChannelI
}

export interface ModalBoxProps {
    key: string
    id?: number | any
    isModalOpen?: boolean
    handleClose: () => void
    data?: any | null
    handleOk: () => void
    storeData: storeDataI
    check: string
    setStoreData: (storeData: storeDataI) => void
    teamHeadId: string
    clusterManagerId: string
    reporting_manager_id?: number | string | undefined | null
    initialValues?: {
        pre_sales_id?: number
        pre_sales_name?: string
        pre_sales_leads?: number | null
        field_sales_id?: number
        field_sales_name?: string
        field_sales_leads?: number | null
    } | null
}

export interface leadFilterI {
    status?: string
    search?: string
    status_id?: string
    project_id?: string
    launch_id?: string
    created_by?: string
    page?: number
    pageSize?: number
    sortColumn?: string
    sortOrder?: string
    lead_status_id?: string
    updated_by?: string
}

export interface leadColumnI {
    id: number
    project_name: string
    lead_status_name: string
    project: number
    status: string
    created_at: string
    budget: string
}

export interface createdOptionsI {
    role_label: string
    last_name: string
    first_name: string
    user_id: number
    value: number
    label: string
}

export interface regionOptionsI {
    region_name: string
    region_id: number
    value: number
    label: string
}

export interface AssignedSellerI {
    seller_id: number
    name: string | null
    email: string | null
    phone: string | null
    status: number
}
