export type CourseStatus = 'Draft' | 'Published';
export type ResourceType = 'Url' | 'Video' | 'Text' | 'File';

export interface User {
  id: string;
  name: string;
  email: string;
  createdAt: string;
}

export interface LoginResponse {
  userId: string;
  name: string;
  email: string;
}

export interface Course {
  id: string;
  title: string;
  description: string;
  status: CourseStatus;
  creatorId: string;
  creatorName: string;
  topicCount: number;
  createdAt: string;
  updatedAt: string;
}

export interface CourseDetails extends Course {
  topics: Topic[];
}

export interface Topic {
  id: string;
  title: string;
  description?: string;
  position: number;
  courseId: string;
  resources: Resource[];
}

export interface Resource {
  id: string;
  type: ResourceType;
  title: string;
  content: string;
  createdAt: string;
}

export interface Enrollment {
  userId: string;
  courseId: string;
  courseTitle: string;
  enrolledAt: string;
  completedAt?: string;
}

export interface CourseProgress {
  courseId: string;
  userId: string;
  totalTopics: number;
  completedTopics: number;
  totalResources: number;
  completedResources: number;
  progressPercentage: number;
}

export interface EnrollmentWithProgress extends Enrollment {
  progress?: CourseProgress;
}
