export type AssignmentState = "active" | "planned" | "past" | "start_expired" | "archived";

export interface Assignment {
  id: number;
  title: string;
  entity_id: number;
  entity_name: string;
  start_date: string;
  end_date: string;
  state: AssignmentState;
  classrooms: AssignmentClassroom[];
  exams: AssignmentExam[];
  assignee_count: number;
  completed_count: number;
  subject_id?: number;
}

export interface AssignmentClassroom {
  id: number;
  name: string;
}

export interface AssignmentExam {
  id: number;
  title: string;
  module: string;
}

export interface AssignmentCreateRequest {
  title: string;
  entity_id: number;
  start_date: string;
  end_date: string;
  classroom_ids: number[];
  exam_ids: number[];
  assignee_ids?: number[];
}

export type ScheduleState = "planned" | "active" | "past" | "start_expired" | "archived";

export interface ExamSchedule {
  id: number;
  name: string;
  exam_id: number | null;
  exam_title: string;
  entity_id: number | null;
  entity_name: string;
  start_date: string | null;
  end_date: string | null;
  state: ScheduleState;
  assign_mode: "entity" | "batch" | "individual";
  full_length: boolean;
  generate_different: boolean;
  auto_release_results: boolean;
  auto_start: boolean;
  official_exam: boolean;
  hide_assignee_details: boolean;
  batch_ids: number[];
  batch_names: string[];
  student_ids: number[];
  assignee_count: number;
  completed_count: number;
  created: string;
}

export interface ExamScheduleCreateRequest {
  name: string;
  exam_id: number;
  entity_id?: number;
  start_date: string;
  end_date: string;
  assign_mode: "entity" | "batch" | "individual";
  batch_ids?: number[];
  student_ids?: number[];
  full_length?: boolean;
  generate_different?: boolean;
  auto_release_results?: boolean;
  auto_start?: boolean;
  official_exam?: boolean;
  hide_assignee_details?: boolean;
}

export interface StudentExamAssignment {
  id: number;
  exam_id: number;
  exam_title: string;
  schedule_name: string;
  start_date: string | null;
  end_date: string | null;
  status: string;
  schedule_state: ScheduleState;
  auto_start: boolean;
  can_start: boolean;
}
