summaryrefslogtreecommitdiff
path: root/db/schema
diff options
context:
space:
mode:
Diffstat (limited to 'db/schema')
-rw-r--r--db/schema/techVendors.ts29
1 files changed, 18 insertions, 11 deletions
diff --git a/db/schema/techVendors.ts b/db/schema/techVendors.ts
index 113a5a1a..b5624b85 100644
--- a/db/schema/techVendors.ts
+++ b/db/schema/techVendors.ts
@@ -31,14 +31,19 @@ export const techVendors = pgTable("tech_vendors", {
"ACTIVE",
"INACTIVE",
"BLACKLISTED",
- "PENDING_REVIEW"
+ "PENDING_INVITE",
+ "INVITED",
+ "QUOTE_COMPARISON"
]
}).default("ACTIVE").notNull(),
+ // 견적비교용 벤더 여부
+ isQuoteComparison: boolean("is_quote_comparison").default(false).notNull(),
// 대표자 정보
representativeName: varchar("representative_name", { length: 255 }),
representativeEmail: varchar("representative_email", { length: 255 }),
representativePhone: varchar("representative_phone", { length: 50 }),
representativeBirth: varchar("representative_birth", { length: 20 }),
+ // 아이템 정보 (legacy 지원)
items: text("items"),
createdAt: timestamp("created_at").defaultNow().notNull(),
updatedAt: timestamp("updated_at").defaultNow().notNull(),
@@ -50,15 +55,26 @@ export const techVendorContacts = pgTable("tech_vendor_contacts", {
contactPosition: varchar("contact_position", { length: 100 }),
contactEmail: varchar("contact_email", { length: 255 }).notNull(),
contactPhone: varchar("contact_phone", { length: 50 }),
+ country: varchar("country", { length: 100 }),
isPrimary: boolean("is_primary").default(false).notNull(),
createdAt: timestamp("created_at").defaultNow().notNull(),
updatedAt: timestamp("updated_at").defaultNow().notNull(),
});
export const techVendorPossibleItems = pgTable("tech_vendor_possible_items", {
id: serial("id").primaryKey(),
+
+ // 벤더 정보
vendorId: integer("vendor_id").notNull().references(() => techVendors.id),
- // itemId: integer("item_id"), // 별도 item 테이블 연동시
+ vendorCode: varchar("vendor_code", { length: 100 }), // 검색/필터용 중복 저장
+ vendorEmail: varchar("vendor_email", { length: 255 }), // 검색/필터용 중복 저장
+
+ // 아이템 정보 (필수: itemCode, 나머지는 nullable)
itemCode: varchar("item_code", { length: 100 }).notNull(),
+ workType: varchar("work_type", { length: 100 }), // 공종 (nullable)
+ shipTypes: varchar("ship_types", { length: 255 }), // 선종 (nullable)
+ itemList: varchar("item_list", { length: 500 }), // 아이템 리스트 (nullable)
+ subItemList: varchar("sub_item_list", { length: 500 }), // 서브 아이템 리스트 (nullable)
+
createdAt: timestamp("created_at").defaultNow().notNull(),
updatedAt: timestamp("updated_at").defaultNow().notNull(),
});
@@ -196,13 +212,8 @@ export const techVendorCandidates = pgTable("tech_vendor_candidates", {
companyName: varchar("company_name", { length: 255 }).notNull(),
contactEmail: varchar("contact_email", { length: 255 }),
contactPhone: varchar("contact_phone", { length: 50 }),
-
taxId: varchar("tax_id", { length: 100 }),
- address: text("address"),
-
country: varchar("country", { length: 100 }),
- // 웹 크롤링 등으로 얻은 상태나 분류
- source: varchar("source", { length: 100 }), // 수집 출처
status: varchar("status", {
length: 30,
enum: [
@@ -214,7 +225,6 @@ export const techVendorCandidates = pgTable("tech_vendor_candidates", {
.notNull()
.default("COLLECTED"),
remark: text("remark"),
- items: text("items").notNull(),
vendorId: integer("vendor_id")
.references(() => techVendors.id, { onDelete: "cascade" }),
createdAt: timestamp("created_at").defaultNow().notNull(),
@@ -230,11 +240,8 @@ export const techVendorCandidatesWithVendorInfo = pgView("tech_vendor_candidates
contactEmail: techVendorCandidates.contactEmail,
contactPhone: techVendorCandidates.contactPhone,
taxId: techVendorCandidates.taxId,
- address: techVendorCandidates.address,
country: techVendorCandidates.country,
- source: techVendorCandidates.source,
status: techVendorCandidates.status,
- items: techVendorCandidates.items,
remark: techVendorCandidates.remark,
createdAt: techVendorCandidates.createdAt,
updatedAt: techVendorCandidates.updatedAt,