export interface PlatformAccount {
  id: string;
  tenantId: string;
  platform: string;
  accountName: string;
  accountId: string;
  status: 'ACTIVE' | 'INACTIVE' | 'EXPIRED' | 'ERROR';
  token?: string;
  refreshToken?: string;
  expiresAt?: string;
  shopId?: string;
  config?: Record<string, any>;
  lastSyncAt?: string;
  createdAt: string;
  updatedAt: string;
}

export interface PlatformAccountStats {
  total: number;
  active: number;
  inactive: number;
  expired: number;
  error: number;
}

export type Platform = 
  // TikTok系列
  | 'TIKTOK' | 'TIKTOK_FULL' 
  // Shopee系列
  | 'SHOPEE' | 'SHOPEE_FULL' | 'SHOPEE_LIGHT' 
  // Lazada系列
  | 'LAZADA' | 'LAZADA_FULL' 
  // Temu
  | 'TEMU_FULL' 
  // SHEIN系列
  | 'SHEIN' | 'SHEIN_HALF' 
  // 其他平台
  | 'OZON' | 'YANDEX' | 'ALIEXPRESS' | 'ALIEXPRESS_HALF' | 'ALIEXPRESS_POP' 
  | 'COUPANG' | 'WALMART' | 'WILDBERRIES' | 'ALLEGRO' | 'MERCADO_LIBRE' 
  | 'JUMIA' | 'JOOM' | 'AMAZON' | 'WISH' | 'EMAG' | 'MIRAVIA' 
  | 'DARAZ' | 'JOYBUY' | 'ALIBABA' | 'QOO10' | 'SHOPIFY' | 'SHOPLAZZA' 
  | 'SHOPYY_V1' | 'SHOPYY_V2' | 'SHOPLINE' | 'GREATBOSS' | 'OTHER' 
  // 原有平台
  | 'EBAY';

export interface PlatformConfig {
  name: string;
  icon: string;
  color: string;
  authType: 'OAUTH' | 'API_KEY' | 'SESSION';
}

