21 lines
691 B
TypeScript
21 lines
691 B
TypeScript
import {
|
|
pgTable,
|
|
bigint,
|
|
timestamp,
|
|
text,
|
|
jsonb,
|
|
boolean,
|
|
uuid,
|
|
} from "drizzle-orm/pg-core"
|
|
import {tenants} from "./tenants";
|
|
|
|
export const serialExecutions = pgTable("serial_executions", {
|
|
id: uuid("id").primaryKey().defaultRandom(),
|
|
tenant: bigint("tenant", { mode: "number" })
|
|
.notNull()
|
|
.references(() => tenants.id), executionDate: timestamp("execution_date").notNull(),
|
|
status: text("status").default("draft"), // 'draft', 'completed'
|
|
createdBy: text("created_by"), // oder UUID, je nach Auth-System
|
|
createdAt: timestamp("created_at").defaultNow(),
|
|
summary: text("summary"), // z.B. "25 Rechnungen erstellt"
|
|
}); |