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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
|
/**
* Base type for vendor investigations view (simplified - investigation focused)
*/
export type VendorInvestigationsViewRaw = {
// Investigation fields
investigationId: number
vendorId: number
pqSubmissionId: number | null
requesterId: number | null
qmManagerId: number | null
investigationStatus: "PLANNED" | "IN_PROGRESS" | "COMPLETED" | "CANCELED"
investigationAddress: string | null
investigationMethod: "PURCHASE_SELF_EVAL" | "DOCUMENT_EVAL" | "PRODUCT_INSPECTION" | "SITE_VISIT_EVAL" | null
scheduledStartAt: Date | null
scheduledEndAt: Date | null
forecastedAt: Date | null
requestedAt: Date | null
confirmedAt: Date | null
completedAt: Date | null
evaluationScore: number | null
evaluationResult: "APPROVED" | "SUPPLEMENT" | "REJECTED" | null
investigationNotes: string | null
createdAt: Date
updatedAt: Date
// Essential vendor fields only
vendorName: string
vendorCode: string
// PQ 정보
pqItems: string | null | Array<{itemCode: string, itemName: string}>
hasAttachments: boolean
requesterName: string | null
requesterEmail: string | null
qmManagerName: string | null
qmManagerEmail: string | null
}
/**
* Main type for the table (adds id for backward compatibility)
*/
export interface VendorInvestigationsViewWithContacts extends VendorInvestigationsViewRaw {
// Add id field for backward compatibility (maps to investigationId)
id: number
}
// Column configuration type
export interface VendorInvestigationsColumnConfig {
id: keyof VendorInvestigationsViewWithContacts
label: string
group?: string
excelHeader?: string
type?: string
}
// Simplified column configuration focusing on investigation data
export const vendorInvestigationsColumnsConfig: VendorInvestigationsColumnConfig[] = [
// Investigation Basic Info
{
id: "investigationStatus",
label: "실사 상태",
excelHeader: "실사 상태",
// group: "Investigation",
},
{
id: "vendorCode",
label: "협력사",
excelHeader: "협력사",
group: "협력업체",
},
{
id: "vendorName",
label: "협력사명",
excelHeader: "협력사명",
group: "Vendor",
},
{
id: "requesterName",
label: "의뢰자",
excelHeader: "의뢰자",
group: "실사",
},
{
id: "investigationAddress",
label: "실사 주소",
excelHeader: "실사 주소",
group: "실사",
},
{
id: "investigationMethod",
label: "실사방법",
excelHeader: "실사방법",
group: "실사",
},
{
id: "pqItems",
label: "실사품목",
excelHeader: "실사품목",
group: "실사",
},
{
id: "investigationNotes",
label: "QM 의견",
excelHeader: "QM 의견",
group: "실사",
},
{
id: "qmManagerName",
label: "QM 담당자",
excelHeader: "QM 담당자",
group: "실사",
},
{
id: "evaluationScore",
label: "평가점수",
excelHeader: "평가점수",
group: "실사",
},
{
id: "evaluationResult",
label: "평가 결과",
excelHeader: "평가 결과",
group: "실사",
},
{
id: "hasAttachments",
label: "첨부파일",
excelHeader: "첨부파일",
group: "실사",
},
// Schedule Group
{
id: "requestedAt",
label: "실사 의뢰일",
excelHeader: "실사 의뢰일",
group: "일정",
},
{
id: "forecastedAt",
label: "실사 수행 예정일",
excelHeader: "실사 수행 예정일",
group: "일정",
},
{
id: "confirmedAt",
label: "실사 계획 확정일",
excelHeader: "실사 계획 확정일",
group: "일정",
},
{
id: "completedAt",
label: "실제 실사일",
excelHeader: "실제 실사일",
group: "일정",
},
// {
// id: "createdAt",
// label: "Created At",
// excelHeader: "Created At",
// },
// {
// id: "updatedAt",
// label: "Updated At",
// excelHeader: "Updated At",
// },
// Essential Vendor Info (minimal)
// References Group
// {
// id: "pqSubmissionId",
// label: "PQ Submission",
// excelHeader: "PQ Submission ID",
// group: "References",
// },
// {
// id: "requesterId",
// label: "Requester",
// excelHeader: "Requester ID",
// group: "References",
// },
// {
// id: "qmManagerId",
// label: "QM Manager",
// excelHeader: "QM Manager ID",
// group: "References",
// },
// Metadata (ungrouped)
]
|