summaryrefslogtreecommitdiff
path: root/lib/bidding/pre-quote/service.ts
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-09-09 10:32:34 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-09-09 10:32:34 +0000
commitc62ec046327fd388ebce04571b55910747e69a3b (patch)
tree41ccdc4a8dea99808622f6d5d52014ac59a2d7ab /lib/bidding/pre-quote/service.ts
parentebcec3f296d1d27943caf8a3aed26efef117cdc5 (diff)
(정희성, 최겸, 대표님) formatDate 변경 등
Diffstat (limited to 'lib/bidding/pre-quote/service.ts')
-rw-r--r--lib/bidding/pre-quote/service.ts27
1 files changed, 15 insertions, 12 deletions
diff --git a/lib/bidding/pre-quote/service.ts b/lib/bidding/pre-quote/service.ts
index b5b06769..35bc8941 100644
--- a/lib/bidding/pre-quote/service.ts
+++ b/lib/bidding/pre-quote/service.ts
@@ -330,17 +330,20 @@ export async function sendPreQuoteInvitations(companyIds: number[]) {
}
}
// 3. 입찰 상태를 사전견적 요청으로 변경 (bidding_generated 상태에서만)
- await tx
- .update(biddings)
- .set({
- status: 'request_for_quotation',
- updatedAt: new Date()
- })
- .where(and(
- eq(biddings.id, biddingId),
- eq(biddings.status, 'bidding_generated')
- ))
-
+ for (const company of companiesInfo) {
+ await db.transaction(async (tx) => {
+ await tx
+ .update(biddings)
+ .set({
+ status: 'request_for_quotation',
+ updatedAt: new Date()
+ })
+ .where(and(
+ eq(biddings.id, company.biddingId),
+ eq(biddings.status, 'bidding_generated')
+ ))
+ })
+ }
return {
success: true,
message: `${companyIds.length}개 업체에 사전견적 초대를 발송했습니다.`
@@ -608,7 +611,7 @@ export async function submitPreQuoteResponse(
.update(biddings)
.set({
status: 'received_quotation',
- preQuoteReceivedAt: new Date(), // 사전견적 접수일 업데이트
+ preQuoteDate: new Date().toISOString().split('T')[0], // 사전견적 접수일 업데이트
updatedAt: new Date()
})
.where(and(