feat(siloadjustments): added email for comments :D

This commit is contained in:
2025-04-04 22:09:47 -05:00
parent 9f26f2334f
commit f1abe7b33d
24 changed files with 8565 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
CREATE TABLE "siloAdjustments" (
"lsiloAdjust_id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"level" integer,
"locationID" integer,
"currentStockLevel" numeric,
"newLevel" numeric,
"comments" text DEFAULT '',
"dateAdjusted" timestamp DEFAULT now(),
"lastDateAdjusted" timestamp DEFAULT now(),
"statusMessage" text DEFAULT '',
"add_user" text DEFAULT 'LST_Serivce'
);

View File

@@ -0,0 +1,5 @@
ALTER TABLE "siloAdjustments" ADD COLUMN "comment" text DEFAULT '';--> statement-breakpoint
ALTER TABLE "siloAdjustments" ADD COLUMN "commentAddedBy" text;--> statement-breakpoint
ALTER TABLE "siloAdjustments" ADD COLUMN "commentDate" text;--> statement-breakpoint
ALTER TABLE "siloAdjustments" DROP COLUMN "comments";--> statement-breakpoint
ALTER TABLE "siloAdjustments" DROP COLUMN "statusMessage";

View File

@@ -0,0 +1 @@
ALTER TABLE "siloAdjustments" ADD COLUMN "commentKey" text;

View File

@@ -0,0 +1 @@
CREATE UNIQUE INDEX "subModule_name" ON "subModules" USING btree ("name");

View File

@@ -0,0 +1 @@
ALTER TABLE "subModules" ADD COLUMN "icon" text;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -302,6 +302,41 @@
"when": 1743778477759,
"tag": "0042_big_power_pack",
"breakpoints": true
},
{
"idx": 43,
"version": "7",
"when": 1743809547351,
"tag": "0043_free_winter_soldier",
"breakpoints": true
},
{
"idx": 44,
"version": "7",
"when": 1743811709366,
"tag": "0044_hot_smasher",
"breakpoints": true
},
{
"idx": 45,
"version": "7",
"when": 1743819367359,
"tag": "0045_heavy_ravenous",
"breakpoints": true
},
{
"idx": 46,
"version": "7",
"when": 1743821039322,
"tag": "0046_keen_firebird",
"breakpoints": true
},
{
"idx": 47,
"version": "7",
"when": 1743822056329,
"tag": "0047_silky_starbolt",
"breakpoints": true
}
]
}

View File

@@ -0,0 +1,39 @@
import {
text,
pgTable,
numeric,
timestamp,
uuid,
integer,
} from "drizzle-orm/pg-core";
import { createInsertSchema, createSelectSchema } from "drizzle-zod";
import { z } from "zod";
export const siloAdjustments = pgTable(
"siloAdjustments",
{
siloAdjust_id: uuid("lsiloAdjust_id").defaultRandom().primaryKey(),
warehouseID: integer("level"),
locationID: integer("locationID"),
currentStockLevel: numeric("currentStockLevel"),
newLevel: numeric("newLevel"),
comment: text("comment").default(""),
dateAdjusted: timestamp("dateAdjusted").defaultNow(),
lastDateAdjusted: timestamp("lastDateAdjusted").defaultNow(),
commentAddedBy: text("commentAddedBy"),
commentDate: text("commentDate"),
commentKey: text("commentKey"),
add_user: text("add_user").default("LST_Serivce"),
},
(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(siloAdjustments);