From 8642ee064ddf96f1db2b948b4cc8bbbd6cfee820 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Wed, 12 Nov 2025 10:42:36 +0000 Subject: (최겸) 구매 일반계약, 입찰 수정 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/schema/bidding.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'db') diff --git a/db/schema/bidding.ts b/db/schema/bidding.ts index 18699633..c8382ea6 100644 --- a/db/schema/bidding.ts +++ b/db/schema/bidding.ts @@ -10,6 +10,7 @@ import { decimal, boolean, pgEnum, + jsonb, date, } from 'drizzle-orm/pg-core' import { Vendor, vendors } from './vendors' @@ -100,10 +101,10 @@ export const invitationStatusLabels: Record = { pre_quote_declined: '사전견적 미참여', pre_quote_submitted: '사전견적제출완료', bidding_sent: '입찰 초대 발송', - bidding_accepted: '입찰 참여', - bidding_declined: '입찰 미참여', + bidding_accepted: '응찰', + bidding_declined: '응찰 포기', bidding_cancelled: '응찰 취소', - bidding_submitted: '응찰 완료' + bidding_submitted: '최종 응찰' } // 6. 문서 타입 enum @@ -120,6 +121,7 @@ export const documentTypeEnum = pgEnum('document_type', [ 'spec_document', // SPEC 문서 'evaluation_doc', // 평가 관련 문서 'bid_attachment', // 입찰 첨부파일 + 'selection_result', // 선정결과 첨부파일 'other' // 기타 ]) @@ -214,6 +216,11 @@ export const biddings = pgTable('biddings', { createdAt: timestamp('created_at').defaultNow().notNull(), updatedAt: timestamp('updated_at').defaultNow().notNull(), // 최종수정일 updatedBy: varchar('updated_by', { length: 100 }), // 최종수정자 + + // 개찰 정보 + openedAt: timestamp('opened_at'), // 개찰일 + openedBy: varchar('opened_by', { length: 100 }), // 개찰자 + ANFNR: varchar({length: 50}).unique(), // 원본 ANFNR 추적을 위한 Bidding/RFQ Number (ECC), onConflict target이므로 unique 처리 }) @@ -384,6 +391,9 @@ export const biddingCompanies = pgTable('bidding_companies', { finalQuoteAmount: decimal('final_quote_amount', { precision: 15, scale: 2 }), finalQuoteSubmittedAt: timestamp('final_quote_submitted_at'), isFinalSubmission: boolean('is_final_submission').default(false), // 최종제출 여부 + + // 견적 히스토리 스냅샷 (JSON 배열) + quotationSnapshots: jsonb('quotation_snapshots'), // 응찰 시점의 품목별 견적 데이터 스냅샷 isWinner: boolean('is_winner'), // 낙찰 여부 isAttendingMeeting: boolean('is_attending_meeting'), // 사양설명회 참석 여부 awardRatio: decimal('award_ratio', { precision: 5, scale: 2 }), // 발주비율 @@ -497,7 +507,7 @@ export const biddingDocuments = pgTable('bidding_documents', { export const vendorSelectionResults = pgTable('vendor_selection_results', { id: serial('id').primaryKey(), biddingId: integer('bidding_id').references(() => biddings.id).notNull(), - selectedCompanyId: integer('selected_company_id').references(() => vendors.id).notNull(), + selectedCompanyId: integer('selected_company_id').references(() => vendors.id), // null이면 전체 선정결과 // 선정 사유 및 결과 selectionReason: text('selection_reason').notNull(), // 선정 사유 -- cgit v1.2.3