import type { PricingTier } from "@/lib/types/pricing";

export const PRICING_TIERS: PricingTier[] = [
  {
    id: "tier1",
    nameEn: "Starter",
    nameAr: "المبتدئ",
    priceGBP: 179,
    setupGBP: 199,
    popular: false,
    featuresEn: [
      "AI Agent for FAQ & Auto-Reply",
      "Automated Appointment Booking",
      "Admin Dashboard",
      "WhatsApp Integration",
      "Basic Analytics",
      "Email Support",
    ],
    featuresAr: [
      "وكيل ذكي للأسئلة الشائعة والردود التلقائية",
      "حجز المواعيد الآلي",
      "لوحة تحكم الإدارة",
      "تكامل واتساب",
      "تحليلات أساسية",
      "دعم البريد الإلكتروني",
    ],
  },
  {
    id: "tier2",
    nameEn: "Professional",
    nameAr: "المحترف",
    priceGBP: 209,
    setupGBP: 199,
    popular: true,
    featuresEn: [
      "Everything in Starter",
      "Send & Receive Quotations",
      "CRM Dashboard",
      "Google & Third-Party Integrations",
      "Deposit Management",
      "No-Show Fee Collection",
      "Appointment Rebooking",
      "Priority Support",
    ],
    featuresAr: [
      "كل مزايا الباقة المبتدئة",
      "إرسال واستقبال عروض الأسعار",
      "لوحة تحكم CRM",
      "تكاملات جوجل وأطراف ثالثة",
      "إدارة المقدمات",
      "تحصيل رسوم عدم الحضور",
      "إعادة حجز المواعيد",
      "دعم ذو أولوية",
    ],
  },
  {
    id: "tier3",
    nameEn: "Business",
    nameAr: "الأعمال",
    priceGBP: 249,
    setupGBP: 199,
    popular: false,
    featuresEn: [
      "Everything in Professional",
      "Multi-Staff Login",
      "Recurring Appointments",
      "Multiple Appointments Setup",
      "AI Voice Receptionist",
      "Call Transfer to Mobile",
      "Advanced Scheduling",
      "Custom Workflows",
    ],
    featuresAr: [
      "كل مزايا الباقة المحترفة",
      "تسجيل دخول متعدد للموظفين",
      "مواعيد متكررة",
      "إعداد مواعيد متعددة",
      "موظفة استقبال صوتية ذكية",
      "تحويل المكالمات للجوال",
      "جدولة متقدمة",
      "سير عمل مخصص",
    ],
  },
  {
    id: "tier4",
    nameEn: "Enterprise",
    nameAr: "المؤسسات",
    priceGBP: 349,
    setupGBP: 199,
    popular: false,
    featuresEn: [
      "Everything in Business",
      "Multi-Inbox Social Management",
      "AI Social Media Assistant",
      "Trend Analysis & Post Ideas",
      "Content Scheduling",
      "Social Media Monitoring",
      "Engagement Analytics",
      "Dedicated Account Manager",
    ],
    featuresAr: [
      "كل مزايا باقة الأعمال",
      "إدارة وسائل التواصل متعددة الصناديق",
      "مساعد وسائل تواصل اجتماعي ذكي",
      "تحليل الاتجاهات وأفكار المنشورات",
      "جدولة المحتوى",
      "مراقبة وسائل التواصل",
      "تحليلات التفاعل",
      "مدير حساب مخصص",
    ],
  },
  {
    id: "tier5",
    nameEn: "Ultimate",
    nameAr: "المتكاملة",
    priceGBP: 449,
    setupGBP: 299,
    popular: false,
    featuresEn: [
      "Everything in Enterprise",
      "AI Lead Generation",
      "Automated Lead Nurturing",
      "Advanced CRM with Lead Scoring",
      "Multi-Channel Lead Capture",
      "Conversion Optimization",
      "ROI Tracking & Analytics",
      "White-Label Options",
      "24/7 Premium Support",
    ],
    featuresAr: [
      "كل مزايا باقة المؤسسات",
      "توليد العملاء المحتملين بالذكاء الاصطناعي",
      "رعاية العملاء المحتملين الآلية",
      "CRM متقدم مع تقييم العملاء",
      "التقاط العملاء متعدد القنوات",
      "تحسين التحويلات",
      "تتبع وتحليلات عائد الاستثمار",
      "خيارات العلامة البيضاء",
      "دعم متميز على مدار الساعة",
    ],
  },
];

export const TIER_MAPPING = {
  tier1: "starter",
  tier2: "professional",
  tier3: "business",
  tier4: "enterprise",
  tier5: "ultimate",
} as const;

/**
 * Multi-Staff Seat Limits by Tier
 *
 * Tiers 1-2: No multi-staff support (0 seats)
 * Tier 3 (Business): 1 additional staff seat included
 * Tier 4 (Enterprise): 2 additional staff seats included
 * Tier 5 (Ultimate): 5 additional staff seats included
 */
export const TIER_SEAT_LIMITS: Record<string, number> = {
  tier1: 0, // Starter - No multi-staff
  tier2: 0, // Professional - No multi-staff
  tier3: 1, // Business - 1 seat included
  tier4: 2, // Enterprise - 2 seats included
  tier5: 5, // Ultimate - 5 seats included
};

/**
 * Additional Seat Pricing
 *
 * Price per additional staff seat per month in GBP
 * Available for tiers 3, 4, and 5 only
 */
export const ADDITIONAL_SEAT_PRICE_GBP = 9;

/**
 * Check if tier supports multi-staff functionality
 */
export function tierSupportsMultiStaff(tierId: string): boolean {
  return (TIER_SEAT_LIMITS[tierId] || 0) > 0;
}

/**
 * Get included seats for a tier
 */
export function getIncludedSeats(tierId: string): number {
  return TIER_SEAT_LIMITS[tierId] || 0;
}
