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

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

    /** disable question library params */
    interface DisableQuestionLibraryParams {
      /** question library id */
      Id: number
      /** is disabled 0: no 1: yes */
      IsDisabled: boolean
    }

    /** get question library list all params */
    interface GetQuestionLibraryListAllParams {
      /** question id */
      questionId: number
      /** pageIndex page number */
      pageIndex: number
      /** page size */
      pageSizes: number
      /** search keyword */
      keyWords?: string
    }

    /** add params */
    interface AddParams {
      /** question id */
      id: number
      /** question name */
      name: string
      /** question content */
      questionContent: string
      /** question type */
      questionType: QuestionType
    }

    /** add question library params */
    interface AddQuestionLibraryParams {
      /** question library id */
      id: number
      /** question library name */
      name: string
      /** question library content */
      answer: string
      /** question id */
      questionId: number
      /** question library image url */
      imageUrl: string
      /** question library type */
      // type?: QuestionScoreType
      /** is priority 0: no 1: yes */
      IsGood: number
      /** is disabled */
      IsDisabled: boolean
      /** keyword */
      KeyWord: string
      /** keyword index */
      KeyWordsIndex: number
    }

    /** update question library params */
    interface UpdateQuestionLibraryParams extends AddQuestionLibraryParams {
      /** question library id */
      id: number
    }

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

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

    /** 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
  }
}
