import { BaseDefine, MultipleQuery, MultipleResult } from './base'

/** meta data  基础数据导入配置 */
export namespace System {
  /** 评卷数据导入 */
  interface MarkingDataImport {
    dayNumber?: number
    file?: File
    mainNumber?: number
    separator: string
    subjectCode: string
  }

  type ImportMarkingData = BaseDefine<MarkingDataImport>

  /** 获取导入文件路径 */
  type GetImportFilePath = BaseDefine<
    {
      filePathType: 'SLICE' | 'SAMPLE_A' | 'SAMPLE_B' | 'RF' | 'MARK_STANDARD'
      mainNumber?: number
      subjectCode: string
    },
    { rfPath: string; sampleAPath: string; sampleBPath: string; markStandardPath: string }
  >

  interface SamplePaperImport {
    file?: File
    /** 大题号 */
    mainNumber?: number
    /** 试卷类型 */
    paperType?: SamplePaperType
    /** 试卷密码前缀 */
    prefix: string
    /** 分隔符 */
    separator: string
    /** 科目代码 */
    subjectCode: string
  }

  type ImportSamplePaper = BaseDefine<SamplePaperImport>

  interface RfPaperImport {
    file?: File
    /** 试卷密码前缀 */
    prefix: string
    /** 大题号 */
    mainNumber?: number
    /** 科目代码 */
    subjectCode: string
    /** 分隔符 */
    separator: string
  }

  type ImportRfPaper = BaseDefine<RfPaperImport>

  interface ScoreListItem {
    /** 作文评卷员代码 */
    compositionMarker: string
    /** 作文雷同标记 */
    compositionSame: string
    /** 作文分 */
    compositionScore: string
    /** 作文评卷标志 */
    compositionTag: string
    /** 准考证号 */
    examNumber: string
    id: number
    /** 科目代码 */
    subjectCode: string
    /** 主观分 */
    subjectScore: string
    /** 翻译评卷员代码 */
    translateMarker: string
    /** 翻译雷同标记 */
    translateSame: string
    /** 翻译分 */
    translateScore: string
    /** 翻译评卷标志 */
    translateTag: string
  }

  type GetCetScoreList = BaseDefine<MultipleQuery<{ subjectCode: string }>, MultipleResult<ScoreListItem>>

  type ExportCetScoreList = BaseDefine<{ subjectCode: string }, null>

  /** 任务设置 - 按评卷员设置 */
  type MarkerSetCount = BaseDefine<{ markDayCount?: number; markTotalCount?: number; userId: number[] }>

  /** 任务设置 - 按小组追加 */
  type MarkGroupUpdateCount = BaseDefine<{
    markCount?: number
    markingGroupNumber?: number
    mainNumber?: number
    subjectCode?: string
  }>

  /** 任务设置-获取任务计划 */
  interface TaskDetail {
    finishCount: number
    markCount: number
    markingGroupNumber: number
  }
  type GetTaskDetail = BaseDefine<
    {
      mainNumber?: number
      markingGroupNumber?: number
      subjectCode?: string
    },
    TaskDetail[]
  >
  /** 任务设置-获取剩余任务 */
  type GetUnMarkTasks = BaseDefine<
    {
      mainNumber?: number
      markingGroupNumber?: number
      subjectCode?: string
    },
    {
      unmarkCount: 0
    }
  >
  export interface ApiMap {
    importMarkingData: ImportMarkingData
    getImportFilePath: GetImportFilePath
    importSamplePaper: ImportSamplePaper
    importRfPaper: ImportRfPaper
    getCetScoreList: GetCetScoreList
    exportCetScoreList: ExportCetScoreList
    /** 任务设置 - 按评卷员设置 */
    markerSetCount: MarkerSetCount
    /** 任务设置 - 按小组追加 */
    markGroupUpdateCount: MarkGroupUpdateCount
    /** 任务设置-获取任务计划 */
    getTaskDetail: GetTaskDetail
    /** 任务设置-获取剩余任务 */
    getUnMarkTasks: GetUnMarkTasks
  }
}
