/**
 * 全局枚举常量定义
 * 从 mock 数据迁移而来，供运行时代码统一引用
 */

// ==================== 订单状态 ====================

export enum OrderStatus {
  CANCELLED = 0,      // 已取消
  PENDING_PAYMENT = 1,// 待支付
  COMPLETED = 2,      // 已完成
  CLOSED = 3          // 已关闭
}

export const OrderStatusText: Record<number, string> = {
  [OrderStatus.CANCELLED]: '已取消',
  [OrderStatus.PENDING_PAYMENT]: '待支付',
  [OrderStatus.COMPLETED]: '已完成',
  [OrderStatus.CLOSED]: '已关闭'
};

export const OrderStatusColor: Record<number, string> = {
  [OrderStatus.CANCELLED]: '#94a3b8',
  [OrderStatus.PENDING_PAYMENT]: '#f59e0b',
  [OrderStatus.COMPLETED]: '#10b981',
  [OrderStatus.CLOSED]: '#64748b'
};

// ==================== 设备状态 ====================

export enum DeviceStatus {
  ONLINE = 1,       // 在线
  OFFLINE = 0,      // 离线
  MAINTENANCE = 2,  // 维护中
  ERROR = 3         // 故障
}

export const DeviceStatusText: Record<number, string> = {
  [DeviceStatus.ONLINE]: '在线',
  [DeviceStatus.OFFLINE]: '离线',
  [DeviceStatus.MAINTENANCE]: '维护中',
  [DeviceStatus.ERROR]: '故障'
};

export const DeviceStatusColor: Record<number, string> = {
  [DeviceStatus.ONLINE]: '#10b981',
  [DeviceStatus.OFFLINE]: '#94a3b8',
  [DeviceStatus.MAINTENANCE]: '#f59e0b',
  [DeviceStatus.ERROR]: '#ef4444'
};

// ==================== 商品状态 ====================

export enum ProductStatus {
  ACTIVE = 1,      // 在售
  INACTIVE = 0,    // 下架
  OUT_OF_STOCK = 2 // 缺货
}

export const ProductStatusText: Record<number, string> = {
  [ProductStatus.ACTIVE]: '在售',
  [ProductStatus.INACTIVE]: '已下架',
  [ProductStatus.OUT_OF_STOCK]: '缺货'
};

export const ProductStatusColor: Record<number, string> = {
  [ProductStatus.ACTIVE]: '#10b981',
  [ProductStatus.INACTIVE]: '#94a3b8',
  [ProductStatus.OUT_OF_STOCK]: '#ef4444'
};

// ==================== 库存状态 ====================

export enum InventoryStatus {
  NORMAL = 'normal',
  LOW = 'low',
  OUT = 'out'
}

export const InventoryStatusText: Record<string, string> = {
  [InventoryStatus.NORMAL]: '正常',
  [InventoryStatus.LOW]: '低库存',
  [InventoryStatus.OUT]: '缺货'
};

// ==================== 门店状态 ====================

export enum ShopStatus {
  ACTIVE = 1,       // 正常营业
  INACTIVE = 0,     // 停业
  MAINTENANCE = 2   // 维护中
}

export const ShopStatusText: Record<number, string> = {
  [ShopStatus.ACTIVE]: '营业中',
  [ShopStatus.INACTIVE]: '已停业',
  [ShopStatus.MAINTENANCE]: '维护中'
};

export const ShopStatusColor: Record<number, string> = {
  [ShopStatus.ACTIVE]: '#10b981',
  [ShopStatus.INACTIVE]: '#94a3b8',
  [ShopStatus.MAINTENANCE]: '#f59e0b'
};

// ==================== 用户/客户状态 ====================

export enum UserStatus {
  DISABLED = 0,   // 禁用
  ENABLED = 1     // 正常
}

export const UserStatusText: Record<number, string> = {
  [UserStatus.DISABLED]: '禁用',
  [UserStatus.ENABLED]: '正常'
};

// ==================== 通用分页参数 ====================

export const DEFAULT_PAGE_SIZE = 10;
export const MAX_PAGE_SIZE = 100;
