/** * 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" | "QM_REVIEW_CONFIRMED" | "IN_PROGRESS" | "COMPLETED" | "CANCELED" | "SUPPLEMENT_REQUIRED" | "RESULT_SENT" 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" | "SUPPLEMENT_REINSPECT" | "SUPPLEMENT_DOCUMENT" | "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}> pqNumber: string | null 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: "pqNumber", label: "PQ 번호", excelHeader: "PQ 번호", 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) ]