type MakeOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;

export interface ApprovalInstanceType {
  id: number;
  templateName: string;
  description?: string;
  isRelated?: number;
  isApplied?: number;
  approvalNodeInfoList?: ApprovalNodeInstanceType[];
}

export interface ApprovalInstanceRuleForm extends MakeOptional<ApprovalInstanceType, 'id'> {}

export interface ApprovalNodeInstanceType {
  id: number;
  approvalTemplateId: number;
  nodeDescription: string;
  approvalOrder: number;
  approverType: number; // 审批人选择方式: 0-固定，1-自选
  approvalType: number; // 审批方式: 0-会签，1-或签

  approverInfoList: {
    approverId: number;
    approverName: string;
  }[];

  approverList?: string;
  approverNameList?: string;
}

export interface ApprovalNodeInstanceRuleForm
  extends MakeOptional<
    Omit<ApprovalNodeInstanceType, 'approverInfoList' | 'approverNameList'>,
    'id' | 'approvalTemplateId' | 'approvalOrder' | 'nodeDescription' | 'approverType' | 'approvalType'
  > {}
