Introduced New DB

This commit is contained in:
2025-12-06 10:34:58 +01:00
parent 407592680a
commit 63af22b671
80 changed files with 4509 additions and 154 deletions

View File

@@ -0,0 +1,33 @@
import {
pgTable,
uuid,
timestamp,
text,
jsonb,
bigint,
} from "drizzle-orm/pg-core"
import { tenants } from "./tenants"
import { authUsers } from "./auth_users"
export const helpdesk_routing_rules = pgTable("helpdesk_routing_rules", {
id: uuid("id").primaryKey().defaultRandom(),
tenantId: bigint("tenant_id", { mode: "number" })
.notNull()
.references(() => tenants.id, { onDelete: "cascade" }),
name: text("name").notNull(),
condition: jsonb("condition").notNull(),
action: jsonb("action").notNull(),
createdBy: uuid("created_by").references(() => authUsers.id),
createdAt: timestamp("created_at", { withTimezone: true }).defaultNow(),
})
export type HelpdeskRoutingRule =
typeof helpdesk_routing_rules.$inferSelect
export type NewHelpdeskRoutingRule =
typeof helpdesk_routing_rules.$inferInsert