// Auto-generated types

// ─── Base ───────────────────────────────────────────
export interface User {
  id: string;
  username: string;
  nickname?: string;
  role: string;
  createdAt: string;
  updatedAt: string;
}

export interface Food {
  id: string;
  userId?: string;
  title: string;
  description?: string;
  status?: string;
  data?: string;
  createdAt?: string;
  updatedAt?: string;
}

export interface Customer {
  id: string;
  userId?: string;
  title: string;
  description?: string;
  status?: string;
  data?: string;
  createdAt?: string;
  updatedAt?: string;
}

export interface MealPlan {
  id: string;
  userId?: string;
  title: string;
  description?: string;
  status?: string;
  data?: string;
  createdAt?: string;
  updatedAt?: string;
}

export interface Nutrition {
  id: string;
  userId?: string;
  title: string;
  description?: string;
  status?: string;
  data?: string;
  createdAt?: string;
  updatedAt?: string;
}

export interface ShoppingList {
  id: string;
  userId?: string;
  title: string;
  description?: string;
  status?: string;
  data?: string;
  createdAt?: string;
  updatedAt?: string;
}

export interface Template {
  id: string;
  userId?: string;
  title: string;
  description?: string;
  status?: string;
  data?: string;
  createdAt?: string;
  updatedAt?: string;
}

export interface Product {
  id: string;
  title: string;
  price: number;
  stock?: number;
  images?: string;
  categoryId?: string;
  createdAt?: string;
}

export interface Order {
  id: string;
  userId?: string;
  status?: string;
  totalAmount?: number;
  addressId?: string;
  createdAt?: string;
}

export interface OrderItem {
  id: string;
  orderId?: string;
  productId?: string;
  quantity: number;
  unitPrice?: number;
}

export interface Logistic {
  id: string;
  orderId?: string;
  carrier?: string;
  trackingNumber?: string;
  status?: string;
  events?: string;
  updatedAt?: string;
}

export interface CreateUserInput {
  phone?: string;
  nickname?: string;
  avatarUrl?: string;
}

export interface CreateFoodInput {
  userId?: string;
  title: string;
  description?: string;
  status?: string;
  data?: string;
}

export interface CreateCustomerInput {
  userId?: string;
  title: string;
  description?: string;
  status?: string;
  data?: string;
}

export interface CreateMealPlanInput {
  userId?: string;
  title: string;
  description?: string;
  status?: string;
  data?: string;
}

export interface CreateNutritionInput {
  userId?: string;
  title: string;
  description?: string;
  status?: string;
  data?: string;
}

export interface CreateShoppingListInput {
  userId?: string;
  title: string;
  description?: string;
  status?: string;
  data?: string;
}

export interface CreateTemplateInput {
  userId?: string;
  title: string;
  description?: string;
  status?: string;
  data?: string;
}

export interface CreateProductInput {
  title: string;
  price: number;
  stock?: number;
  images?: string;
  categoryId?: string;
}

export interface CreateOrderInput {
  userId?: string;
  status?: string;
  totalAmount?: number;
  addressId?: string;
}

export interface CreateOrderItemInput {
  orderId?: string;
  productId?: string;
  quantity: number;
  unitPrice?: number;
}

export interface CreateLogisticInput {
  orderId?: string;
  carrier?: string;
  trackingNumber?: string;
  status?: string;
  events?: string;
}

export interface UpdateUserInput {
  phone?: string;
  nickname?: string;
  avatarUrl?: string;
}

export interface UpdateFoodInput {
  userId?: string;
  title?: string;
  description?: string;
  status?: string;
  data?: string;
}

export interface UpdateCustomerInput {
  userId?: string;
  title?: string;
  description?: string;
  status?: string;
  data?: string;
}

export interface UpdateMealPlanInput {
  userId?: string;
  title?: string;
  description?: string;
  status?: string;
  data?: string;
}

export interface UpdateNutritionInput {
  userId?: string;
  title?: string;
  description?: string;
  status?: string;
  data?: string;
}

export interface UpdateShoppingListInput {
  userId?: string;
  title?: string;
  description?: string;
  status?: string;
  data?: string;
}

export interface UpdateTemplateInput {
  userId?: string;
  title?: string;
  description?: string;
  status?: string;
  data?: string;
}

export interface UpdateProductInput {
  title?: string;
  price?: number;
  stock?: number;
  images?: string;
  categoryId?: string;
}

export interface UpdateOrderInput {
  userId?: string;
  status?: string;
  totalAmount?: number;
  addressId?: string;
}

export interface UpdateOrderItemInput {
  orderId?: string;
  productId?: string;
  quantity?: number;
  unitPrice?: number;
}

export interface UpdateLogisticInput {
  orderId?: string;
  carrier?: string;
  trackingNumber?: string;
  status?: string;
  events?: string;
}

// ─── Auth ───────────────────────────────────────────
export interface LoginInput {
  username: string;
  password: string;
}

export interface RegisterInput {
  username: string;
  password: string;
  nickname?: string;
}

export interface AuthResponse {
  token: string;
  user: User;
}

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

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

export interface ErrorResponse {
  error: string;
  message: string;
  statusCode: number;
}

// ─── JWT ────────────────────────────────────────────
export interface JwtPayload {
  userId: string;
  username: string;
  role: string;
  iat?: number;
  exp?: number;
}
