import { pgTable, text, timestamp, uuid } from "drizzle-orm/pg-core";
import { createInsertSchema, createSelectSchema } from "drizzle-zod";
import type { z } from "zod";

export const opendockDockSetup = pgTable("opendock_dock_setup", {
	id: uuid("id").defaultRandom().primaryKey(),
	name: text("name").notNull(),
	dockID: text("dock_id").notNull(),
	upd_date: timestamp("upd_date", { withTimezone: true })
		.notNull()
		.defaultNow(),
	upd_user: text("upd_user").notNull().default("lst-system"),
	createdAt: timestamp("created_at", { withTimezone: true })
		.notNull()
		.defaultNow(),
	add_user: text("add_user").notNull().default("lst-system"),
});

export const opendockDockSetupSchema = createSelectSchema(opendockDockSetup);
export const newOpendockDockSetupSchema = createInsertSchema(opendockDockSetup);

export type OpendockArticleSetup = z.infer<typeof opendockDockSetupSchema>;
export type NewOpendockArticleSetup = z.infer<
	typeof newOpendockDockSetupSchema
>;
