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
|
import { Vendor, VendorContact } from "@/db/schema/vendors";
/**
* 테이블/엑셀에 보여줄 컬럼 한 칸을 어떻게 렌더링할지 결정하는 설정
*/
export interface VendorColumnConfig {
/**
* "조인 결과" 객체(UserWithCompanyAndRoles)의 어느 필드를 표시할지
*/
id: keyof VendorContact;
/** 화면·엑셀에서 보여줄 컬럼명 */
label: string;
/** (선택) 그룹핑/카테고리 */
group?: string;
/** (선택) Excel에서의 헤더 */
excelHeader?: string;
/** (선택) 데이터 타입(예: date, string, number 등), 포맷 지정용 */
type?: string;
}
/**
* 실제로 "User + Company + Roles" 정보 테이블에서
* 어떤 컬럼들을 어떤 순서로 표시할 것인지 정의.
*/
export const vendorContactsColumnsConfig: VendorColumnConfig[] = [
{
id: "contactName",
label: "Contact Name",
excelHeader: "Contact Name",
},
{
id: "contactPosition",
label: "Contact Position",
excelHeader: "Contact Position",
},
{
id: "contactEmail",
label: "Contact Email",
excelHeader: "Contact Email",
},
{
id: "contactPhone",
label: "Contact Phone",
excelHeader: "Contact Phone",
// type: "string[]", // 필요하면 추가
},
// 필요 시 createdAt도 조인해서 가져왔다면 아래처럼 추가
{
id: "isPrimary",
label: "isPrimary",
excelHeader: "isPrimary",
// group: "Metadata",
},
{
id: "createdAt",
label: "Created At",
excelHeader: "Created At",
// group: "Metadata",
},
{
id: "updatedAt",
label: "Updated At",
excelHeader: "Updated At",
// group: "Metadata",
},
];
|