fix(database): correction to the printer modules

This commit is contained in:
2025-04-04 17:08:25 -05:00
parent 16e5413a90
commit 8194798a37
20 changed files with 12720 additions and 4 deletions

View File

@@ -11,8 +11,8 @@ import {
import { createInsertSchema, createSelectSchema } from "drizzle-zod";
import { z } from "zod";
export const printers = pgTable(
"printers",
export const printerData = pgTable(
"printerData",
{
printer_id: uuid("printer_id").defaultRandom().primaryKey(),
humanReadableId: text("humanReadableId"),
@@ -21,9 +21,10 @@ export const printers = pgTable(
port: numeric("port"),
status: text("status"),
statusText: text("statusText"),
lastTimePrinted: text("lastTimePrinted"),
lastTimePrinted: timestamp("lastTimePrinted").notNull().defaultNow(),
assigned: boolean("assigned").default(false),
remark: text("remark"),
printDelay: numeric("printDelay"),
monitorState: boolean("monitorState").default(false),
add_Date: timestamp("add_Date").defaultNow(),
upd_date: timestamp("upd_date").defaultNow(),
@@ -39,4 +40,4 @@ export const printers = pgTable(
// 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(printers);
export const selectRolesSchema = createSelectSchema(printerData);