/**
 * Dummy Products Performance Data
 * Structure matches /woonoow/v1/analytics/products API response
 */

export interface ProductsOverview {
  items_sold: number;
  revenue: number;
  avg_price: number;
  low_stock_count: number;
  out_of_stock_count: number;
  change_percent: number;
}

export interface TopProduct {
  id: number;
  name: string;
  image: string;
  sku: string;
  items_sold: number;
  revenue: number;
  stock: number;
  stock_status: 'instock' | 'lowstock' | 'outofstock';
  views: number;
  conversion_rate: number;
}

export interface ProductByCategory {
  id: number;
  name: string;
  slug: string;
  products_count: number;
  revenue: number;
  items_sold: number;
  percentage: number;
}

export interface StockAnalysisProduct {
  id: number;
  name: string;
  sku: string;
  stock: number;
  threshold: number;
  status: 'low' | 'out' | 'slow';
  last_sale_date: string;
  days_since_sale: number;
}

export interface ProductsData {
  overview: ProductsOverview;
  top_products: TopProduct[];
  by_category: ProductByCategory[];
  stock_analysis: {
    low_stock: StockAnalysisProduct[];
    out_of_stock: StockAnalysisProduct[];
    slow_movers: StockAnalysisProduct[];
  };
}

export const DUMMY_PRODUCTS_DATA: ProductsData = {
  overview: {
    items_sold: 1847,
    revenue: 344750000,
    avg_price: 186672,
    low_stock_count: 4,
    out_of_stock_count: 2,
    change_percent: 18.5,
  },
  top_products: [
    {
      id: 1,
      name: 'Wireless Headphones Pro',
      image: '🎧',
      sku: 'WHP-001',
      items_sold: 24,
      revenue: 72000000,
      stock: 12,
      stock_status: 'instock',
      views: 342,
      conversion_rate: 7.0,
    },
    {
      id: 2,
      name: 'Smart Watch Series 5',
      image: '⌚',
      sku: 'SWS-005',
      items_sold: 18,
      revenue: 54000000,
      stock: 8,
      stock_status: 'lowstock',
      views: 298,
      conversion_rate: 6.0,
    },
    {
      id: 3,
      name: 'USB-C Hub 7-in-1',
      image: '🔌',
      sku: 'UCH-007',
      items_sold: 32,
      revenue: 32000000,
      stock: 24,
      stock_status: 'instock',
      views: 412,
      conversion_rate: 7.8,
    },
    {
      id: 4,
      name: 'Mechanical Keyboard RGB',
      image: '⌨️',
      sku: 'MKR-001',
      items_sold: 15,
      revenue: 22500000,
      stock: 6,
      stock_status: 'lowstock',
      views: 256,
      conversion_rate: 5.9,
    },
    {
      id: 5,
      name: 'Wireless Mouse Gaming',
      image: '🖱️',
      sku: 'WMG-001',
      items_sold: 28,
      revenue: 16800000,
      stock: 18,
      stock_status: 'instock',
      views: 384,
      conversion_rate: 7.3,
    },
    {
      id: 6,
      name: 'Laptop Stand Aluminum',
      image: '💻',
      sku: 'LSA-001',
      items_sold: 22,
      revenue: 12400000,
      stock: 14,
      stock_status: 'instock',
      views: 298,
      conversion_rate: 7.4,
    },
    {
      id: 7,
      name: 'Webcam 4K Pro',
      image: '📹',
      sku: 'WC4-001',
      items_sold: 12,
      revenue: 18500000,
      stock: 5,
      stock_status: 'lowstock',
      views: 186,
      conversion_rate: 6.5,
    },
    {
      id: 8,
      name: 'Portable SSD 1TB',
      image: '💾',
      sku: 'SSD-1TB',
      items_sold: 16,
      revenue: 28000000,
      stock: 10,
      stock_status: 'instock',
      views: 224,
      conversion_rate: 7.1,
    },
  ],
  by_category: [
    {
      id: 1,
      name: 'Electronics',
      slug: 'electronics',
      products_count: 42,
      revenue: 186500000,
      items_sold: 892,
      percentage: 54.1,
    },
    {
      id: 2,
      name: 'Accessories',
      slug: 'accessories',
      products_count: 38,
      revenue: 89200000,
      items_sold: 524,
      percentage: 25.9,
    },
    {
      id: 3,
      name: 'Computer Parts',
      slug: 'computer-parts',
      products_count: 28,
      revenue: 52800000,
      items_sold: 312,
      percentage: 15.3,
    },
    {
      id: 4,
      name: 'Gaming',
      slug: 'gaming',
      products_count: 16,
      revenue: 16250000,
      items_sold: 119,
      percentage: 4.7,
    },
  ],
  stock_analysis: {
    low_stock: [
      {
        id: 2,
        name: 'Smart Watch Series 5',
        sku: 'SWS-005',
        stock: 8,
        threshold: 10,
        status: 'low',
        last_sale_date: '2025-11-02',
        days_since_sale: 1,
      },
      {
        id: 4,
        name: 'Mechanical Keyboard RGB',
        sku: 'MKR-001',
        stock: 6,
        threshold: 10,
        status: 'low',
        last_sale_date: '2025-11-01',
        days_since_sale: 2,
      },
      {
        id: 7,
        name: 'Webcam 4K Pro',
        sku: 'WC4-001',
        stock: 5,
        threshold: 10,
        status: 'low',
        last_sale_date: '2025-11-02',
        days_since_sale: 1,
      },
      {
        id: 12,
        name: 'Phone Stand Adjustable',
        sku: 'PSA-001',
        stock: 4,
        threshold: 10,
        status: 'low',
        last_sale_date: '2025-10-31',
        days_since_sale: 3,
      },
    ],
    out_of_stock: [
      {
        id: 15,
        name: 'Monitor Arm Dual',
        sku: 'MAD-001',
        stock: 0,
        threshold: 5,
        status: 'out',
        last_sale_date: '2025-10-28',
        days_since_sale: 6,
      },
      {
        id: 18,
        name: 'Cable Organizer Set',
        sku: 'COS-001',
        stock: 0,
        threshold: 15,
        status: 'out',
        last_sale_date: '2025-10-30',
        days_since_sale: 4,
      },
    ],
    slow_movers: [
      {
        id: 24,
        name: 'Vintage Typewriter Keyboard',
        sku: 'VTK-001',
        stock: 42,
        threshold: 10,
        status: 'slow',
        last_sale_date: '2025-09-15',
        days_since_sale: 49,
      },
      {
        id: 28,
        name: 'Retro Gaming Controller',
        sku: 'RGC-001',
        stock: 38,
        threshold: 10,
        status: 'slow',
        last_sale_date: '2025-09-22',
        days_since_sale: 42,
      },
      {
        id: 31,
        name: 'Desktop Organizer Wood',
        sku: 'DOW-001',
        stock: 35,
        threshold: 10,
        status: 'slow',
        last_sale_date: '2025-10-01',
        days_since_sale: 33,
      },
    ],
  },
};