export const PLATFORM_CONFIGS: Record<Platform, PlatformConfig> = {
  // TikTok系列
  TIKTOK: {
    name: 'TikTok',
    icon: 'video-camera',
    color: 'cyan',
    authType: 'OAUTH',
  },
  TIKTOK_FULL: {
    name: 'TikTok全托管',
    icon: 'video-camera',
    color: 'cyan',
    authType: 'OAUTH',
  },
  
  // Shopee系列
  SHOPEE: {
    name: 'Shopee',
    icon: 'shop',
    color: 'red',
    authType: 'OAUTH',
  },
  SHOPEE_FULL: {
    name: 'Shopee全托管',
    icon: 'shop',
    color: 'red',
    authType: 'OAUTH',
  },
  SHOPEE_LIGHT: {
    name: 'Shopee轻出海',
    icon: 'shop',
    color: 'red',
    authType: 'OAUTH',
  },
  
  // Lazada系列
  LAZADA: {
    name: 'Lazada',
    icon: 'shop',
    color: 'purple',
    authType: 'OAUTH',
  },
  LAZADA_FULL: {
    name: 'Lazada全托管',
    icon: 'shop',
    color: 'purple',
    authType: 'OAUTH',
  },
  
  // Temu
  TEMU_FULL: {
    name: 'Temu全托管',
    icon: 'shop',
    color: 'green',
    authType: 'API_KEY',
  },
  
  // SHEIN系列
  SHEIN: {
    name: 'SHEIN',
    icon: 'shop',
    color: 'pink',
    authType: 'API_KEY',
  },
  SHEIN_HALF: {
    name: 'SHEIN半托管',
    icon: 'shop',
    color: 'pink',
    authType: 'API_KEY',
  },
  
  // 其他平台
  OZON: {
    name: 'Ozon',
    icon: 'shop',
    color: 'yellow',
    authType: 'API_KEY',
  },
  YANDEX: {
    name: 'Yandex',
    icon: 'shop',
    color: 'blue',
    authType: 'OAUTH',
  },
  ALIEXPRESS: {
    name: 'AliExpress',
    icon: 'shop',
    color: 'orange',
    authType: 'API_KEY',
  },
  ALIEXPRESS_HALF: {
    name: '速卖通半托管',
    icon: 'shop',
    color: 'orange',
    authType: 'API_KEY',
  },
  ALIEXPRESS_POP: {
    name: '速卖通本土POP',
    icon: 'shop',
    color: 'orange',
    authType: 'API_KEY',
  },
  COUPANG: {
    name: 'Coupang',
    icon: 'shop',
    color: 'red',
    authType: 'API_KEY',
  },
  WALMART: {
    name: 'Walmart',
    icon: 'shop',
    color: 'blue',
    authType: 'OAUTH',
  },
  WILDBERRIES: {
    name: 'Wildberries',
    icon: 'shop',
    color: 'purple',
    authType: 'API_KEY',
  },
  ALLEGRO: {
    name: 'Allegro',
    icon: 'shop',
    color: 'green',
    authType: 'API_KEY',
  },
  MERCADO_LIBRE: {
    name: 'Mercado Libre',
    icon: 'shop',
    color: 'yellow',
    authType: 'OAUTH',
  },
  JUMIA: {
    name: 'Jumia',
    icon: 'shop',
    color: 'blue',
    authType: 'API_KEY',
  },
  JOOM: {
    name: 'Joom',
    icon: 'shop',
    color: 'purple',
    authType: 'API_KEY',
  },
  AMAZON: {
    name: 'Amazon',
    icon: 'amazon',
    color: 'orange',
    authType: 'OAUTH',
  },
  WISH: {
    name: 'Wish',
    icon: 'shop',
    color: 'blue',
    authType: 'API_KEY',
  },
  EMAG: {
    name: 'eMAG',
    icon: 'shop',
    color: 'green',
    authType: 'API_KEY',
  },
  MIRAVIA: {
    name: 'Miravia',
    icon: 'shop',
    color: 'pink',
    authType: 'API_KEY',
  },
  DARAZ: {
    name: 'Daraz',
    icon: 'shop',
    color: 'blue',
    authType: 'API_KEY',
  },
  JOYBUY: {
    name: 'Joybuy',
    icon: 'shop',
    color: 'red',
    authType: 'API_KEY',
  },
  ALIBABA: {
    name: 'Alibaba',
    icon: 'shop',
    color: 'orange',
    authType: 'API_KEY',
  },
  QOO10: {
    name: 'Qoo10',
    icon: 'shop',
    color: 'red',
    authType: 'API_KEY',
  },
  SHOPIFY: {
    name: 'Shopify',
    icon: 'shopify',
    color: 'green',
    authType: 'OAUTH',
  },
  SHOPLAZZA: {
    name: 'Shoplazza',
    icon: 'shop',
    color: 'blue',
    authType: 'API_KEY',
  },
  SHOPYY_V1: {
    name: 'SHOPYY v1.0',
    icon: 'shop',
    color: 'purple',
    authType: 'API_KEY',
  },
  SHOPYY_V2: {
    name: 'SHOPYY v2.0',
    icon: 'shop',
    color: 'purple',
    authType: 'API_KEY',
  },
  SHOPLINE: {
    name: 'SHOPLINE',
    icon: 'shop',
    color: 'green',
    authType: 'API_KEY',
  },
  GREATBOSS: {
    name: 'GreatBoss',
    icon: 'shop',
    color: 'blue',
    authType: 'API_KEY',
  },
  OTHER: {
    name: '其他',
    icon: 'shop',
    color: 'default',
    authType: 'API_KEY',
  },
  
  // 原有平台
  EBAY: {
    name: 'eBay',
    icon: 'ebay',
    color: 'blue',
    authType: 'OAUTH',
  },
};
