From 8e70ba35379d21d89704f1095b7fd32bf286525d Mon Sep 17 00:00:00 2001 From: joonhoekim <26rote@gmail.com> Date: Thu, 2 Oct 2025 14:08:33 +0900 Subject: (김준회) ITB 및 일반견적 선택시 구매담당자 선택을 구매그룹코드로 처리하도록 변경, 오라클 연결 불가한 경우 하드코딩된 폴백데이터 제공처리 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/vendor-document-list/plant/document-stages-service.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/vendor-document-list') diff --git a/lib/vendor-document-list/plant/document-stages-service.ts b/lib/vendor-document-list/plant/document-stages-service.ts index 98eb6f8b..5f803104 100644 --- a/lib/vendor-document-list/plant/document-stages-service.ts +++ b/lib/vendor-document-list/plant/document-stages-service.ts @@ -976,6 +976,12 @@ export async function createDocument(data: CreateDocumentData) { } } catch (error) { console.error("문서 생성 실패:", error) + + // PostgreSQL unique constraint 위반 에러 처리 + if (error instanceof Error && error.message.includes('duplicate key value violates unique constraint "unique_project_vendor_doc"')) { + return { success: false, error: "해당 CPY Project Document Number에 대해 이미 문서가 존재합니다." } + } + return { success: false, error: "문서 생성 중 오류가 발생했습니다." } } } -- cgit v1.2.3