/**
 * Namespace Api
 *
 * All backend api type
 */
declare namespace Api {
  namespace Competition {
    /** common params of paginating */
    interface PaginatingCommonParams {
      /** current page number */
      current: number
      /** page size */
      size: number
      /** total count */
      total: number
    }

    /** common params of paginating query list data */
    interface PaginatingQueryRecord<T = any> extends PaginatingCommonParams {
      records: T[]
    }

    /** common search params of table */
    type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'current' | 'size'>

    /**
     * enable status
     *
     * - "1": enabled
     * - "2": disabled
     */
    type EnableStatus = '1' | '2'

    /** question ui type */
    type QuestionUiType = '1' | '2' | '3' | '4' /** 文本输入 | 单选 | 多选 | 下拉选择 */

    /** question time type */
    type QuestionTimeType = 5 | 10 | 15 | 20 | 30 | 45 | 60 | 90 /** 5s | 10s | 15s | 20s | 30s | 45s | 60s | 90s */

    /** question template id */
    type QuestionTemplateId =
      | 'TEMPLATE_DICTATION_HINT'
      | 'TEMPLATE_DICTATION_HOMOPHONE'
      | 'TEMPLATE_COMPONENT_ADD'
      | 'TEMPLATE_WORD_DICTATION'
      | 'TEMPLATE_IDIOM_TEXT_REQ'
      | 'TEMPLATE_IDIOM_IMAGE' /** 汉字听写-提示 | 汉字听写-同音 | 汉字加一加 | 词语听写 | 成语-文字要求 | 成语-看图 */

    /** question score type */
    type QuestionScoreType = '1' | '2' /** 固定分数 | 答题个数 */

    /** competition round type */
    type CompetitionRoundType = '1' | '2' /** 题包环节 | 加时环节 */

    /** common record */
    type CommonRecord<T = any> = {
      /** record id */
      id: number
      /** record creator */
      createBy: string
      /** record create time */
      createTime: string
      /** record updater */
      updateBy: string
      /** record update time */
      updateTime: string
      /** record status */
      status: EnableStatus | null
    } & T
  }
}
