From c92bd1b8caa6ddabe6acee42018262febd5d91fb Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Wed, 19 Nov 2025 06:15:43 +0000
Subject: (임수민) 기본계약 코멘트, 법무검토 수정
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../viewer/basic-contract-sign-viewer.tsx            | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

(limited to 'lib/basic-contract/viewer/basic-contract-sign-viewer.tsx')

diff --git a/lib/basic-contract/viewer/basic-contract-sign-viewer.tsx b/lib/basic-contract/viewer/basic-contract-sign-viewer.tsx
index 75862506..7f5fa027 100644
--- a/lib/basic-contract/viewer/basic-contract-sign-viewer.tsx
+++ b/lib/basic-contract/viewer/basic-contract-sign-viewer.tsx
@@ -53,6 +53,7 @@ interface BasicContractSignViewerProps {
   ) => void;
   mode?: 'vendor' | 'buyer'; // 추가된 mode prop
   t?: (key: string) => string;
+  negotiationCompletedAt?: Date | null; // 협의 완료 시간 추가
 }
 
 // 자동 서명 필드 생성을 위한 타입 정의
@@ -692,6 +693,7 @@ export function BasicContractSignViewer({
   onGtcCommentStatusChange,
   mode = 'vendor', // 기본값 vendor
   t = (key: string) => key,
+  negotiationCompletedAt,
 }: BasicContractSignViewerProps) {
   const { toast } = useToast();
 
@@ -1383,6 +1385,8 @@ export function BasicContractSignViewer({
                   onSurveyDataUpdate={setSurveyData}
                   onLoadSurveyTemplate={loadSurveyTemplate}
                   setActiveTab={setActiveTab}
+                  contractFilePath={filePath}
+                  contractFileName={filePath ? filePath.split('/').pop() : undefined}
                 />
               </div>
 
@@ -1396,10 +1400,15 @@ export function BasicContractSignViewer({
                       basicContractId={contractId}
                       currentUserType={mode === 'vendor' ? 'Vendor' : 'SHI'}
                       readOnly={false}
+                      isNegotiationCompleted={!!negotiationCompletedAt}
+                      onNegotiationComplete={() => {
+                        // 협의 완료 후 상태 갱신이 필요한 경우 처리
+                        console.log('협의 완료됨');
+                      }}
                       onCommentCountChange={(count) => {
                         const hasComments = count > 0;
                         const reviewStatus = hasComments ? 'negotiating' : 'draft';
-                        const isComplete = false;
+                        const isComplete = !!negotiationCompletedAt;
                         setGtcCommentStatus({ hasComments, commentCount: count, reviewStatus, isComplete });
                         onGtcCommentStatusChange?.(hasComments, count, reviewStatus, isComplete);
                       }}
@@ -1574,6 +1583,8 @@ export function BasicContractSignViewer({
                     onSurveyDataUpdate={setSurveyData}
                     onLoadSurveyTemplate={loadSurveyTemplate}
                     setActiveTab={setActiveTab}
+                    contractFilePath={filePath}
+                    contractFileName={filePath ? filePath.split('/').pop() : undefined}
                   />
                 </div>
 
@@ -1585,12 +1596,17 @@ export function BasicContractSignViewer({
                         basicContractId={contractId}
                         currentUserType={mode === 'vendor' ? 'Vendor' : 'SHI'}
                         readOnly={false}
+                        isNegotiationCompleted={!!negotiationCompletedAt}
+                        onNegotiationComplete={() => {
+                          // 협의 완료 후 상태 갱신이 필요한 경우 처리
+                          console.log('협의 완료됨');
+                        }}
                         onCommentCountChange={(count) => {
                           handleGtcCommentStatusChange?.(
                             count > 0,
                             count,
                             count > 0 ? 'negotiating' : 'draft',
-                            false
+                            !!negotiationCompletedAt
                           );
                         }}
                       />
-- 
cgit v1.2.3

