Files
cfw-autumn/shared/models/checkouts/checkoutRelations.ts
2026-01-29 13:48:42 +00:00

16 lines
490 B
TypeScript

import { relations } from "drizzle-orm";
import { customers } from "../cusModels/cusTable.js";
import { organizations } from "../orgModels/orgTable.js";
import { checkouts } from "./checkoutTable.js";
export const checkoutsRelations = relations(checkouts, ({ one }) => ({
org: one(organizations, {
fields: [checkouts.org_id],
references: [organizations.id],
}),
customer: one(customers, {
fields: [checkouts.internal_customer_id],
references: [customers.internal_id],
}),
}));