summaryrefslogtreecommitdiff
path: root/types/legal.ts
blob: 67322c22c61363c1dbc30cddf55c7c21369fadc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
// lib/legal-works/types.ts

import { getLegalWorks } from "@/lib/legal-review/service"

// 조회된 법무업무 데이터 타입
export type LegalWorkData = Awaited<ReturnType<typeof getLegalWorks>>["data"][0]

// 법무업무 목록 응답 타입
export type LegalWorksResponse = Awaited<ReturnType<typeof getLegalWorks>>

// 테이블 상태 관련 타입들
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<string, number>
  byStatus: Record<string, number>
  byReviewDepartment: Record<string, number>
}