From de4c8a6a6b7c918a7a16fc34423d1143209c295f Mon Sep 17 00:00:00 2001 From: dujinkim Date: Thu, 3 Jul 2025 01:59:36 +0000 Subject: (최겸) 기술영업 벤더 공종 조회 기능 추가 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/schema/techVendors.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'db/schema/techVendors.ts') diff --git a/db/schema/techVendors.ts b/db/schema/techVendors.ts index 9cb15ad8..113a5a1a 100644 --- a/db/schema/techVendors.ts +++ b/db/schema/techVendors.ts @@ -30,7 +30,8 @@ export const techVendors = pgTable("tech_vendors", { enum: [ "ACTIVE", "INACTIVE", - "BLACKLISTED" + "BLACKLISTED", + "PENDING_REVIEW" ] }).default("ACTIVE").notNull(), // 대표자 정보 @@ -57,10 +58,7 @@ 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 테이블 연동시 - itemCode: varchar("item_code", { length: 100 }) - .notNull() - .references(() => items.itemCode, { onDelete: "cascade" }), - itemName: varchar("item_name", { length: 255 }).notNull(), + itemCode: varchar("item_code", { length: 100 }).notNull(), createdAt: timestamp("created_at").defaultNow().notNull(), updatedAt: timestamp("updated_at").defaultNow().notNull(), }); @@ -83,7 +81,6 @@ export const techVendorItemsView = pgView("tech_vendor_items_view").as((qb) => { vendorItemId: techVendorPossibleItems.id, vendorId: techVendorPossibleItems.vendorId, itemCode: items.itemCode, - itemName: items.itemName, createdAt: techVendorPossibleItems.createdAt, updatedAt: techVendorPossibleItems.updatedAt, }) @@ -173,8 +170,7 @@ export const techVendorDetailView = pgView("tech_vendor_detail_view").as((qb) => (SELECT COALESCE( json_agg( json_build_object( - 'itemCode', i.item_code, - 'itemName', it.item_name + 'itemCode', i.item_code ) ), '[]'::json @@ -266,4 +262,5 @@ export type TechVendorCandidate = typeof techVendorCandidates.$inferSelect export type TechVendorWithAttachments = TechVendor & { hasAttachments?: boolean; attachmentsList?: TechVendorAttach[]; + workTypes?: string; } \ No newline at end of file -- cgit v1.2.3