21 lines
923 B
TypeScript
21 lines
923 B
TypeScript
import {text, pgTable, timestamp, uuid, integer} from "drizzle-orm/pg-core";
|
|
import {createInsertSchema, createSelectSchema} from "drizzle-zod";
|
|
import {z} from "zod";
|
|
|
|
export const manualPrinting = pgTable("manualPrinting", {
|
|
print_id: uuid("print_id").defaultRandom().primaryKey(),
|
|
line: integer("line"),
|
|
printReason: text("printReason").notNull(),
|
|
initials: text("initials").notNull(),
|
|
additionalComments: text("additionalComments").notNull(),
|
|
add_date: timestamp("add_date").defaultNow(),
|
|
add_user: text("add_user"),
|
|
});
|
|
|
|
// Schema for inserting a user - can be used to validate API requests
|
|
// export const insertRolesSchema = createInsertSchema(roles, {
|
|
// name: z.string().min(3, {message: "Role name must be more than 3 letters"}),
|
|
// });
|
|
// Schema for selecting a Expenses - can be used to validate API responses
|
|
export const selectRolesSchema = createSelectSchema(manualPrinting);
|