Files
FEDEO/backend/db/schema/documenttemplates.ts
root d90499a101
All checks were successful
Build and Push Docker Images / build-frontend (push) Successful in 1m22s
Build and Push Docker Images / build-website (push) Successful in 23s
Build and Push Docker Images / build-central-services-api (push) Successful in 22s
Build and Push Docker Images / build-backend (push) Successful in 43s
Build and Push Docker Images / build-central-services-admin (push) Successful in 21s
Build and Push Docker Images / build-docs (push) Successful in 21s
Dokumentenvorlagen im Ausgangsbeleg-Editor ergänzen
2026-08-31 18:49:40 +00:00

40 lines
1.2 KiB
TypeScript

import {
pgTable,
bigint,
text,
timestamp,
boolean,
jsonb,
uuid,
} from "drizzle-orm/pg-core"
import { tenants } from "./tenants"
import { authUsers } from "./auth_users"
export const documenttemplates = pgTable("documenttemplates", {
id: bigint("id", { mode: "number" })
.primaryKey()
.generatedByDefaultAsIdentity(),
createdAt: timestamp("created_at", { withTimezone: true })
.notNull()
.defaultNow(),
tenant: bigint("tenant", { mode: "number" })
.notNull()
.references(() => tenants.id),
name: text("name").notNull(),
documentType: text("document_type").notNull(),
templateData: jsonb("template_data").notNull().default({}),
default: boolean("default").notNull().default(false),
archived: boolean("archived").notNull().default(false),
updatedAt: timestamp("updated_at", { withTimezone: true }),
updatedBy: uuid("updated_by").references(() => authUsers.id),
createdBy: uuid("created_by").references(() => authUsers.id),
})
export type DocumentTemplate = typeof documenttemplates.$inferSelect
export type NewDocumentTemplate = typeof documenttemplates.$inferInsert