// Shared types for fullstack project
// Auto-generated — used by both apps/web and apps/api

// ─── Entities ────────────────────────────────────────
export interface User {
  id?: string;
  username: string;
  passwordHash: string;
  nickname?: string;
  role?: string;
  phone?: string;
  avatarUrl?: string;
  createdAt?: string;
  updatedAt?: string;
}

export interface Courses {
  id: string;
  userId?: string;
  title: string;
  description?: string;
  instructor?: string;
  price?: number;
  coverUrl?: string;
  category?: string;
  createdAt?: string;
  updatedAt?: string;
}

export interface Chapters {
  id: string;
  userId?: string;
  courseId?: string;
  title: string;
  sortOrder?: number;
  durationMin?: number;
  createdAt?: string;
  updatedAt?: string;
}

export interface Students {
  id: string;
  userId?: string;
  name: string;
  email?: string;
  enrolledAt?: string;
  progress?: number;
  createdAt?: string;
  updatedAt?: string;
}

export interface Assignments {
  id: string;
  userId?: string;
  courseId?: string;
  title: string;
  description?: string;
  dueDate?: string;
  maxScore?: number;
  createdAt?: string;
  updatedAt?: string;
}

// ─── API Response Wrappers ───────────────────────────
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;
}
