import { VendorWithTypeAndMaterials } from "@/db/schema/vendors"; /** * 테이블/엑셀에 보여줄 컬럼 한 칸을 어떻게 렌더링할지 결정하는 설정 */ export interface VendorColumnConfig { /** * "조인 결과" 객체(VendorWithTypeAndMaterials)의 어느 필드를 표시할지 * 또는 계산된 필드명 (예: vendorClassification) */ id: keyof VendorWithTypeAndMaterials | "vendorClassification" | "vendorCode"; /** 화면·엑셀에서 보여줄 컬럼명 */ label: string; /** (선택) 그룹핑/카테고리 */ group?: string; /** (선택) Excel에서의 헤더 */ excelHeader?: string; /** (선택) 데이터 타입(예: date, string, number 등), 포맷 지정용 */ type?: string; /** (선택) 컬럼 너비 설정 */ width?: number; /** (선택) 최소 너비 */ minWidth?: number; /** (선택) 최대 너비 */ maxWidth?: number; } /** * 프롬프트 요구사항에 따른 협력업체 관리 페이지 컬럼 정의 */ export const vendorColumnsConfig: VendorColumnConfig[] = [ // 선택 컬럼은 별도 처리 (체크박스) { id: "id", label: "No.", excelHeader: "No.", type: "number", width: 80, minWidth: 60, }, { id: "vendorClassification", label: "업체분류", excelHeader: "업체분류", type: "string", width: 120, minWidth: 100, }, { id: "vendorName", label: "업체명", excelHeader: "업체명", type: "string", width: 200, minWidth: 150, maxWidth: 300, }, { id: "vendorCode", label: "업체코드", excelHeader: "업체코드", type: "string", width: 140, minWidth: 120, }, { id: "country", label: "국가", excelHeader: "국가", type: "string", width: 100, minWidth: 80, }, { id: "taxId", label: "사업자번호", excelHeader: "사업자번호", type: "string", width: 140, minWidth: 120, }, { id: "vendorTypeName", label: "업체유형", excelHeader: "업체유형", type: "string", width: 120, minWidth: 100, }, { id: "primaryMaterial1", label: "업체대표품목1", excelHeader: "업체대표품목1", type: "string", width: 180, minWidth: 150, maxWidth: 250, }, { id: "primaryMaterial2", label: "업체대표품목2", excelHeader: "업체대표품목2", type: "string", width: 180, minWidth: 150, maxWidth: 250, }, { id: "primaryMaterial3", label: "업체대표품목3", excelHeader: "업체대표품목3", type: "string", width: 180, minWidth: 150, maxWidth: 250, }, { id: "businessSize", label: "기업규모", excelHeader: "기업규모", type: "string", width: 100, minWidth: 80, }, { id: "isAssociationMember", label: "성조회가입여부", excelHeader: "성조회가입여부", type: "string", width: 140, minWidth: 120, }, // TODO 구현을 위한 컬럼들 (UI만) { id: "regularEvaluationGrade", label: "정기평가등급", excelHeader: "정기평가등급", type: "string", group: "평가정보", width: 120, minWidth: 100, }, { id: "faContract", label: "FA체결", excelHeader: "FA체결", type: "string", group: "계약정보", width: 100, minWidth: 80, }, { id: "avlRegistration", label: "AVL등재", excelHeader: "AVL등재", type: "string", group: "등록정보", width: 100, minWidth: 80, }, { id: "regularVendorRegistration", label: "정규업체등록현황", excelHeader: "정규업체등록현황", type: "string", group: "등록정보", width: 160, minWidth: 140, }, // 최근발주실적 그룹 { id: "recentPoNumber", label: "PO/계약번호", excelHeader: "최근 PO/계약번호", type: "string", group: "최근발주실적", width: 160, minWidth: 140, maxWidth: 200, }, { id: "recentPoOrderBy", label: "발주담당자", excelHeader: "최근 발주담당자", type: "string", group: "최근발주실적", width: 120, minWidth: 100, }, { id: "recentPoDate", label: "발주일", excelHeader: "최근 발주일", type: "date", group: "최근발주실적", width: 120, minWidth: 100, }, // 최근조달실적 그룹 { id: "recentDeliveryNumber", label: "PO/계약번호", excelHeader: "최근 조달 PO/계약번호", type: "string", group: "최근조달실적", width: 160, minWidth: 140, maxWidth: 200, }, { id: "recentDeliveryBy", label: "조달담당자", excelHeader: "최근 조달담당자", type: "string", group: "최근조달실적", width: 120, minWidth: 100, }, { id: "recentDeliveryDate", label: "납품/선적일", excelHeader: "최근 납품/선적일", type: "date", group: "최근조달실적", width: 130, minWidth: 110, }, // 상세 (기존의 액션 버튼) - 별도 처리됨 ];