// Auto-generated types for ShopApp

// ─── Base ───────────────────────────────────────────


// ─── Base ───────────────────────────────────────────
export interface User {
  id: string;
  phone: string;
  nickname: string;
  avatarUrl: string;
  createdAt: string;
  updatedAt: string;
}
export interface Product {
  id?: string;
  userId: string;
  title: string;
  description?: string;
  price?: number;
  stock?: number;
  images?: Record<string, unknown>;
  createdAt?: string;
  updatedAt?: string;
}

export interface Order {
  id?: string;
  userId: string;
  status?: string;
  totalAmount?: number;
  addressId?: 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 Suppliers {
  id: string;
  userId?: string;
  name: string;
  contact?: string;
  phone?: string;
  email?: string;
  address?: string;
  createdAt?: string;
  updatedAt?: string;
}

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


// ─── 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[]>;
}