test(fifo index): running fifo index data on 2 servers as a trial to validate data

This commit is contained in:
2025-05-27 15:01:07 -05:00
parent f8001f2497
commit d07d1000c3
10 changed files with 2172 additions and 4 deletions

View File

@@ -0,0 +1,40 @@
import {
text,
pgTable,
numeric,
index,
timestamp,
boolean,
uuid,
uniqueIndex,
jsonb,
} from "drizzle-orm/pg-core";
import { createInsertSchema, createSelectSchema } from "drizzle-zod";
import { z } from "zod";
export const fifoIndex = pgTable(
"fifoIndex",
{
fifoIndex_id: uuid("fifoIndex_id").defaultRandom().primaryKey(),
lot: text("lot").notNull(),
av: numeric("av").notNull(),
runningNr: numeric("runningNr").notNull(),
prodDate: timestamp("prodDate").notNull(),
// currentInv: jsonb("currentInv").default([]),
fifoFollowed: boolean("fifoFollowed").notNull(),
add_Date: timestamp("add_Date").defaultNow(),
},
(table) => [
// uniqueIndex('emailUniqueIndex').on(sql`lower(${table.email})`),
// uniqueIndex("role_name").on(table.name),
uniqueIndex("fifo_runningNr").on(table.runningNr),
]
);
// 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(fifoIndex);