diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-03-26 00:37:41 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-03-26 00:37:41 +0000 |
| commit | e0dfb55c5457aec489fc084c4567e791b4c65eb1 (patch) | |
| tree | 68543a65d88f5afb3a0202925804103daa91bc6f /config/vendorTbeColumnsConfig.ts | |
3/25 까지의 대표님 작업사항
Diffstat (limited to 'config/vendorTbeColumnsConfig.ts')
| -rw-r--r-- | config/vendorTbeColumnsConfig.ts | 241 |
1 files changed, 241 insertions, 0 deletions
diff --git a/config/vendorTbeColumnsConfig.ts b/config/vendorTbeColumnsConfig.ts new file mode 100644 index 00000000..1299cebe --- /dev/null +++ b/config/vendorTbeColumnsConfig.ts @@ -0,0 +1,241 @@ + +export interface VendorWithTbeFields { + /** 기존에 row.id 로 들어가는 필드 → 사실상 vendor의 pk */ + id: number | null + + /** vendorID 라고도 쓰는 중복 필드가 있다면 여기서 정리 */ + vendorId: number + rfqId: number| null + + vendorName: string + vendorCode: string | null + address: string | null + country: string | null + email: string | null + website: string | null + vendorStatus: string | null + + rfqVendorStatus: string | null + rfqVendorUpdated: Date | null + + rfqCode: string | null + projectCode: string | null + projectName: string | null + description: string | null + dueDate: Date | null + + tbeResult: string | null + tbeNote: string | null + tbeUpdated: Date | null + + tbeId: number | null + + templateFileCount?: number; // TBE 템플릿 파일 수 + hasResponse?: boolean; // TBE 응답 파일 제출 여부 + + /** 추가로 붙는 필드 */ + comments: Array<{ + id: number + commentText: string + vendorId?: number + evaluationId?: number + createdAt?: Date + commentedBy?: number + }> + + /** TBE 파일 목록 */ + files: Array<{ + id: number + fileName: string + filePath?: string + vendorId?: number + evaluationId?: number + createdAt?: Date + uploadedAt?: Date + }> +} + + +export interface TbeVendorFields { + /** 기존에 row.id 로 들어가는 필드 → 사실상 vendor의 pk */ + id: number | null + + /** vendorID 라고도 쓰는 중복 필드가 있다면 여기서 정리 */ + vendorId: number + rfqId: number| null + + vendorName: string + vendorCode: string | null + address: string | null + country: string | null + email: string | null + website: string | null + vendorStatus: string | null + + vendorResponseId: number | null + rfqVendorStatus: string | null + rfqVendorUpdated: Date | null + + rfqCode: string | null + projectCode: string | null + projectName: string | null + description: string | null + dueDate: Date | null + + tbeResult: string | null + tbeNote: string | null + tbeUpdated: Date | null + + tbeId: number | null + + templateFileCount?: number; // TBE 템플릿 파일 수 + hasResponse?: boolean; // TBE 응답 파일 제출 여부 + + /** 추가로 붙는 필드 */ + comments: Array<{ + id: number + commentText: string + vendorId?: number + evaluationId?: number + createdAt?: Date + commentedBy?: number + }> + + +} + +/** + * 테이블/엑셀에 보여줄 컬럼 한 칸을 어떻게 렌더링할지 결정하는 설정 + */ +export interface VendorTbeColumnConfig { + /** + * "조인 결과" 객체(UserWithCompanyAndRoles)의 어느 필드를 표시할지 + */ + id: keyof VendorWithTbeFields; + + /** 화면·엑셀에서 보여줄 컬럼명 */ + label: string; + + /** (선택) 그룹핑/카테고리 */ + group?: string; + + /** (선택) Excel에서의 헤더 */ + excelHeader?: string; + + /** (선택) 데이터 타입(예: date, string, number 등), 포맷 지정용 */ + type?: string; +} + +/** + * 실제로 "User + Company + Roles" 정보 테이블에서 + * 어떤 컬럼들을 어떤 순서로 표시할 것인지 정의. + */ +export const vendorTbeColumnsConfig: VendorTbeColumnConfig[] = [ + { + id: "vendorName", + label: "Vendor Name", + excelHeader: "Vendor Name", + }, + { + id: "vendorCode", + label: "Vendor Code", + excelHeader: "Vendor Code", + }, + + + { + id: "email", + label: "Email", + excelHeader: "Email", + }, + + // { + // id: "vendorStatus", + // label: "Vendor Status", + // excelHeader: "Vendor Status", + // }, + { + id: "rfqVendorStatus", + label: "RFQ Status", + excelHeader: "RFQ Status", + }, + // 새로 추가 (rfq_vendors join 필드) + { + id: "tbeResult", + label: "Result", + excelHeader: "TBE Result", + group: "TBE Info", + }, + { + id: "tbeNote", + label: "Note", + excelHeader: "TBE Note", + group: "TBE Info", + }, + { + id: "tbeUpdated", + label: "Updated At", + excelHeader: "TBE Updated At", + group: "TBE Info", + type: "date", + }, +] + +export const tbeVendorColumnsConfig: VendorTbeColumnConfig[] = [ + +// { +// id: "vendorCode", +// label: "Vendor Code", +// excelHeader: "Vendor Code", +// }, + + +// { +// id: "email", +// label: "Email", +// excelHeader: "Email", +// }, + + // { + // id: "vendorStatus", + // label: "Vendor Status", + // excelHeader: "Vendor Status", + // }, + { + id: "projectName", + label: "Project Name", + excelHeader: "Project Name", +}, + + { + id: "rfqCode", + label: "RFQ Code", + excelHeader: "RFQ Code", +}, + { + id: "rfqVendorStatus", + label: "RFQ Status", + excelHeader: "RFQ Status", + }, + // 새로 추가 (rfq_vendors join 필드) + { + id: "tbeResult", + label: "Result", + excelHeader: "TBE Result", + group: "TBE Info", + }, + { + id: "tbeNote", + label: "Note", + excelHeader: "TBE Note", + group: "TBE Info", + }, + { + id: "tbeUpdated", + label: "Updated At", + excelHeader: "TBE Updated At", + group: "TBE Info", + type: "date", + }, + +]
\ No newline at end of file |
