diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-06-15 04:42:45 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-06-15 04:42:45 +0000 |
| commit | a15475296b9da1cb83995b24acf9a6a20b635756 (patch) | |
| tree | b52aff8cbf04f6b4d59a0ed68dd52c48977d8d03 | |
| parent | 7305a614ca20d50e6ab50bbcfbb128a6f1f90e53 (diff) | |
(최겸) user 기술영업벤더ID 추가
| -rw-r--r-- | db/schema/users.ts | 3 | ||||
| -rw-r--r-- | lib/users/service.ts | 2 | ||||
| -rw-r--r-- | lib/users/verifyOtp.ts | 3 |
3 files changed, 8 insertions, 0 deletions
diff --git a/db/schema/users.ts b/db/schema/users.ts index 8346c24b..2a1e45d6 100644 --- a/db/schema/users.ts +++ b/db/schema/users.ts @@ -1,6 +1,7 @@ import { integer, pgTable, varchar,timestamp,pgEnum ,pgView, text, primaryKey} from "drizzle-orm/pg-core"; import { eq , sql} from "drizzle-orm"; import { vendors } from "./vendors"; +import { techVendors } from "./techVendors"; export const userDomainEnum = pgEnum("user_domain", ["evcp", "partners"]); @@ -11,6 +12,8 @@ export const users = pgTable("users", { email: varchar("email", { length: 255 }).notNull().unique(), companyId: integer("company_id") .references(() => vendors.id, { onDelete: "set null" }), + techCompanyId: integer("tech_company_id") + .references(() => techVendors.id, { onDelete: "set null" }), domain: userDomainEnum("domain").notNull().default("partners"), createdAt: timestamp("created_at", { withTimezone: true }) .defaultNow() diff --git a/lib/users/service.ts b/lib/users/service.ts index 8b2c927e..0d0121b3 100644 --- a/lib/users/service.ts +++ b/lib/users/service.ts @@ -192,6 +192,7 @@ export async function findEmailandOtp(email: string, code: string) { id: userRecord.id, // user id imageUrl:userRecord.imageUrl, companyId:userRecord.companyId, + techCompanyId:userRecord.techCompanyId, domain:userRecord.domain // 기타 필요한 필드... } @@ -218,6 +219,7 @@ export async function findEmailTemp(email: string) { id: userRecord.id, // user id imageUrl:userRecord.imageUrl, companyId:userRecord.companyId, + techCompanyId:userRecord.techCompanyId, domain:userRecord.domain // 기타 필요한 필드... } diff --git a/lib/users/verifyOtp.ts b/lib/users/verifyOtp.ts index 84919024..7b25ed49 100644 --- a/lib/users/verifyOtp.ts +++ b/lib/users/verifyOtp.ts @@ -23,6 +23,7 @@ export async function verifyOtp(email: string, code: string) { id: otpRecord.id, imageUrl: otpRecord.imageUrl, companyId: otpRecord.companyId, + techCompanyId: otpRecord.techCompanyId, domain: otpRecord.domain, } } @@ -44,6 +45,7 @@ export async function verifyOtpTemp(email: string) { id: otpRecord.id, imageUrl: otpRecord.imageUrl, companyId: otpRecord.companyId, + techCompanyId: otpRecord.techCompanyId, domain: otpRecord.domain, } } @@ -70,6 +72,7 @@ export async function verifyExternalCredentials(username: string, password: stri id: otpRecord.id, imageUrl: otpRecord.imageUrl, companyId: otpRecord.companyId, + techCompanyId: otpRecord.techCompanyId, domain: otpRecord.domain, } } |
