import { PageResult, PageParams } from './common';

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

export interface TaskListFilter {
  name: string;
}
export type TaskListPageParam = PageParams<TaskListFilter>;

export interface TaskItem {
  id: number;
  name: string;
  selfApplyStartTime: number;
  selfApplyEndTime: number;
  openApplyStartTime: number;
  openApplyEndTime: number;
  enable: number; // 1:启用；0:禁用
  updateTime: number;
}

export type TaskListPageRes = PageResult<TaskItem>;

export interface TaskItemDetail {
  id: number;
  name: string;
  allowApplyDays: number;
  allowApplyCancelDays: number;
  selfApplyStartTime: number;
  selfApplyEndTime: number;
  openApplyStartTime: number;
  openApplyEndTime: number;
  timeList: Array<{
    id: number | null;
    startTime: number | undefined;
    endTime: number | undefined;
  }>;
  notice: string;
}

export interface TaskRuleUpdateParams {
  id: number | null;
  name: string;
  allowApplyDays: number;
  allowApplyCancelDays: number;
  selfApplyStartTime: number | undefined;
  selfApplyEndTime: number | undefined;
  openApplyStartTime: number | undefined;
  openApplyEndTime: number | undefined;
}

export interface TaskTimeUpdateParams {
  id: number;
  timeJson: string;
}

export interface TaskNoticeUpdateParams {
  id: number;
  notice: string;
}

export interface OrderRecordItem {
  id: number;
  name: string;
  identityNumber: string;
  studentCode: string;
  teachingName: string; // 教学点
  agentName: string; // 考点
  roomName: string; // 考场
  seatNumber: string; // 座位号
  cancel: boolean; // 是否取消
  endTime: number;
  startTime: number;
  updateTime: number; // 操作时间
  userName: string; // 操作人
}
export type OrderRecordListPageRes = PageResult<OrderRecordItem>;
export interface OrderRecordListFilter {
  taskId: number | null;
  teachingId: number | null;
  agentId: number | null;
  name: string;
  identityNumber: string;
  studentCode: string;
}
export type OrderRecordListPageParam = PageParams<OrderRecordListFilter>;

export interface StudentExportItem {
  id: number;
  name: string;
  fileName: string;
  status: string;
  message: string | null;
  uploadTime: number;
}

export type StudentExportListPageRes = PageResult<StudentExportItem>;
