export type SubscriptionPlanName = 'FREE_TRIAL' | 'STARTER' | 'PROFESSIONAL' | 'ENTERPRISE';

export interface PlanLimits {
  deliveries: number;    // per month
  customers: number;     // total
  products: number;      // active products
  api_requests: number;  // per month
  team_members: number;  // total users
}

export interface PlanConfig {
  name: string;
  features: string[];
  limits: PlanLimits;
  pricing: {
    monthly: number;
    semi: number;   // per month
    annual: number; // per month
  };
}

export const PLANS_CONFIG: Record<SubscriptionPlanName, PlanConfig> = {
  FREE_TRIAL: {
    name: 'Free Trial',
    features: ['payment_gateway'], // only payment gateway is allowed, WooCommerce is locked
    limits: {
      deliveries: 10,
      customers: 50,
      products: 20,
      api_requests: 0,
      team_members: 1,
    },
    pricing: {
      monthly: 0,
      semi: 0,
      annual: 0,
    },
  },
  STARTER: {
    name: 'Starter',
    features: ['payment_gateway'],
    limits: {
      deliveries: 100,
      customers: 500,
      products: 150,
      api_requests: 0,
      team_members: 1,
    },
    pricing: {
      monthly: 29,
      semi: 24,
      annual: 19,
    },
  },
  PROFESSIONAL: {
    name: 'Professional',
    features: [
      'woocommerce',
      'payment_gateway',
      'api_access',
      'workflow_automation',
      'advanced_reporting',
      'multi_user',
    ],
    limits: {
      deliveries: 1000,
      customers: 5000,
      products: 1000,
      api_requests: 10000,
      team_members: 5,
    },
    pricing: {
      monthly: 69,
      semi: 55,
      annual: 45,
    },
  },
  ENTERPRISE: {
    name: 'Enterprise',
    features: [
      'woocommerce',
      'payment_gateway',
      'api_access',
      'workflow_automation',
      'advanced_reporting',
      'multi_user',
    ],
    limits: {
      deliveries: 999999, // unlimited
      customers: 999999,
      products: 999999,
      api_requests: 999999,
      team_members: 999999,
    },
    pricing: {
      monthly: 149,
      semi: 125,
      annual: 99,
    },
  },
};
