import {
  EUpDown,
  IAuditScoreLog,
  IAuditScoreRemark,
  IGatherYsProfileFile,
  IMatterNode,
  UploadMsg,
} from '..';

export namespace PostApprovalCopyGatherYsProfileFiles {
  export type Params = {
    fileDataList: {
      name: string;
      ext: string;
      size: any;
      path: string;
      createTime: number;
    }[];
    gypID: string;
  };

  export interface Response {
    fileList: IGatherYsProfileFile[];
    count: number;
  }
}

export namespace GetApprovalGetMatterData {
  export type Params = {
    businessID: string;
    getAllMatter?: boolean; // 是否获取全部matter
  };

  export type Response = Array<IMatterNode>;
}

export namespace GetApprovalGetYsProfileTreeWithFile {
  export type Params = { businessId: string; matterId: string };

  export type Response = Array<IMatterNode>;
}

export namespace PostApprovalCreateDir {
  export type Params = {
    parentID: string;
    name: string;
    matterListID: string;
    approvalID: string;
    matterID: string;
    businessID: string;
  };
}

export namespace GetApprovalGetGatherYsProfileByBusinessID {
  export type Params = { businessID: string; matterID: string };

  export type Response = {
    tree: any[];
    profileView: boolean;
    uploadMsg: UploadMsg;
    cadView: boolean;
    copy: boolean;
  };
}

export namespace PostApprovalEditDirName {
  export type Params = {
    dataID: string;
    businessID: string;
    name: string;
  };
}

export namespace PostApprovalUpdown {
  export type Params = {
    type: EUpDown;
    dataID: string;
    businessID: string;
  };
}

export namespace PostApprovalMoveTo {
  export type Params = {
    ID: string; // 要移动的目录或文件id
    targetID: string; // 目标文件或目标目录id
  };
}

export namespace PostApprovalCreateFile {
  export type Params = {
    parentID: string;
    name: string;
    required: boolean;
    mode: string[];
    businessID: string;
    matterID: string;
  };
}

export namespace PostApprovalEditFile {
  export type Params = {
    parentID?: string;
    name?: string;
    required?: boolean;
    mode?: string[];
    businessID?: string;
    matterID?: string;
    ID: string;
  };
}

export namespace PostApprovalDeleteFiles {
  export type Params = {
    dataIdList: string[];
  };
}

export namespace GetApprovalExecutorMembers {
  export type Params = {
    businessID: string;
    executorIdList: string[];
  };

  export type Response = {
    executorID: string;
    members: string[];
  }[];
}

export namespace PostApprovalBatchAddAuditScoreLog {
  export type Params = {
    list: Omit<IAuditScoreLog, 'ID'>[];
  };
}

export namespace GetAuditScoreLogs {
  export type Params = {
    dataID: string;
    businessID: string;
  };

  export type Response = {
    list: IAuditScoreLog[];
  };
}

export namespace UpdateAuditScoreRemark {
  export type Params = Omit<IAuditScoreRemark, 'ID'> & { ID?: string };

  export type Responst = IAuditScoreRemark;
}

export namespace GetAuditScoreRemarkList {
  export type Params = { businessID: string; dataID: string };

  export type Resonse = IAuditScoreRemark[];
}

export namespace GetGcnameAndReviewer {
  export type Params = { businessID: string };

  export type Response = {
    reviewerName: string;
    reviewerID: string;
    gcName: string;
  };
}
