// Tourist Persona Types
export type TouristPersonaType =
  | 'romantic_couple'
  | 'budget_backpacker'
  | 'luxury_traveler'
  | 'content_creator'
  | 'family_explorer'
  | 'solo_adventurer'
  | 'group_tour';

// Tourist Persona Interface
export interface TouristPersona {
  type: TouristPersonaType;
  label: string;           // Türkçe kullanıcıya gösterilen etiket
  sales_label: string;     // İngilizce firma/satış panelinde gösterilen etiket
  emoji: string;
  description: string;     // Kısa açıklama
  spend_potential: 'low' | 'medium' | 'high' | 'very_high';
  key_signals: string[];   // Tespit edilen sinyaller (debug/transparency için)
  recommended_services: string[]; // Bu persona için önerilecek hizmet tipleri
}

// Lead türü tanımlaması
export interface Lead {
  id: string;
  trip_id: string;
  user_id?: string | null;
  
  // Trip detayları
  destination: string;
  start_date: string;
  end_date: string;
  number_of_travelers: number;
  interests: string[];
  planned_activities: PlannedActivity[];
  timeline_snapshot: TimelineSnapshot[];
  
  // İletişim bilgileri
  email: string;
  whatsapp: string;
  country: string;
  
  // Onay ve durum
  consent_given: boolean;
  status: 'new' | 'contacted' | 'converted' | 'closed';
  
  // Persona Engine
  tourist_persona?: TouristPersona;
  persona_confidence?: number; // 0-1 arası güven skoru
  
  // Metadata
  trigger_source?: 'save_modal' | 'planner_cta' | 'contextual_banner' | 'ai_route_recommendation';
  tour_selected_id?: string | null;
  created_at: string;
  updated_at: string;
}

// Planned Activity Structure
export interface PlannedActivity {
  place_id: string;
  name: string;
  type?: string;
  day_number: number;
  order_index: number;
  duration?: string;
  time_block?: 'dawn' | 'morning' | 'afternoon' | 'evening';
  lat?: number;
  lng?: number;
}

// Timeline Snapshot Structure
export interface TimelineSnapshot {
  day_number: number;
  date?: string;
  events: Array<{
    place_id: string;
    name: string;
    start_time: string;
    end_time: string;
    duration_minutes: number;
    order_index: number;
  }>;
}

// Lead oluşturma için input türü
export interface CreateLeadInput {
  trip_id: string;
  destination: string;
  start_date: string;
  end_date: string;
  number_of_travelers: number;
  interests: string[];
  planned_activities: PlannedActivity[];
  timeline_snapshot: TimelineSnapshot[];
  email: string;
  whatsapp: string;
  country: string;
  consent_given: boolean;
  trigger_source: 'save_modal' | 'planner_cta' | 'contextual_banner' | 'ai_route_recommendation';
  tour_selected_id?: string | null;
}
