28 lines
940 B
TypeScript
28 lines
940 B
TypeScript
import { pgTable, uuid, timestamp, text, boolean, bigint, doublePrecision } from "drizzle-orm/pg-core"
|
|
|
|
import { tenants } from "./tenants"
|
|
import { authUsers } from "./auth_users"
|
|
|
|
export const hourrates = pgTable("hourrates", {
|
|
id: uuid("id").primaryKey().defaultRandom(),
|
|
|
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
|
|
tenant: bigint("tenant", { mode: "number" })
|
|
.notNull()
|
|
.references(() => tenants.id),
|
|
|
|
name: text("name").notNull(),
|
|
|
|
purchasePrice: doublePrecision("purchasePrice").notNull(),
|
|
sellingPrice: doublePrecision("sellingPrice").notNull(),
|
|
|
|
archived: boolean("archived").notNull().default(false),
|
|
|
|
updatedAt: timestamp("updated_at", { withTimezone: true }),
|
|
updatedBy: uuid("updated_by").references(() => authUsers.id),
|
|
})
|
|
|
|
export type HourRate = typeof hourrates.$inferSelect
|
|
export type NewHourRate = typeof hourrates.$inferInsert
|