// Auto-generated types for warehouse-mgmt

// ─── Base ───────────────────────────────────────────
export interface User {
  id: string;
  phone: string;
  nickname: string;
  avatarUrl: string;
  createdAt: string;
  updatedAt: string;
}

export interface Items {
  id: string;
  userId?: string;
  title: string;
  description?: string;
  status?: string;
  data?: Record<string, unknown>;
  createdAt?: string;
  updatedAt?: string;
}

export interface StockIn {
  id: string;
  userId?: string;
  productName: string;
  quantity: number;
  supplier?: string;
  receivedBy?: string;
  receivedAt?: string;
  createdAt?: string;
  updatedAt?: string;
}

export interface StockOut {
  id: string;
  userId?: string;
  productName: string;
  quantity: number;
  recipient?: string;
  approvedBy?: string;
  shippedAt?: string;
  createdAt?: string;
  updatedAt?: string;
}

export interface Stocktaking {
  id: string;
  userId?: string;
  warehouse?: string;
  productName?: string;
  expectedQty?: number;
  actualQty?: number;
  diff?: number;
  stocktakenAt?: string;
  createdAt?: string;
  updatedAt?: string;
}

export interface StockAlerts {
  id: string;
  userId?: string;
  productName: string;
  currentQty?: number;
  threshold?: number;
  alertedAt?: string;
  createdAt?: string;
  updatedAt?: string;
}

export interface Warehouse {
  id: string;
  userId?: string;
  productName: string;
  quantity: number;
  supplier?: string;
  receivedBy?: string;
  receivedAt?: string;
  createdAt?: string;
  updatedAt?: string;
}

// Alias for NoteCard compatibility
export type Note = Items;

// ─── API Responses ──────────────────────────────────
export interface ApiResponse<T> {
  data: T;
  message: string;
}

export interface PaginatedResponse<T> extends ApiResponse<T[]> {
  total: number;
  page: number;
  pageSize: number;
}

export interface ApiError {
  code: string;
  message: string;
  details?: Record<string, string[]>;
}
