summaryrefslogtreecommitdiff
path: root/lib/bidding/approval-actions.ts
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-11-25 08:25:41 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-11-25 08:25:41 +0000
commit6fcb8eda80c5ccac7eb985d3efb2aaafa0711988 (patch)
tree656c855ebe6bb235dca6abb072a06698e254ac3c /lib/bidding/approval-actions.ts
parentd6515dda319e13d88abf96c60e86ad8d78978009 (diff)
(최겸) 구매 입찰 수정
Diffstat (limited to 'lib/bidding/approval-actions.ts')
-rw-r--r--lib/bidding/approval-actions.ts19
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/bidding/approval-actions.ts b/lib/bidding/approval-actions.ts
index 6f02e80c..9a37d83b 100644
--- a/lib/bidding/approval-actions.ts
+++ b/lib/bidding/approval-actions.ts
@@ -334,6 +334,12 @@ export async function requestBiddingClosureWithApproval(data: {
debugError('[BiddingClosureApproval] 폐찰 사유 없음');
throw new Error('폐찰 사유를 입력해주세요');
}
+ // 2. DB 및 스키마 import (입찰초대 결재 로직 패턴과 동일)
+ debugLog('[BiddingClosureApproval] DB 연결 및 스키마 import');
+ const { default: db } = await import('@/db/db');
+ const { biddings } = await import('@/db/schema');
+ const { eq } = await import('drizzle-orm');
+
// 유찰상태인지 확인
const { bidding } = await db
.select()
@@ -346,16 +352,13 @@ export async function requestBiddingClosureWithApproval(data: {
throw new Error('유찰 상태인 입찰만 폐찰할 수 있습니다.');
}
- // 2. 입찰 상태를 결재 진행중으로 변경
+ // 3. 입찰 상태를 결재 진행중으로 변경
debugLog('[BiddingClosureApproval] 입찰 상태 변경 시작');
- const { default: db } = await import('@/db/db');
- const { biddings } = await import('@/db/schema');
- const { eq } = await import('drizzle-orm');
await db
.update(biddings)
.set({
- status: 'closure_pending', // 폐찰 결재 진행중 상태
+ status: 'approval_pending', // 폐찰 결재 진행중 상태
updatedBy: data.currentUser.epId,
updatedAt: new Date()
})
@@ -363,7 +366,7 @@ export async function requestBiddingClosureWithApproval(data: {
debugLog('[BiddingClosureApproval] 입찰 상태 변경 완료', {
biddingId: data.biddingId,
- newStatus: 'closure_pending'
+ newStatus: 'approval_pending'
});
// 3. 결재 데이터 준비
@@ -510,7 +513,7 @@ export async function requestBiddingAwardWithApproval(data: {
await db
.update(biddings)
.set({
- status: 'award_pending', // 낙찰 결재 진행중 상태
+ status: 'approval_pending', // 낙찰 결재 진행중 상태
updatedBy: data.currentUser.epId,
updatedAt: new Date()
})
@@ -518,7 +521,7 @@ export async function requestBiddingAwardWithApproval(data: {
debugLog('[BiddingAwardApproval] 입찰 상태 변경 완료', {
biddingId: data.biddingId,
- newStatus: 'award_pending'
+ newStatus: 'approval_pending'
});
// 3. 결재 데이터 준비