feat(dm): standard forecast added in rest of migration to come

This commit is contained in:
2026-06-14 03:52:34 -05:00
parent d85f08cb19
commit 39db142db4
18 changed files with 6163 additions and 4 deletions

View File

@@ -0,0 +1,22 @@
import { jsonb, pgTable, text, timestamp, uuid } from "drizzle-orm/pg-core";
import { createInsertSchema, createSelectSchema } from "drizzle-zod";
import type { z } from "zod";
export const forecastImport = pgTable("forecast_import", {
id: uuid("id").defaultRandom().primaryKey(),
receivingPlantId: text("receiving_plant_id").notNull(),
documentName: text("documentName"),
sender: text("sender"),
customerId: text("customer_id"),
rawData: jsonb("raw_data").default([]),
add_date: timestamp("add_date", { withTimezone: true }).defaultNow(),
add_user: text("add_user").default("lst-system"),
upd_date: timestamp("upd_date", { withTimezone: true }).defaultNow(),
upd_user: text("upd_user").default("lst-system"),
});
export const forecastImportSchema = createSelectSchema(forecastImport);
export const newForecastImportSchema = createInsertSchema(forecastImport);
export type ForecastImport = z.infer<typeof forecastImportSchema>;
export type NeworecastImport = z.infer<typeof newForecastImportSchema>;