// lib/legal-works/types.ts import { getLegalWorks } from "@/lib/legal-review/service" // 조회된 법무업무 데이터 타입 export type LegalWorkData = Awaited>["data"][0] // 법무업무 목록 응답 타입 export type LegalWorksResponse = Awaited> // 테이블 상태 관련 타입들 export interface LegalWorkTableState { selectedIds: number[] isLoading: boolean error?: string } // 필터 옵션들 export const LEGAL_WORK_FILTER_OPTIONS = { categories: [ { label: "CP", value: "CP" }, { label: "GTC", value: "GTC" }, { label: "기타", value: "기타" }, ], statuses: [ { label: "검토요청", value: "검토요청" }, { label: "담당자배정", value: "담당자배정" }, { label: "검토중", value: "검토중" }, { label: "답변완료", value: "답변완료" }, { label: "재검토요청", value: "재검토요청" }, { label: "보류", value: "보류" }, { label: "취소", value: "취소" }, ], reviewDepartments: [ { label: "준법문의", value: "준법문의" }, { label: "법무검토", value: "법무검토" }, ], inquiryTypes: [ { label: "국내계약", value: "국내계약" }, { label: "국내자문", value: "국내자문" }, { label: "해외계약", value: "해외계약" }, { label: "해외자문", value: "해외자문" }, ], sourceTypes: [ { label: "22번화면 이관", value: "interface" }, { label: "신규 생성", value: "manual" }, ], urgencyTypes: [ { label: "긴급", value: "true" }, { label: "일반", value: "false" }, ], attachmentTypes: [ { label: "있음", value: "true" }, { label: "없음", value: "false" }, ], } as const // 상태별 색상 매핑 export const STATUS_COLOR_MAP = { "검토요청": "bg-blue-100 text-blue-800 border-blue-200", "담당자배정": "bg-yellow-100 text-yellow-800 border-yellow-200", "검토중": "bg-orange-100 text-orange-800 border-orange-200", "답변완료": "bg-green-100 text-green-800 border-green-200", "재검토요청": "bg-purple-100 text-purple-800 border-purple-200", "보류": "bg-gray-100 text-gray-800 border-gray-200", "취소": "bg-red-100 text-red-800 border-red-200", } as const // 구분별 색상 매핑 export const CATEGORY_COLOR_MAP = { "CP": "bg-blue-500 text-white", "GTC": "bg-emerald-500 text-white", "기타": "bg-gray-500 text-white", } as const // 검토부문별 색상 매핑 export const REVIEW_DEPARTMENT_COLOR_MAP = { "준법문의": "bg-blue-500 text-white", "법무검토": "bg-green-500 text-white", } as const // 문의종류별 색상 매핑 export const INQUIRY_TYPE_COLOR_MAP = { "국내계약": "bg-indigo-500 text-white", "국내자문": "bg-purple-500 text-white", "해외계약": "bg-teal-500 text-white", "해외자문": "bg-cyan-500 text-white", } as const // 우선순위 매핑 export const PRIORITY_MAP = { high: { label: "긴급", color: "bg-red-500 text-white" }, normal: { label: "보통", color: "bg-blue-500 text-white" }, low: { label: "낮음", color: "bg-gray-500 text-white" }, } as const // 법무업무 생성 관련 타입들 export interface CreateLegalWorkPayload { category: "CP" | "GTC" | "기타" vendorId: number isUrgent: boolean reviewDepartment: "준법문의" | "법무검토" inquiryType?: "국내계약" | "국내자문" | "해외계약" | "해외자문" title: string requestContent: string requestDate: string isPublic?: boolean sourceType?: "interface" | "manual" originalInterfaceId?: number } // 검토요청 관련 타입들 export interface RequestReviewPayload { workIds: number[] priority: "high" | "normal" | "low" dueDate: string assignee?: string reviewNotes?: string notificationMethod: "email" | "internal" | "both" } // 필터 관련 타입들 export interface LegalWorkFilter { category?: string[] status?: string[] reviewDepartment?: string[] inquiryType?: string[] isUrgent?: boolean hasAttachment?: boolean vendorCode?: string vendorName?: string reviewer?: string legalResponder?: string dateRange?: { field: "requestDate" | "consultationDate" | "expectedAnswerDate" | "legalCompletionDate" | "createdAt" from?: string to?: string } } // 통계 관련 타입들 export interface LegalWorkStats { total: number pending: number assigned: number inProgress: number completed: number urgent: number byCategory: Record byStatus: Record byReviewDepartment: Record }