From 4e63d8427d26d0d1b366ddc53650e15f3481fc75 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Tue, 24 Jun 2025 01:44:03 +0000
Subject: (대표님/최겸) 20250624 작업사항 10시43분
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 lib/evaluation/table/evaluation-columns.tsx | 35 +++++++++++++++--------------
 1 file changed, 18 insertions(+), 17 deletions(-)

(limited to 'lib/evaluation/table/evaluation-columns.tsx')

diff --git a/lib/evaluation/table/evaluation-columns.tsx b/lib/evaluation/table/evaluation-columns.tsx
index 0c207a53..821e8182 100644
--- a/lib/evaluation/table/evaluation-columns.tsx
+++ b/lib/evaluation/table/evaluation-columns.tsx
@@ -11,6 +11,7 @@ import { Button } from "@/components/ui/button";
 import { Pencil, Eye, MessageSquare, Check, X, Clock, FileText } from "lucide-react";
 import { DataTableColumnHeaderSimple } from "@/components/data-table/data-table-column-simple-header";
 import { PeriodicEvaluationView } from "@/db/schema";
+import { DataTableRowAction } from "@/types/table";
 
 
 
@@ -104,7 +105,7 @@ const getProgressBadge = (completed: number, total: number) => {
   return <Badge variant={variant}>{completed}/{total} ({percentage}%)</Badge>;
 };
 
-export function getPeriodicEvaluationsColumns({setRowAction}: GetColumnsProps): ColumnDef<PeriodicEvaluationWithRelations>[] {
+export function getPeriodicEvaluationsColumns({setRowAction}: GetColumnsProps): ColumnDef<PeriodicEvaluationView>[] {
   return [
     // ═══════════════════════════════════════════════════════════════
     // 선택 및 기본 정보
@@ -136,9 +137,9 @@ export function getPeriodicEvaluationsColumns({setRowAction}: GetColumnsProps):
 
     // ░░░ 평가년도 ░░░
     {
-      accessorKey: "evaluationTarget.evaluationYear",
+      accessorKey: "evaluationYear",
       header: ({ column }) => <DataTableColumnHeaderSimple column={column} title="평가년도" />,
-      cell: ({ row }) => <span className="font-medium">{row.original.evaluationTarget?.evaluationYear}</span>,
+      cell: ({ row }) => <span className="font-medium">{row.original.evaluationYear}</span>,
       size: 100,
     },
 
@@ -154,9 +155,9 @@ export function getPeriodicEvaluationsColumns({setRowAction}: GetColumnsProps):
 
     // ░░░ 구분 ░░░
     {
-      accessorKey: "evaluationTarget.division",
+      accessorKey: "division",
       header: ({ column }) => <DataTableColumnHeaderSimple column={column} title="구분" />,
-      cell: ({ row }) => getDivisionBadge(row.original.evaluationTarget?.division || ""),
+      cell: ({ row }) => getDivisionBadge(row.original.division || ""),
       size: 80,
     },
 
@@ -167,36 +168,36 @@ export function getPeriodicEvaluationsColumns({setRowAction}: GetColumnsProps):
       header: "협력업체 정보",
       columns: [
         {
-          accessorKey: "evaluationTarget.vendorCode",
+          accessorKey: "vendorCode",
           header: ({ column }) => <DataTableColumnHeaderSimple column={column} title="벤더 코드" />,
           cell: ({ row }) => (
-            <span className="font-mono text-sm">{row.original.evaluationTarget?.vendorCode}</span>
+            <span className="font-mono text-sm">{row.original.vendorCode}</span>
           ),
           size: 120,
         },
 
         {
-          accessorKey: "evaluationTarget.vendorName",
+          accessorKey: "vendorName",
           header: ({ column }) => <DataTableColumnHeaderSimple column={column} title="벤더명" />,
           cell: ({ row }) => (
-            <div className="truncate max-w-[200px]" title={row.original.evaluationTarget?.vendorName}>
-              {row.original.evaluationTarget?.vendorName}
+            <div className="truncate max-w-[200px]" title={row.original.vendorName}>
+              {row.original.vendorName}
             </div>
           ),
           size: 200,
         },
 
         {
-          accessorKey: "evaluationTarget.domesticForeign",
+          accessorKey: "domesticForeign",
           header: ({ column }) => <DataTableColumnHeaderSimple column={column} title="내외자" />,
-          cell: ({ row }) => getDomesticForeignBadge(row.original.evaluationTarget?.domesticForeign || ""),
+          cell: ({ row }) => getDomesticForeignBadge(row.original.domesticForeign || ""),
           size: 80,
         },
 
         {
-          accessorKey: "evaluationTarget.materialType",
+          accessorKey: "materialType",
           header: ({ column }) => <DataTableColumnHeaderSimple column={column} title="자재구분" />,
-          cell: ({ row }) => getMaterialTypeBadge(row.original.evaluationTarget?.materialType || ""),
+          cell: ({ row }) => getMaterialTypeBadge(row.original.materialType || ""),
           size: 120,
         },
       ]
@@ -355,10 +356,10 @@ export function getPeriodicEvaluationsColumns({setRowAction}: GetColumnsProps):
           id: "reviewProgress",
           header: ({ column }) => <DataTableColumnHeaderSimple column={column} title="리뷰진행" />,
           cell: ({ row }) => {
-            const stats = row.original.reviewerStats;
-            if (!stats) return <span className="text-muted-foreground">-</span>;
+            const totalReviewers = row.original.totalReviewers || 0;
+            const completedReviewers = row.original.completedReviewers || 0;
             
-            return getProgressBadge(stats.completedReviewers, stats.totalReviewers);
+            return getProgressBadge(completedReviewers, totalReviewers);
           },
           size: 120,
         },
-- 
cgit v1.2.3

