feat(purchase): historical data capture for alpla purchase
This commit is contained in:
38
backend/db/schema/alplapurchase.schema.ts
Normal file
38
backend/db/schema/alplapurchase.schema.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import {
|
||||
integer,
|
||||
jsonb,
|
||||
pgTable,
|
||||
text,
|
||||
timestamp,
|
||||
uuid,
|
||||
} from "drizzle-orm/pg-core";
|
||||
import { createInsertSchema, createSelectSchema } from "drizzle-zod";
|
||||
import type { z } from "zod";
|
||||
|
||||
export const alplaPurchaseHistory = pgTable("alpla_purchase_history", {
|
||||
id: uuid("id").defaultRandom().primaryKey(),
|
||||
apo: integer("apo"),
|
||||
revision: integer("revision"),
|
||||
confirmed: integer("confirmed"),
|
||||
status: integer("status"),
|
||||
statusText: integer("status_text"),
|
||||
journalNum: integer("journal_num"),
|
||||
add_date: timestamp("add_date").defaultNow(),
|
||||
upd_date: timestamp("upd_date").defaultNow(),
|
||||
add_user: text("add_user"),
|
||||
upd_user: text("upd_user"),
|
||||
remark: text("remark"),
|
||||
approvedStatus: text("approved_status"),
|
||||
position: jsonb("position").default([]),
|
||||
createdAt: timestamp("created_at").defaultNow(),
|
||||
});
|
||||
|
||||
export const alplaPurchaseHistorySchema =
|
||||
createSelectSchema(alplaPurchaseHistory);
|
||||
export const newAlplaPurchaseHistorySchema =
|
||||
createInsertSchema(alplaPurchaseHistory);
|
||||
|
||||
export type AlplaPurchaseHistory = z.infer<typeof alplaPurchaseHistorySchema>;
|
||||
export type NewAlplaPurchaseHistory = z.infer<
|
||||
typeof newAlplaPurchaseHistorySchema
|
||||
>;
|
||||
Reference in New Issue
Block a user