export type ProductStatus =
  | 'draft'
  | 'pending_review'
  | 'online'
  | 'offline'
  | 'rejected';

export interface ProductItem {
  id: string;
  name: string;
  category: string;
  sku: string;
  originalPrice: number;
  salePrice: number;
  costPrice?: number;
  stock: number;
  safetyStock: number;
  status: ProductStatus;
  description?: string;
  imageUrl?: string;
  createdAt: string;
  updatedAt: string;
}

export interface ProductListParams {
  name?: string;
  category?: string;
  sku?: string;
  status?: ProductStatus;
  stockWarning?: 'all' | 'warning' | 'empty';
  current?: number;
  pageSize?: number;
}

export interface ProductListResponse {
  data: ProductItem[];
  total: number;
  success: boolean;
}

export interface ProductFormValues {
  id?: string;
  name: string;
  category: string;
  sku: string;
  originalPrice: number;
  salePrice: number;
  costPrice?: number;
  stock: number;
  safetyStock: number;
  status: ProductStatus;
  description?: string;
  imageUrl?: string;
}

export interface ProductSearchValues {
  name?: string;
  category?: string;
  sku?: string;
  status?: ProductStatus;
  stockWarning?: 'all' | 'warning' | 'empty';
}

export interface ProductStatusUpdatePayload {
  ids: string[];
  status: Extract<ProductStatus, 'online' | 'offline'>;
}
