From c228a89c2834ee63b209bad608837c39643f350e Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Mon, 28 Jul 2025 11:44:16 +0000
Subject: (대표님) 의존성 docx 추가, basicContract API, gtc(계약일반조건),
 벤더평가 esg 평가데이터 내보내기 개선, S-EDP 피드백 대응(CLS_ID, ITEM NO 등)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../status/create-gtc-document-dialog.tsx          | 31 ++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)

(limited to 'lib/gtc-contract/status/create-gtc-document-dialog.tsx')

diff --git a/lib/gtc-contract/status/create-gtc-document-dialog.tsx b/lib/gtc-contract/status/create-gtc-document-dialog.tsx
index 98cd249f..003e4d51 100644
--- a/lib/gtc-contract/status/create-gtc-document-dialog.tsx
+++ b/lib/gtc-contract/status/create-gtc-document-dialog.tsx
@@ -10,6 +10,7 @@ import { Textarea } from "@/components/ui/textarea"
 import {
   Form,
   FormControl,
+  FormDescription,
   FormField,
   FormItem,
   FormLabel,
@@ -43,14 +44,17 @@ import { createGtcDocumentSchema, type CreateGtcDocumentSchema } from "@/lib/gtc
 import { createGtcDocument, getProjectsForSelect } from "@/lib/gtc-contract/service"
 import { type Project } from "@/db/schema/projects"
 import { useSession } from "next-auth/react"
+import { Input } from "@/components/ui/input"
+import { useRouter } from "next/navigation";
 
 export function CreateGtcDocumentDialog() {
   const [open, setOpen] = React.useState(false)
   const [projects, setProjects] = React.useState<Project[]>([])
   const [isCreatePending, startCreateTransition] = React.useTransition()
   const { data: session } = useSession()
+  const router = useRouter();
 
-  const currentUserId =React.useMemo(() => {
+  const currentUserId = React.useMemo(() => {
     return session?.user?.id ? Number(session.user.id) : null;
   }, [session]);
 
@@ -68,6 +72,7 @@ export function CreateGtcDocumentDialog() {
     defaultValues: {
       type: "standard",
       projectId: null,
+      title: "",
       revision: 0,
       editReason: "",
     },
@@ -88,7 +93,7 @@ export function CreateGtcDocumentDialog() {
           ...data,
           createdById: currentUserId
         })
-        
+
         if (result.error) {
           toast.error(`에러: ${result.error}`)
           return
@@ -96,6 +101,8 @@ export function CreateGtcDocumentDialog() {
 
         form.reset()
         setOpen(false)
+        router.refresh();
+
         toast.success("GTC 문서가 생성되었습니다.")
       } catch (error) {
         toast.error("문서 생성 중 오류가 발생했습니다.")
@@ -241,6 +248,26 @@ export function CreateGtcDocumentDialog() {
                 />
               )}
 
+              <FormField
+                control={form.control}
+                name="title"
+                render={({ field }) => (
+                  <FormItem>
+                    <FormLabel>GTC 제목 (선택사항)</FormLabel>
+                    <FormControl>
+                      <Input
+                        placeholder="GTC 제목를 입력하세요..."
+                        {...field}
+                      />
+                    </FormControl>
+                    <FormDescription>
+                      워드의 제목으로 사용됩니다.
+                    </FormDescription>
+                    <FormMessage />
+                  </FormItem>
+                )}
+              />
+
               {/* 편집 사유 */}
               <FormField
                 control={form.control}
-- 
cgit v1.2.3

