diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-09-16 09:20:58 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-09-16 09:20:58 +0000 |
| commit | 6c11fccc84f4c84fa72ee01f9caad9f76f35cea2 (patch) | |
| tree | fa88d10ea7d21fe6b59ed0c1569856a73d56547a /db/schema/generalContract.ts | |
| parent | 14e3990aba7e1ad1cdd0965cbd167c50230cbfbf (diff) | |
(대표님, 최겸) 계약, 업로드 관련, 메뉴처리, 입찰, 프리쿼트, rfqLast관련, tbeLast관련
Diffstat (limited to 'db/schema/generalContract.ts')
| -rw-r--r-- | db/schema/generalContract.ts | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/db/schema/generalContract.ts b/db/schema/generalContract.ts index fe9e04cb..2571faa3 100644 --- a/db/schema/generalContract.ts +++ b/db/schema/generalContract.ts @@ -29,24 +29,27 @@ export const generalContracts = pgTable('general_contracts', { id: serial('id').primaryKey(), // 계약 고유 ID
contractNumber: varchar('contract_number', { length: 255 }).notNull().unique(), // 계약번호 (자동 채번)
revision: integer('revision').notNull().default(0), // 계약 개정 번호
+ //견적에서 넘어온 레코드인지, 입찰에서 넘어온 레코드인지, 자체 생성한 레코드인지 판단하는 타입, default는 자체생성!, notnull
+ // contractSourceType: 견적(estimate), 입찰(bid), 자체생성(manual) 중 하나를 저장하는 컬럼, default는 'manual', not null
+ contractSourceType: varchar('contract_source_type', { length: 20 }).notNull().default('manual'),
// ═══════════════════════════════════════════════════════════════
// 계약 분류 및 상태
// ═══════════════════════════════════════════════════════════════
status: varchar('status', { length: 50 }).notNull(), // 계약 상태 (Draft, Complete the Contract, Contract Delete 등)
category: varchar('category', { length: 50 }).notNull(), // 계약구분 (단가계약, 일반계약, 매각계약)
- type: varchar('type', { length: 50 }).notNull(), // 계약종류 (UP, LE, IL, AL 등)
- executionMethod: varchar('execution_method', { length: 50 }).notNull(), // 체결방식 (단가계약, 일반계약 등)
- name: varchar('name', { length: 255 }).notNull(), // 계약명
+ type: varchar('type', { length: 50 }), // 계약종류 (UP, LE, IL, AL 등)
+ executionMethod: varchar('execution_method', { length: 50 }), // 체결방식 (단가계약, 일반계약 등)
+ name: varchar('name', { length: 255 }), // 계약명
selectionMethod: varchar('selection_method', { length: 50 }), // 업체선정방법
// ═══════════════════════════════════════════════════════════════
// 협력업체 및 계약 기간
// ═══════════════════════════════════════════════════════════════
vendorId: integer('vendor_id').notNull().references(() => vendors.id), // 협력업체 ID
- startDate: date('start_date').notNull(), // 계약 시작일
- endDate: date('end_date').notNull(), // 계약 종료일
- validityEndDate: date('validity_end_date').notNull(), // 계약 유효기간 종료일
+ startDate: date('start_date'), // 계약 시작일
+ endDate: date('end_date'), // 계약 종료일
+ validityEndDate: date('validity_end_date'), // 계약 유효기간 종료일
// ═══════════════════════════════════════════════════════════════
// 연계 정보
@@ -106,7 +109,7 @@ export const generalContracts = pgTable('general_contracts', { // 기타 계약 조건 및 약관 (JSON 형태)
// ═══════════════════════════════════════════════════════════════
terms: jsonb('terms').default({}), // 계약 조건
- complianceChecklist: jsonb('compliance_checklist').default({}), // 하도급법 체크리스트
+ complianceChecklist: jsonb('compliance_checklist').default({}), // 컴플라이언스 체크리스트
communicationChannels: jsonb('communication_channels').default({}), // 커뮤니케이션 채널
locations: jsonb('locations').default({}), // 위치 정보
fieldServiceRates: jsonb('field_service_rates').default({}), // 현장 서비스 요금
@@ -158,7 +161,7 @@ export const generalContractItems = pgTable('general_contract_items', { export const generalContractAttachments = pgTable('general_contract_attachments', {
id: serial('id').primaryKey(),
contractId: integer('contract_id').notNull().references(() => generalContracts.id),
- poContractId: integer('po_contract_id').references(() => contracts.id),
+ poContractId: integer('po_contract_id').references(() => contracts.id),
documentName: varchar('document_name', { length: 255 }).notNull(), // '사양 및 공급범위', '단가파일', '계약서 서명본' 등
fileName: varchar('file_name', { length: 255 }).notNull(), // 실제 파일명
filePath: varchar('file_path', { length: 512 }).notNull(), // 파일 저장 경로 (S3 URL 등)
|
