summaryrefslogtreecommitdiff
path: root/config/vendorRegularRegistrationsColumnsConfig.ts
blob: 5cee82e53cb9455fd3f4fe5c7f63e9730a44df16 (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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
export interface VendorRegularRegistration {
  id: number;
  vendorId: number;
  status: string;
  potentialCode: string | null;
  businessNumber: string;
  companyName: string;
  majorItems: string | null;
  establishmentDate: string | null;
  representative: string | null;
  country: string | null;
  documentSubmissions: {
    businessRegistration: boolean;
    creditEvaluation: boolean;
    bankCopy: boolean;
    auditResult: boolean;
  };
  documentFiles: {
    businessRegistration: any[];
    creditEvaluation: any[];
    bankCopy: any[];
    auditResult: any[];
  };
  contractAgreements: {
    cp: string; // not_submitted, reviewing, completed
    gtc: string;
    standardSubcontract: string;
    safetyHealth: string;
    ethics: string;
    domesticCredit: string;
  };
  // 안전적격성 평가는 별도 필드로 분리
  safetyQualificationContent: string | null;
  gtcSkipped: boolean;
  additionalInfo: boolean;
  // 기본계약 정보 추가
  basicContracts: Array<{
    templateId: number | null;
    templateName: string | null;
    status: string;
    createdAt: Date | null;
    filePath: string | null;
    fileName: string | null;
  }>;
  registrationRequestDate: string | null;
  assignedDepartment: string | null;
  assignedUser: string | null;
  remarks: string | null;
}

export interface VendorRegularRegistrationColumnConfig {
  id: keyof VendorRegularRegistration | string;
  label: string;
  group?: string;
  excelHeader?: string;
  type?: string;
}

export const vendorRegularRegistrationsColumnsConfig: VendorRegularRegistrationColumnConfig[] = [
  {
    id: "status",
    label: "Status",
    type: "select",
    group: "기본 정보",
    excelHeader: "상태",
  },
  {
    id: "potentialCode",
    label: "잠재코드",
    type: "text",
    group: "기본 정보",
    excelHeader: "잠재코드",
  },
  {
    id: "businessNumber",
    label: "사업자번호",
    type: "text",
    group: "기본 정보",
    excelHeader: "사업자번호",
  },
  {
    id: "companyName",
    label: "업체명",
    type: "text",
    group: "기본 정보",
    excelHeader: "업체명",
  },
  {
    id: "majorItems",
    label: "주요품목",
    type: "text",
    group: "기본 정보",
    excelHeader: "주요품목",
  },
  {
    id: "establishmentDate",
    label: "설립일자",
    type: "date",
    group: "기본 정보",
    excelHeader: "설립일자",
  },
  {
    id: "representative",
    label: "대표자명",
    type: "text",
    group: "기본 정보",
    excelHeader: "대표자명",
  },
  {
    id: "registrationRequestDate",
    label: "등록요청일",
    type: "date",
    group: "관리 정보",
    excelHeader: "등록요청일",
  },
  {
    id: "assignedDepartment",
    label: "담당부서",
    type: "text",
    group: "관리 정보",
    excelHeader: "담당부서",
  },
  {
    id: "assignedUser",
    label: "담당자",
    type: "text",
    group: "관리 정보",
    excelHeader: "담당자",
  },
  {
    id: "remarks",
    label: "비고",
    type: "text",
    group: "관리 정보",
    excelHeader: "비고",
  },
];

export const statusLabels: Record<string, string> = {
  under_review: "검토중",
  approval_ready: "조건충족",
  pending_approval: "결재진행중",
  registration_completed: "등록완료",
  registration_failed: "등록실패",
};

export const statusColors: Record<string, string> = {
  under_review: "bg-blue-100 text-blue-800",
  approval_ready: "bg-emerald-100 text-emerald-800",
  pending_approval: "bg-yellow-100 text-yellow-800",
  registration_completed: "bg-green-100 text-green-800",
  registration_failed: "bg-red-100 text-red-800",
};


export const documentStatusColumns: { key: keyof VendorRegularRegistration["documentSubmissions"]; label: string }[] = [
  { key: "businessRegistration", label: "사업자등록증" },
  { key: "creditEvaluation", label: "신용평가서" },
  { key: "bankCopy", label: "통장사본" },
  { key: "auditResult", label: "실사결과" },
];

export const contractAgreementColumns: { key: keyof VendorRegularRegistration["contractAgreements"]; label: string }[] = [
  { key: "cp", label: "CP문서" },
  { key: "gtc", label: "GTC" },
  { key: "standardSubcontract", label: "표준하도급" },
  { key: "safetyHealth", label: "안전보건관리" },
  { key: "ethics", label: "윤리규범준수" },
  { key: "domesticCredit", label: "내국신용장" },
];