From 426551207de299205ab3b2e3b83cf231df8c606b Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Mon, 7 Jul 2025 09:25:31 +0000
Subject: (최겸) 정기평가 최종 선택 간 finalScore type 수정
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 lib/evaluation/table/periodic-evaluation-finalize-dialogs.tsx | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'lib/evaluation/table/periodic-evaluation-finalize-dialogs.tsx')

diff --git a/lib/evaluation/table/periodic-evaluation-finalize-dialogs.tsx b/lib/evaluation/table/periodic-evaluation-finalize-dialogs.tsx
index 7d6ca45d..d6784754 100644
--- a/lib/evaluation/table/periodic-evaluation-finalize-dialogs.tsx
+++ b/lib/evaluation/table/periodic-evaluation-finalize-dialogs.tsx
@@ -48,7 +48,7 @@ const GRADE_OPTIONS = [
 ] as const
 
 // 점수에 따른 등급 계산
-const calculateGrade = (score: number): string => {
+const calculateGrade = (score: number): "S" | "A" | "B" | "C" | "D" => {
   if (score >= 90) return "S"
   if (score >= 80) return "A"
   if (score >= 70) return "B"
@@ -61,8 +61,8 @@ const evaluationItemSchema = z.object({
   id: z.number(),
   vendorName: z.string(),
   vendorCode: z.string(),
-  evaluationScore: z.number().nullable(),
-  finalScore: z.number()
+  evaluationScore: z.coerce.number().nullable(),
+  finalScore: z.coerce.number()
     .min(0, "점수는 0 이상이어야 합니다"),
     // .max(100, "점수는 100 이하여야 합니다"),
   finalGrade: z.enum(["S", "A", "B", "C", "D"]),
@@ -109,7 +109,7 @@ export function FinalizeEvaluationDialog({
         id: evaluation.id,
         vendorName: evaluation.vendorName || "",
         vendorCode: evaluation.vendorCode || "",
-        evaluationScore: evaluation.evaluationScore || null,
+        evaluationScore: evaluation.evaluationScore ? Number(evaluation.evaluationScore) : null,
         finalScore: Number(evaluation.evaluationScore || 0),
         finalGrade: calculateGrade(Number(evaluation.evaluationScore || 0)),
       }))
-- 
cgit v1.2.3

