import type { FileItem } from '@/components/UploadFiles/types.ts';

export interface PlanEmergencyListQuery {
  planName?: string;
  planType?: string;
  eventType?: string;
  professionalTestSite?: string;
  status?: number;
}

export interface PlanApprovalListQuery {
  approvalStatus?: number;
}

interface BasicListResponse {
  id: number;
  planName: string;
  planType: string;
  eventType: string;
  deptId: number | null;
  deptName: string;
}

export interface PlanEmergencyListResponse extends BasicListResponse {
  professionalTestSite: string | null;
  isDisabled: number;
  status: number;
  approvalTemplateId: number;
}

export interface PlanApprovalListResponse extends BasicListResponse {
  approvalStatus: number;
  appendix: string;
  approvalDescription: string;
  createdByName: string;
  createdAt: string;
  approvalOrder: number;
}

export interface AddEmergencyPlanForm
  extends Omit<PlanEmergencyListResponse, 'id' | 'status' | 'approvalTemplateId' | 'isDisabled'> {
  uploadFile: FileItem[];
  appendix: string;
  approvalTemplateId: number | null;
}

export interface EditEmergencyPlaneForm extends AddEmergencyPlanForm {
  planTypeName: string;
  eventTypeName: string;
  approvalTemplateName: string;
}

export interface AddEmergencyPlanParam extends Omit<AddEmergencyPlanForm, 'uploadFile' | 'approvalTemplateName'> {}

export interface ApprovalProcessParam {
  planId: number;
  approvalDescription: string;
  approvalInfoList: {
    approvalOrder: number;
    approverIdList: number[];
  }[];
}

export interface ApprovalParam {
  planId: number;
  approvalOrder: number;
  approvalStatus: number;
  returnReason: string;
}

interface BasicProcessType {
  approvalOrder: number;
  nodeDescription: string;
}
export interface ProcessInfoListType {
  approverName: string;
  approvalType: number;
  approvalStatus: number;
  approvalTime: string;
  approvalContent: string;
}

export interface ApprovalProcessResponse extends BasicProcessType {
  processInfoList: ProcessInfoListType[];
}

export interface ApprovalProcessList extends BasicProcessType, ProcessInfoListType {}
