feat(eom): added in historical inv data split accordingly
This commit is contained in:
@@ -1,12 +1,43 @@
|
||||
import {date, pgTable, text} from "drizzle-orm/pg-core";
|
||||
import {createSelectSchema} from "drizzle-zod";
|
||||
import {
|
||||
date,
|
||||
integer,
|
||||
pgTable,
|
||||
text,
|
||||
timestamp,
|
||||
uuid,
|
||||
} from "drizzle-orm/pg-core";
|
||||
import { createSelectSchema } from "drizzle-zod";
|
||||
|
||||
export const eom = pgTable(
|
||||
"eom",
|
||||
{
|
||||
eomMonth: date().notNull(),
|
||||
article: text().notNull(),
|
||||
articleDescription: text().notNull(),
|
||||
eom_id: uuid("eom_id").defaultRandom().primaryKey(),
|
||||
eomMonth: date("eomMonth").notNull(), // what month are we running in should just be the first of current month
|
||||
plantToken: text("plantToken"),
|
||||
article: text("article").notNull(),
|
||||
articleDescription: text("articleDescription").notNull(),
|
||||
materialType: text("materialType"),
|
||||
invStart: integer("invStart"), // this will come from the previous month
|
||||
invEnd: integer("invEnd"),
|
||||
intransit: integer("intransit"),
|
||||
// pass over a calculation for ending inv
|
||||
purchase: integer("purchase"),
|
||||
gpRecived: integer("gpRecived"),
|
||||
// pass calcuation for difference
|
||||
materialIn: integer("materialIn"), // from other alpla plants
|
||||
materialOut: integer("materialOut"), // out to other alpla plants
|
||||
quarantine: integer("quarantine"),
|
||||
// calcualtion for actaul consumption
|
||||
prodConsumption: integer("prodConsumption"),
|
||||
// difference will be a calculated number
|
||||
// waste will be calculated.
|
||||
priceKg: text("priceKg"), // will be converted to a float and then calcuated into the data
|
||||
// loss/gain calcualtion
|
||||
comments: text("comments"),
|
||||
weight: text("weight"), // for calculations should be converted to a float
|
||||
pfc: text("pfc"), // profit center this will belong too.
|
||||
upd_user: text("upd_user"),
|
||||
upd_date: timestamp("upd_date"),
|
||||
}
|
||||
// (table) => [
|
||||
// // uniqueIndex('emailUniqueIndex').on(sql`lower(${table.email})`),
|
||||
|
||||
Reference in New Issue
Block a user