export interface Lead {
  id: number
  conversation_id: string
  visitor_id: string
  name: string | null
  email: string | null
  phone: string | null
  company: string | null
  lead_score: number
  lead_status: LeadStatus
  source_page: string | null
  referrer: string | null
  utm_data: UTMData | null
  form_data: Record<string, unknown> | null
  form_field_labels: Record<string, string> | null
  form_name: string | null
  conversation_summary: string | null
  metadata: Record<string, unknown> | null
  created_at: string
  updated_at: string
}

export type LeadStatus = 'new' | 'contacted' | 'qualified' | 'converted' | 'lost'

export interface UTMData {
  utm_source?: string
  utm_medium?: string
  utm_campaign?: string
  utm_term?: string
  utm_content?: string
}

export interface LeadFilters {
  status?: LeadStatus
  search?: string
  language?: string
  date_from?: string
  date_to?: string
}

export interface LeadsPagination {
  page: number
  per_page: number
  total: number
  total_pages: number
}

export interface LeadsResponse {
  success: boolean
  data: {
    leads: Lead[]
    pagination: LeadsPagination
  }
}

export interface LeadResponse {
  success: boolean
  data: {
    lead: Lead
    conversation?: Conversation
  }
}

export interface LeadStats {
  total: number
  by_status: Record<LeadStatus, number>
  this_month: number
  this_week: number
  avg_score: number
}

// Import Conversation type
import { Conversation } from './conversation'










