export interface ICampaignDiscountCode { code: string; description: string; value: number; type: 'percentage' | 'fixed'; max_uses: number; used_count: number; } export interface ICampaign { campaign_id: string; client_id: string; name: string; status: 'draft' | 'building' | 'active' | 'paused' | 'completed' | 'failed'; target_categories: string[]; description: string; prompt_instruction: string; priority: 'soft' | 'balanced' | 'strong'; language: string; min_price: number | null; max_price: number | null; goal: 'awareness' | 'conversion' | 'upsell' | 'clearance'; tone_of_voice: string; discount_codes: ICampaignDiscountCode[]; file_search_store_name: string | null; indexed_product_count: number; start_date: string | null; end_date: string | null; created_at: string | null; updated_at: string | null; report: ICampaignMetrics | null; } export interface ICampaignConversationStats { total_conversations: number; avg_messages: number; avg_duration_minutes: number; avg_intent_score: number; outcome_distribution: Record; sentiment_breakdown: { positive: number; neutral: number; negative: number }; satisfaction_rate: number; high_intent_conversations: number; high_intent_rate: number; top_questions: { question: string; count: number }[]; top_pain_points: { issue: string; count: number }[]; } export interface ICampaignMetrics { impressions: number; clicks: number; add_to_cart: number; cart_value: number; ctr: number; conversion_rate: number; unique_sessions: number; top_products: ICampaignProduct[]; conversations: ICampaignConversationStats; computed_at?: string; } export interface ICampaignProduct { sku: string; name: string; impressions: number; clicks: number; add_to_cart: number; revenue: number; } export interface ICampaignPreviewProduct { sku: string; name: string; price: number; main_category: string; stock: number; image_url: string; } export interface ICreateCampaignPayload { name: string; target_categories: string[]; description?: string; prompt_instruction?: string; priority?: 'soft' | 'balanced' | 'strong'; start_date?: string; end_date?: string; language?: string; min_price?: number | null; max_price?: number | null; goal?: 'awareness' | 'conversion' | 'upsell' | 'clearance'; tone_of_voice?: string; discount_codes?: ICampaignDiscountCode[]; } export interface IUpdateCampaignPayload { name?: string; target_categories?: string[]; description?: string; prompt_instruction?: string; priority?: 'soft' | 'balanced' | 'strong'; start_date?: string; end_date?: string; language?: string; min_price?: number | null; max_price?: number | null; goal?: 'awareness' | 'conversion' | 'upsell' | 'clearance'; tone_of_voice?: string; discount_codes?: ICampaignDiscountCode[]; } export interface ICampaignResponse { message: string; status: number; errors: boolean; data: ICampaign; } export interface ICampaignListResponse { message: string; status: number; errors: boolean; data: { campaigns: ICampaign[]; count: number; }; } export interface ICampaignProductsResponse { message: string; status: number; errors: boolean; data: { products: ICampaignPreviewProduct[]; count: number; categories: string[]; }; } export interface ICampaignAnalyticsResponse { message: string; status: number; errors: boolean; data: ICampaignMetrics; } export interface ICampaignDailyAnalyticsResponse { message: string; status: number; errors: boolean; data: { daily: (ICampaignMetrics & { date: string })[]; count: number; }; } export interface ICampaignCategoriesResponse { message: string; status: number; errors: boolean; data: { categories: string[]; count: number; }; } export interface ICampaignConversationsResponse { message: string; status: number; errors: boolean; data: { journeys: ICampaignJourneyItem[]; count: number; next_cursor: string | null; }; } export interface ICampaignJourneyItem { fingerprint: string; first_message_at: string | null; last_message_at: string | null; message_count: number; duration_minutes: number; language: string; summary: string; outcome: string; sentiment: string; purchase_intent_score: number; product_clicks: number; add_to_cart_count: number; liked_messages_count: number; disliked_messages_count: number; primary_category: string; last_stage: string; } export interface ICampaignActionResponse { message: string; status: number; errors: boolean; data: { campaign_id: string; status: string; }; }