/**
 * Namespace Api
 *
 * All backend api type
 */
declare namespace Api {
  /**
   * namespace Art
   *
   * backend api module: "Art"
   */
  namespace Art {
    /** school */
    type School = Common.CommonRecord<{
      /** 学校主键ID */
      schoolId: CommonType.IdType;
      /** 租户编号 */
      tenantId: CommonType.IdType;
      /** 学校编码（唯一标识，如国标代码） */
      mainCode: string;
      /** 学校主名称（官方全称） */
      mainName: string;
      /** 学校简称（备用） */
      shortName: string;
      /** 院校招生代码集合 */
      enrollCodes: string[];
      /** 学校标签列表 */
      schoolTags: string[];
      /** 院校图标 */
      schoolIcon: string;
      /** 省份 */
      province: string;
      /** 城市 */
      city: string;
      /** 区县 */
      district: string;
      /** 大学类型：综合/工科/财经/艺术... */
      universityType: string;
      /** 学历层次：本科/专科 */
      educationLevel: string;
      /** 办学性质：公办/民办/中外合作 */
      schoolNature: string;
      /** 主管部门：教育部/工信部/民委... */
      supervisorDept: string;
      /** 建校时间(年) */
      establishYear: number;
      /** 占地面积(亩) */
      campusAreaMu: number;
      /** 男生比例(%) */
      maleRatio: number;
      /** 女生比例(%) */
      femaleRatio: number;
      /** 删除标志（0代表存在 1代表删除） */
      delFlag: string;
      /** 备注 */
      remark: string;
    }>;

    /** school search params */
    type SchoolSearchParams = CommonType.RecordNullable<
      Pick<
        Api.Art.School,
        | 'schoolId'
        | 'mainCode'
        | 'mainName'
        | 'shortName'
        | 'schoolIcon'
        | 'province'
        | 'city'
        | 'district'
        | 'universityType'
        | 'educationLevel'
        | 'schoolNature'
        | 'supervisorDept'
        | 'establishYear'
        | 'campusAreaMu'
        | 'maleRatio'
        | 'femaleRatio'
      > &
        Api.Common.CommonSearchParams
    >;

    /** school operate params */
    type SchoolOperateParams = CommonType.RecordNullable<
      Pick<
        Api.Art.School,
        | 'schoolId'
        | 'mainCode'
        | 'mainName'
        | 'shortName'
        | 'schoolIcon'
        | 'province'
        | 'city'
        | 'district'
        | 'universityType'
        | 'educationLevel'
        | 'schoolNature'
        | 'supervisorDept'
        | 'establishYear'
        | 'campusAreaMu'
        | 'maleRatio'
        | 'femaleRatio'
        | 'remark'
      >
    >;

    /** school detail operate params in school form */
    type SchoolDetailInSchoolOperateParams = CommonType.RecordNullable<
      Pick<
        Api.Art.SchoolDetail,
        'detailId' | 'schoolId' | 'introduction' | 'address' | 'contact' | 'email' | 'website' | 'remark'
      >
    >;

    /** school + detail operate params */
    type SchoolWithDetailOperateParams = {
      /** 学校基础信息 */
      school: SchoolOperateParams;
      /** 学校详情信息 */
      detail: SchoolDetailInSchoolOperateParams;
      /** 院校招生代码集合（与 school、detail 同级） */
      enrollCodes?: string[] | null;
      /** 学校标签列表（与 school、detail 同级） */
      schoolTags?: string[] | null;
    };

    /** school + detail submit status */
    type SchoolWithDetailSubmitStatus = CommonType.RecordNullable<{
      schoolSuccess: boolean;
      detailSuccess: boolean;
      schoolStatus: string;
      detailStatus: string;
      schoolMessage: string;
      detailMessage: string;
    }>;

    /** school import detail */
    type SchoolImportDetail = CommonType.RecordNullable<{
      mainCode: string;
      mainName: string;
      status: 'CONFLICT' | 'INVALID' | 'SUCCESS' | 'SKIPPED' | 'FAILED';
      message: string;
    }>;

    /** school import preview result */
    type SchoolImportPreviewResult = CommonType.RecordNullable<{
      totalSchoolCount: number;
      conflictCount: number;
      invalidCount: number;
      details: SchoolImportDetail[];
    }>;

    /** school import execute result */
    type SchoolImportExecuteResult = CommonType.RecordNullable<{
      totalSchoolCount: number;
      successCount: number;
      failCount: number;
      skippedCount: number;
      details: SchoolImportDetail[];
    }>;

    /** school import params */
    type SchoolImportParams = {
      file: File;
      replaceAll?: boolean;
      replaceMainCodes?: string[];
    };

    /** school list */
    type SchoolList = Api.Common.PaginatingQueryRecord<School>;
  }
}
