test(quality): added in framrwork
This commit is contained in:
47
database/schema/qualityRequest.ts
Normal file
47
database/schema/qualityRequest.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import {
|
||||
text,
|
||||
pgTable,
|
||||
numeric,
|
||||
index,
|
||||
timestamp,
|
||||
boolean,
|
||||
uuid,
|
||||
uniqueIndex,
|
||||
} from "drizzle-orm/pg-core";
|
||||
import { createInsertSchema, createSelectSchema } from "drizzle-zod";
|
||||
import { z } from "zod";
|
||||
|
||||
export const qualityRequest = pgTable(
|
||||
"qualityRequest",
|
||||
{
|
||||
request_id: uuid("request_id").defaultRandom().primaryKey(),
|
||||
article: numeric("article"),
|
||||
description: text("description"),
|
||||
runningNr: text("runningNr"),
|
||||
lotNr: numeric("lotNr"),
|
||||
warehouseAtRequest: text("warehouseAtRequest"),
|
||||
locationAtRequest: text("locationAtRequest"),
|
||||
warehouseMovedTo: text("warehouseMovedTo"),
|
||||
locationMovedTo: text("locationMovedTo"),
|
||||
durationToMove: numeric("durationToMove"),
|
||||
locationDropOff: text("locationDropOff"),
|
||||
palletStatus: numeric("palletStatus"),
|
||||
palletStatusText: text("palletStatusText"),
|
||||
palletRequest: numeric("palletRequest"),
|
||||
add_date: timestamp("add_date").defaultNow(),
|
||||
add_user: text("add_user").default("LST"),
|
||||
upd_date: timestamp("upd_date").defaultNow(),
|
||||
upd_user: text("upd_user").default("LST"),
|
||||
},
|
||||
(table) => [
|
||||
// uniqueIndex('emailUniqueIndex').on(sql`lower(${table.email})`),
|
||||
// uniqueIndex("role_name").on(table.name),
|
||||
]
|
||||
);
|
||||
|
||||
// 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(qualityRequest);
|
||||
Reference in New Issue
Block a user