/**
 * @license
 * SPDX-License-Identifier: Apache-2.0
 */

export type MainSection = 'dashboard' | 'stores' | 'inventory' | 'orders' | 'users' | 'settings' | 'reports' | 'operations' | 'admin-console' | 'sales_revenue' | 'dispatch' | 'catalogue' | 'pos';

export interface KPICardData {
  title: string;
  value: string;
  subtext: string;
  trend?: string;
  isPositive?: boolean;
  sparkline: number[];
  badge?: string;
}

export interface RevenueHeatmapDay {
  day: string;
  hours: {
    '08:00': number;
    '10:00': number;
    '12:00': number;
    '14:00': number;
    '16:00': number;
    '18:00': number;
    '20:00': number;
  };
}

export interface LeaderboardNode {
  rank: string;
  name: string;
  percentage: number;
  revenue: string;
}

export interface ProductMatrixItem {
  id: string;
  name: string;
  sku: string;
  unitsSold: number;
  revenue: number;
  stockStatus: 'Healthy' | 'Low Stock' | 'Critical';
  trend: 'up' | 'flat' | 'down';
  image: string;
  category: string;
  exposure: string;
  verified: boolean;
  isNew?: boolean;
  price?: number;
  isSample?: boolean;
  description?: string;
  fssaiLicense?: string;
  highlights?: string[];
  nutrients?: string[];
  providers?: string[];
  brand?: string;
  priceRange?: string;
}

export interface InventoryItem {
  sku: string;
  name: string;
  warehouse: string;
  stockLevel: number;
  maxCapacity: number;
  status: 'Optimal' | 'Low Stock' | 'Critical';
  // Region/zone label. Live data supplies the outlet name; the static seed used
  // CBE-* zone codes, so this stays a free string.
  region: string;
}

export interface OrderItem {
  id: string;
  store: string;
  amount: number;
  time: string;
  status: 'SHIPPED' | 'FLAGGED' | 'PROCESSING';
}

export interface ImportLog {
  timestamp: string;
  batchRef: string;
  type: string;
  source: string;
  result: string;
  status: 'SUCCESS' | 'FAILED';
}

export interface OperationalAlert {
  id: string;
  type: 'critical' | 'warning' | 'info';
  title: string;
  details: string;
  time: string;
}

export interface CustomerOrder {
  id: string;
  customerName: string;
  phone: string;
  address: string;
  items: Array<{ name: string; quantity: number | string; price: number }>;
  amount: number;
  time: string;
  status: 'DELIVERED' | 'OUT_FOR_DELIVERY' | 'CONFIRMED' | 'PROCESSING';
  assignedRider: string;
  hub: string;
  // Live deliveries return a line-item count without the lines themselves;
  // when present, views show this instead of items.length.
  itemCount?: number;
  locationid?: number;
}

export interface RegionalPerformance {
  region: string;
  sales: string;
  revenueValue: number;
  maxTarget: number;
}
