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

/** 专家卷浏览 */

export namespace Expert {
  interface SamplePaperListItem {
    createName: string
    createTime: string
    fileName: string
    filePath: string
    id: number
    mainNumber: number
    paperType: string
    score: number
    secretNumber: number
    type: string
  }
  type GetSampleList = BaseDefine<
    MultipleQuery<{ mainNumber?: number; paperType: 'SAMPLE_A' | 'SAMPLE_B' }>,
    MultipleResult<SamplePaperListItem>
  >

  interface RfSampleListItem {
    createName: string
    createTime: string
    filePath: string
    id: number
    mainName: string
    mainNumber: number
    score: number
    scoreLevel: string
    secretNumber: number
  }

  type GetRfSampleList = BaseDefine<MultipleQuery<{ mainNumber?: number }>, MultipleResult<RfSampleListItem>>

  type UpdateMarkScore = BaseDefine<{ id?: number; scores: number[] }>

  interface StandardListItem {
    createName: string
    createTime: string
    fileName: string
    filePath: string
    id: number
    mainNumber: number
    score: number
    secretNumber: number
    taskId: number
  }

  type GetStandardList = BaseDefine<
    MultipleQuery<{
      mainNumber?: number
      dispensed: boolean | ''
      scoreStart?: number | string
      scoreEnd?: number | string
    }>,
    MultipleResult<StandardListItem>
  >

  type TransformStandardToSample = BaseDefine<{ id?: number }>

  interface ExpertAssessListItem {
    createName: string
    createTime: string
    filePath: string
    forceGroupNumber: number
    id: number
    mainName: string
    mainNumber: number
    score: number
    secretNumber: number
  }

  type GetExpertAssessList = BaseDefine<
    MultipleQuery<{
      mainNumber?: number
      forceGroupNumber?: number
    }>,
    MultipleResult<ExpertAssessListItem>
  >

  interface ExpertPickListItem {
    createName: string
    createTime: string
    filePath: string
    forceGroupNumber: number
    id: number
    mainName: string
    mainNumber: number
    role: string
    roleName: string
    score: number
    secretNumber: number
  }

  type GetExpertPickList = BaseDefine<
    MultipleQuery<{
      mainNumber?: number
      forceGroupNumber?: number
      paperType: ExpertPickType
      role: Exclude<ROLE, 'ADMIN'>
    }>,
    MultipleResult<ExpertPickListItem>
  >

  type DeletePaper = BaseDefine<{ id?: number }>

  export interface ApiMap {
    /** AB培训卷 */
    getSampleList: GetSampleList
    /** RF卷 */
    getRfSampleList: GetRfSampleList
    /** 修改分数 */
    updateMarkScore: UpdateMarkScore
    /** 获取标准卷 */
    getStandardList: GetStandardList
    /** 标准卷转样卷 */
    transformStandardToSample: TransformStandardToSample
    /** 强制考核卷列表 */
    getExpertAssessList: GetExpertAssessList
    /** 专家挑选卷 */
    getExpertPickList: GetExpertPickList
    /** 删除 */
    deletePaper: DeletePaper
  }
}
