import type { USER_TYPE } from '@/views/disaster/disaster-precaution/src/constants/task-execution';
import type { SpanTableData } from '@/views/disaster/disaster-precaution/src/type';
interface BasicQuery {
  inspectType?: string;
  taskState?: string;
}
export interface TaskManagementListQuery extends BasicQuery {
  effectStatus?: string;
}

export interface TaskExecutionListQuery extends BasicQuery {}

interface BasicResponse {
  id: number;
  name: string;
  deptName: string; // 被检查单位名称
  inspectType: number; // 检查类型
  dueCompleteTime: string;
  taskState: number; // 任务状态
  overdue: boolean;
  userGroupList: number[];
}

export interface TaskManagementListResponse extends BasicResponse {
  effectStatus: number;
  updatedAt: string;
  executive: {
    id: number;
    realname: string;
    staffNo: string;
  }[];
}

export interface TaskExecutionListResponse extends BasicResponse {
  userTypeList: USER_TYPE[];
  updatedAt: string;
}

export interface TaskManagementItemResponse
  extends Omit<
    TaskManagementListResponse,
    'deptName' | 'inspectType' | 'overdue' | 'effectStatus' | 'taskState' | 'updatedAt' | 'executive'
  > {
  inspectType: number | null;
  deptIdList: string[] | string;
  inspectRequirement: string;
  realname: string;
  isPush: boolean | null;
  templateId: number | null;
}
export interface ContentItem {
  executeImages?: string[];
  executeName: string;
  executeResult: string;
  inspectTime: string;
}

export interface TemplateDetailResponse {
  deptOpinion: ContentItem;
  inspectResult: ContentItem;
  inspectTemplateDetailVOs: SpanTableData[];
}

export interface TaskExecutionDetailResponse {
  deptName: string;
  detail: string;
  name: string;
  reviewerId: number;
}

export interface SaveTaskDetailRequest {
  id: number;
  deptOpinion: ContentItem;
  inspectResult: ContentItem;
  inspectDetails: Pick<SpanTableData, 'id' | 'compliance' | 'actualSituation' | 'inspectImages'>[];
  reviewerId: number;
}
