Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

Refactor: Update custom rule filter logic (#846)

Side07ad568d08a
diff --git a/apps/erp/app/components/Form/StorageUnitDrillSelect.tsx b/apps/erp/app/components/Form/StorageUnitDrillSelect.tsx
index 9ff08e04f7..5881e84140 100644
--- a/apps/erp/app/components/Form/StorageUnitDrillSelect.tsx
+++ b/apps/erp/app/components/Form/StorageUnitDrillSelect.tsx
@@ -286,7 +286,7 @@ export function StorageUnitDrillSelect({
/>
{/* List */}
- <ul role="list" className="max-h-[260px] overflow-y-auto py-1">
+ <ul className="max-h-[260px] overflow-y-auto py-1">
{searchResults ? (
searchResults.length === 0 ? (
<li className="px-3 py-6 text-center text-xs text-muted-foreground">
diff --git a/apps/erp/app/modules/customRules/customRules.models.ts b/apps/erp/app/modules/customRules/customRules.models.ts
index 04691b0b0c..ecee78c258 100644
--- a/apps/erp/app/modules/customRules/customRules.models.ts
+++ b/apps/erp/app/modules/customRules/customRules.models.ts
@@ -1,4 +1,6 @@
import {
+ getFieldDef,
+ isFieldAvailableOnSurfaces,
SURFACES_BY_TARGET_TYPE,
TARGET_TYPES,
TRANSACTION_SURFACES
@@ -59,7 +61,12 @@ export const customRuleValidator = z
message: z.string().min(1, { message: "Message is required" }).max(500),
severity: z.enum(customRuleSeverities),
targetType: z.enum(TARGET_TYPES),
+ // Broadcast gate for storageUnit / workCenter rules. Item rules ignore this
+ // and use the filteredItem* fields instead (empty = all items).
appliesToAll: zfd.checkbox(),
+ filteredItemTypes: zfd.repeatableOfType(z.string()).optional(),
+ filteredItemGroupIds: zfd.repeatableOfType(z.string()).optional(),
+ filteredItemMatchAll: zfd.checkbox(),
active: zfd.checkbox(),
surfaces: zfd
.repeatableOfType(z.enum(TRANSACTION_SURFACES))
@@ -82,6 +89,20 @@ export const customRuleValidator = z
});
}
}
+
+ // Reject conditions on a registry field whose context the evaluator won't
+ // populate for every selected surface (else it resolves undefined → false
+ // "X is required"). Unknown paths are left to runtime presence handling.
+ val.conditionAst.conditions.forEach((c, i) => {
+ const def = getFieldDef(c.field);
+ if (def && !isFieldAvailableOnSurfaces(def, val.surfaces)) {
+ ctx.addIssue({
+ code: z.ZodIssueCode.custom,
+ path: ["conditionAst", "conditions", i, "field"],
+ message: `"${def.label}" isn't available on the selected surface(s)`
+ });
+ }
+ });
});
/**
diff --git a/apps/erp/app/modules/customRules/customRules.service.ts b/apps/erp/app/modules/customRules/customRules.service.ts
index 3c7dbe3b40..3327242cee 100644
--- a/apps/erp/app/modules/customRules/customRules.service.ts
+++ b/apps/erp/app/modules/customRules/customRules.service.ts
@@ -15,7 +15,14 @@ import type { GenericQueryFilters } from "~/utils/query";
import { setGenericQueryFilters } from "~/utils/query";
import { sanitize } from "~/utils/supabase";
-type CustomRuleInsert = {
+type CustomRuleFilters = {
+ appliesToAll: boolean;
+ filteredItemTypes?: string[];
+ filteredItemGroupIds?: string[];
+ filteredItemMatchAll?: boolean;
+};
+
+type CustomRuleInsert = CustomRuleFilters & {
name: string;
description?: string | null;
message: string;
@@ -23,14 +30,13 @@ type CustomRuleInsert = {
conditionAst: ConditionAst;
surfaces: TransactionSurface[];
targetType: TargetType;
- appliesToAll: boolean;
active: boolean;
companyId: string;
createdBy: string;
customFields?: Json;
};
-type CustomRuleUpdate = {
+type CustomRuleUpdate = CustomRuleFilters & {
id: string;
name: string;
description?: string | null;
@@ -38,7 +44,6 @@ type CustomRuleUpdate = {
severity: Severity;
conditionAst: ConditionAst;
surfaces: TransactionSurface[];
- appliesToAll: boolean;
active: boolean;
updatedBy: string;
customFields?: Json;
diff --git a/apps/erp/app/modules/customRules/ui/ConditionRow.tsx b/apps/erp/app/modules/customRules/ui/ConditionRow.tsx
index 3bd351fea1..fe38ab799d 100644
--- a/apps/erp/app/modules/customRules/ui/ConditionRow.tsx
+++ b/apps/erp/app/modules/customRules/ui/ConditionRow.tsx
@@ -5,6 +5,7 @@ import {
type FieldDef,
getFieldDef,
getFieldSurfaceNotes,
+ isFieldAvailableOnSurfaces,
type Operator,
SURFACES_BY_TARGET_TYPE,
type TransactionSurface
@@ -72,6 +73,18 @@ function ConditionRowImpl({
[condition.field]
);
+ // A field selected before the surfaces changed may no longer be populated on
+ // the rule's current surfaces. Flag it so the author re-picks — mirrors the
+ // save-time validator gate (customRules.models.ts) client-side.
+ const fieldUnavailable = useMemo(
+ () =>
+ !!fieldDef &&
+ !!surfaces &&
+ surfaces.length > 0 &&
+ !isFieldAvailableOnSurfaces(fieldDef, surfaces),
+ [fieldDef, surfaces]
+ );
+
const availableOps = useMemo<Operator[]>(
() => (fieldDef ? availableOperators(fieldDef) : []),
[fieldDef]
@@ -129,6 +142,7 @@ function ConditionRowImpl({
<FieldCombobox
value={condition.field}
targetType={targetType}
+ surfaces={surfaces}
onChange={(path) => {
const nextDef = getFieldDef(path);
const nextOps = nextDef ? availableOperators(nextDef) : [];
@@ -158,6 +172,12 @@ function ConditionRowImpl({
/>
</div>
+ {fieldUnavailable && (
+ <p className="mt-2 text-xs font-medium leading-none text-destructive">
+ {t`"${fieldDef?.label ?? condition.field}" isn't available on the selected surface(s). Pick another field.`}
+ </p>
+ )}
+
{surfaceNotes && (
<details className="mt-2 group rounded-md border border-dashed border-border/70 bg-muted/30 px-2 py-1.5 text-xs text-muted-foreground">
<summary className="cursor-pointer select-none text-[11px] font-medium uppercase tracking-wider text-muted-foreground/90 hover:text-foreground">
diff --git a/apps/erp/app/modules/customRules/ui/CustomRuleForm.tsx b/apps/erp/app/modules/customRules/ui/CustomRuleForm.tsx
index 8edd74d72a..03e84fbd46 100644
--- a/apps/erp/app/modules/customRules/ui/CustomRuleForm.tsx
+++ b/apps/erp/app/modules/customRules/ui/CustomRuleForm.tsx
@@ -31,6 +31,7 @@ import {
import { usePermissions } from "~/hooks";
import { path } from "~/utils/path";
import { customRuleValidator } from "../customRules.models";
+import ItemFilterSelector from "./ItemFilterSelector";
import MessageWithTokens from "./MessageWithTokens";
import RuleBuilder from "./RuleBuilder";
import SeveritySelect from "./SeveritySelect";
@@ -102,6 +103,9 @@ export default function CustomRuleForm({
severity: initialValues.severity ?? "error",
targetType,
appliesToAll: initialValues.appliesToAll ?? false,
+ filteredItemTypes: initialValues.filteredItemTypes ?? [],
+ filteredItemGroupIds: initialValues.filteredItemGroupIds ?? [],
+ filteredItemMatchAll: initialValues.filteredItemMatchAll ?? false,
active: initialValues.active ?? true,
surfaces: defaultSurfaces
};
@@ -148,17 +152,19 @@ export default function CustomRuleForm({
placeholder={t`Optional context for this rule`}
/>
<SeveritySelect name="severity" />
- <Boolean
- name="appliesToAll"
- label={
- targetType === "item"
- ? t`Applies to all items`
- : targetType === "storageUnit"
+ {targetType === "item" ? (
+ <ItemFilterSelector />
+ ) : (
+ <Boolean
+ name="appliesToAll"
+ label={
+ targetType === "storageUnit"
? t`Applies to all storage units`
: t`Applies to all work centers`
- }
- description={t`When on, this rule fires for every target of its type. Assignment rows are ignored but preserved.`}
- />
+ }
+ description={t`When on, this rule fires for every target of its type. Assignment rows are ignored but preserved.`}
+ />
+ )}
<SurfacesField
name="surfaces"
targetType={targetType}
diff --git a/apps/erp/app/modules/customRules/ui/CustomRulesGroups.tsx b/apps/erp/app/modules/customRules/ui/CustomRulesGroups.tsx
index 2dee81ac86..829284a836 100644
--- a/apps/erp/app/modules/customRules/ui/CustomRulesGroups.tsx
+++ b/apps/erp/app/modules/customRules/ui/CustomRulesGroups.tsx
@@ -47,12 +47,40 @@ type RuleListItem = {
severity: "error" | "warn";
active: boolean;
appliesToAll: boolean;
+ filteredItemTypes?: string[];
+ filteredItemGroupIds?: string[];
surfaces?: TransactionSurface[];
assignmentCount?: number;
description?: string | null;
message?: string;
};
+// How a rule reaches its targets, for the badge + assignment display.
+// Item rules use type/group filters (empty = all items); other targets use the
+// appliesToAll broadcast flag.
+function ruleReach(rule: RuleListItem): {
+ broadcastLabel: string | null;
+ showAssignments: boolean;
+} {
+ if (rule.targetType === "item") {
+ const types = rule.filteredItemTypes ?? [];
+ const groups = rule.filteredItemGroupIds ?? [];
+ if (types.length === 0 && groups.length === 0) {
+ return { broadcastLabel: "All items", showAssignments: false };
+ }
+ const parts: string[] = [];
+ if (types.length)
+ parts.push(`${types.length} type${types.length > 1 ? "s" : ""}`);
+ if (groups.length)
+ parts.push(`${groups.length} group${groups.length > 1 ? "s" : ""}`);
+ return { broadcastLabel: parts.join(" · "), showAssignments: true };
+ }
+ return {
+ broadcastLabel: rule.appliesToAll ? "Applies to all" : null,
+ showAssignments: !rule.appliesToAll
+ };
+}
+
type CustomRulesGroupsProps = {
rules: RuleListItem[];
};
@@ -193,6 +221,7 @@ const CustomRuleCard = memo(({ rule }: { rule: RuleListItem }) => {
const canEdit = permissions.can("update", "settings");
const canDelete = permissions.can("delete", "settings");
+ const { broadcastLabel, showAssignments } = ruleReach(rule);
const handleEdit = useCallback(() => {
navigate(`${path.to.customRule(rule.id)}?${params.toString()}`);
@@ -218,8 +247,8 @@ const CustomRuleCard = memo(({ rule }: { rule: RuleListItem }) => {
) : (
<Badge variant="yellow">Warn</Badge>
)}
- {rule.appliesToAll && (
- <Badge variant="outline">Applies to all</Badge>
+ {broadcastLabel && (
+ <Badge variant="outline">{broadcastLabel}</Badge>
)}
</div>
<Status
@@ -292,7 +321,7 @@ const CustomRuleCard = memo(({ rule }: { rule: RuleListItem }) => {
targetType={rule.targetType}
/>
</div>
- {!rule.appliesToAll && (
+ {showAssignments && (
<div className="flex flex-col gap-1">
<span className="text-xs uppercase tracking-wide font-medium text-muted-foreground">
Assignments
diff --git a/apps/erp/app/modules/customRules/ui/FieldCombobox.tsx b/apps/erp/app/modules/customRules/ui/FieldCombobox.tsx
index 68392c7424..4c07258bfa 100644
--- a/apps/erp/app/modules/customRules/ui/FieldCombobox.tsx
+++ b/apps/erp/app/modules/customRules/ui/FieldCombobox.tsx
@@ -20,7 +20,8 @@ import {
FIELD_REGISTRY,
type FieldDef,
getFieldDef,
- getFieldsForTargetType
+ getFieldsForTargetTypeAndSurfaces,
+ type TransactionSurface
} from "@carbon/utils";
import { useLingui } from "@lingui/react/macro";
import { useMemo, useState } from "react";
@@ -67,6 +68,12 @@ type FieldComboboxProps = {
placeholder?: string;
className?: string;
targetType?: "item" | "storageUnit" | "workCenter";
+ /**
+ * Surfaces the rule subscribes to. Narrows the offered fields to those whose
+ * root context the evaluator populates on every selected surface, so authors
+ * can't pick a field that won't resolve at runtime.
+ */
+ surfaces?: TransactionSurface[];
};
export default function FieldCombobox({
@@ -74,7 +81,8 @@ export default function FieldCombobox({
onChange,
placeholder,
className,
- targetType
+ targetType,
+ surfaces
}: FieldComboboxProps) {
const { t } = useLingui();
const [open, setOpen] = useState(false);
@@ -83,11 +91,11 @@ export default function FieldCombobox({
const map = new Map<FieldDef["context"], FieldDef[]>();
for (const ctx of CONTEXT_ORDER) map.set(ctx, []);
const pool = targetType
- ? getFieldsForTargetType(targetType)
+ ? getFieldsForTargetTypeAndSurfaces(targetType, surfaces ?? [])
: FIELD_REGISTRY;
for (const f of pool) map.get(f.context)!.push(f);
return map;
- }, [targetType]);
+ }, [targetType, surfaces]);
const selected = useMemo(() => getFieldDef(value), [value]);
const ctx = selected ? CONTEXT[selected.context] : undefined;
diff --git a/apps/erp/app/modules/customRules/ui/ItemFilterSelector.tsx b/apps/erp/app/modules/customRules/ui/ItemFilterSelector.tsx
new file mode 100644
index 0000000000..7fa473431e
--- /dev/null
+++ b/apps/erp/app/modules/customRules/ui/ItemFilterSelector.tsx
@@ -0,0 +1,184 @@
+import { useControlField, useField } from "@carbon/form";
+import {
+ Badge,
+ ChoiceSelect,
+ type ChoiceSelectOption,
+ FormControl,
+ FormErrorMessage,
+ FormLabel,
+ ToggleGroup,
+ ToggleGroupItem
+} from "@carbon/react";
+import { Trans, useLingui } from "@lingui/react/macro";
+import { AnimatePresence, motion } from "framer-motion";
+import { LuBox, LuDroplet, LuFilter, LuLayers, LuWrench } from "react-icons/lu";
+import { MultiSelect } from "~/components/Form";
+import { useItemPostingGroups } from "~/components/Form/ItemPostingGroup";
+import { itemTypes } from "~/modules/inventory/inventory.models";
+
+const ITEM_TYPE_ICON: Record<(typeof itemTypes)[number], JSX.Element> = {
+ Part: <LuBox />,
+ Material: <LuLayers />,
+ Tool: <LuWrench />,
+ Consumable: <LuDroplet />
+};
+
+const ITEM_TYPE_OPTIONS: ChoiceSelectOption<string>[] = itemTypes.map((t) => ({
+ value: t,
+ title: t,
+ icon: ITEM_TYPE_ICON[t]
+}));
+
+function ItemTypesField() {
+ const { t } = useLingui();
+ const name = "filteredItemTypes";
+ const { error } = useField(name);
+ const [value, setValue] = useControlField<string[]>(name);
+ const selected = value ?? [];
+
+ return (
+ <FormControl isInvalid={!!error}>
+ <FormLabel htmlFor={name}>
+ <Trans>Item types</Trans>
+ </FormLabel>
+
+ {selected.map((v, index) => (
+ <input key={v} type="hidden" name={`${name}[${index}]`} value={v} />
+ ))}
+
+ <ChoiceSelect<string>
+ multiple
+ value={selected}
+ onChange={(next) => setValue(next)}
+ options={ITEM_TYPE_OPTIONS}
+ placeholder={t`Any item type`}
+ aria-label={t`Item types`}
+ />
+
+ {error && <FormErrorMessage>{error}</FormErrorMessage>}
+ </FormControl>
+ );
+}
+
+// Two-segment AND/OR switch. Submits checkbox-style: a hidden input is present
+// only for AND (true), matching `zfd.checkbox()` server-side.
+function MatchModeToggle() {
+ const { t } = useLingui();
+ const [value, setValue] = useControlField<boolean>("filteredItemMatchAll");
+ const matchAll = value ?? false;
+
+ return (
+ <div className="flex items-center justify-between gap-3">
+ <div className="flex flex-col">
+ <span className="text-sm font-medium text-foreground">
+ <Trans>Combine filters</Trans>
+ </span>
+ <span className="text-pretty text-xs text-muted-foreground">
+ {matchAll ? (
+ <Trans>Item must match a selected type AND a selected group</Trans>
+ ) : (
+ <Trans>Item must match a selected type OR a selected group</Trans>
+ )}
+ </span>
+ </div>
+
+ {matchAll ? (
+ <input type="hidden" name="filteredItemMatchAll" value="on" />
+ ) : null}
+
+ <ToggleGroup
+ type="single"
+ variant="outline"
+ size="sm"
+ value={matchAll ? "all" : "any"}
+ // Radix single-toggle can fire "" when clicking the active item; ignore
+ // that so the operator can never become unset.
+ onValueChange={(next) => {
+ if (next) setValue(next === "all");
+ }}
+ >
+ <ToggleGroupItem
+ value="any"
+ aria-label={t`Match any (OR)`}
+ className="transition-[transform,color,box-shadow] active:scale-[0.96]"
+ >
+ <Trans>OR</Trans>
+ </ToggleGroupItem>
+ <ToggleGroupItem
+ value="all"
+ aria-label={t`Match all (AND)`}
+ className="transition-[transform,color,box-shadow] active:scale-[0.96]"
+ >
+ <Trans>AND</Trans>
+ </ToggleGroupItem>
+ </ToggleGroup>
+ </div>
+ );
+}
+
+function useFilterCounts() {
+ const [types] = useControlField<string[]>("filteredItemTypes");
+ const [groups] = useControlField<string[]>("filteredItemGroupIds");
+ return {
+ types: types?.length ?? 0,
+ groups: groups?.length ?? 0,
+ total: (types?.length ?? 0) + (groups?.length ?? 0)
+ };
+}
+
+export default function ItemFilterSelector() {
+ const { t } = useLingui();
+ const groupOptions = useItemPostingGroups() as {
+ value: string;
+ label: string;
+ }[];
+ const counts = useFilterCounts();
+ const filterCount = counts.total;
+ // OR vs AND only matters when both dimensions constrain the set.
+ const showMatchMode = counts.types > 0 && counts.groups > 0;
+
+ return (
+ <div className="w-full rounded-lg border border-border bg-card/40 p-4">
+ <div className="mb-3 flex items-center justify-between gap-2">
+ <div className="flex items-center gap-2 text-sm font-semibold text-foreground">
+ <LuFilter className="h-3.5 w-3.5 text-muted-foreground" />
+ <Trans>Item filters</Trans>
+ {filterCount > 0 ? (
+ <Badge variant="secondary" className="ml-1 tabular-nums">
+ {filterCount}
+ </Badge>
+ ) : null}
+ </div>
+ <span className="text-xs text-muted-foreground">
+ <Trans>Empty = match every item</Trans>
+ </span>
+ </div>
+
+ <div className="grid grid-cols-1 gap-4 sm:grid-cols-2">
+ <ItemTypesField />
+
+ <MultiSelect
+ name="filteredItemGroupIds"
+ label={t`Item groups`}
+ options={groupOptions}
+ placeholder={t`Any item group`}
+ />
+ </div>
+
+ <AnimatePresence initial={false}>
+ {showMatchMode && (
+ <motion.div
+ key="match-mode"
+ initial={{ opacity: 0, y: -4 }}
+ animate={{ opacity: 1, y: 0 }}
+ exit={{ opacity: 0, y: -4 }}
+ transition={{ type: "spring", duration: 0.3, bounce: 0 }}
+ className="mt-3 border-t border-border pt-3"
+ >
+ <MatchModeToggle />
+ </motion.div>
+ )}
+ </AnimatePresence>
+ </div>
+ );
+}
diff --git a/apps/erp/app/modules/customRules/ui/RuleBuilder.tsx b/apps/erp/app/modules/customRules/ui/RuleBuilder.tsx
index d67e6723d1..2cc72a55ad 100644
--- a/apps/erp/app/modules/customRules/ui/RuleBuilder.tsx
+++ b/apps/erp/app/modules/customRules/ui/RuleBuilder.tsx
@@ -9,7 +9,7 @@ import {
type Condition,
type ConditionAst,
FIELD_REGISTRY,
- getFieldsForTargetType,
+ getFieldsForTargetTypeAndSurfaces,
type MatchKind,
type TargetType,
type TransactionSurface
@@ -39,8 +39,13 @@ type RuleBuilderProps = {
onConditionsChange?: (conditions: Condition[]) => void;
};
-const emptyConditionFor = (targetType: TargetType | undefined): Condition => {
- const pool = targetType ? getFieldsForTargetType(targetType) : FIELD_REGISTRY;
+const emptyConditionFor = (
+ targetType: TargetType | undefined,
+ surfaces: TransactionSurface[] | undefined
+): Condition => {
+ const pool = targetType
+ ? getFieldsForTargetTypeAndSurfaces(targetType, surfaces ?? [])
+ : FIELD_REGISTRY;
return { field: pool[0]?.path ?? "", op: "eq", value: undefined };
};
@@ -80,7 +85,7 @@ export default function RuleBuilder({
const [conditions, setConditions] = useState<Condition[]>(
initial?.conditions?.length
? initial.conditions
- : [emptyConditionFor(targetType)]
+ : [emptyConditionFor(targetType, surfaces)]
);
const optionsByLoader = useValueOptions();
@@ -107,8 +112,8 @@ export default function RuleBuilder({
}, []);
const handleAdd = useCallback(() => {
- setConditions((prev) => [...prev, emptyConditionFor(targetType)]);
- }, [targetType]);
+ setConditions((prev) => [...prev, emptyConditionFor(targetType, surfaces)]);
+ }, [targetType, surfaces]);
const ast: ConditionAst = { kind, conditions };
diff --git a/apps/erp/app/modules/customRules/ui/ValueInput.tsx b/apps/erp/app/modules/customRules/ui/ValueInput.tsx
index c03075351e..b953bb5e7f 100644
--- a/apps/erp/app/modules/customRules/ui/ValueInput.tsx
+++ b/apps/erp/app/modules/customRules/ui/ValueInput.tsx
@@ -232,18 +232,19 @@ function StorageUnitValuePickerImpl({
const byId = useMemo(() => {
const m = new Map<string, StorageUnitTreeRow>();
- tree.forEach((r) => m.set(r.id, r));
+ for (const r of tree) m.set(r.id, r);
return m;
}, [tree]);
const childrenOf = useMemo(() => {
const m = new Map<string | null, StorageUnitTreeRow[]>();
- tree.forEach((r) => {
+ for (const r of tree) {
const arr = m.get(r.parentId) ?? [];
arr.push(r);
m.set(r.parentId, arr);
- });
- m.forEach((arr) => arr.sort((a, b) => a.name.localeCompare(b.name)));
+ }
+ for (const arr of m.values())
+ arr.sort((a, b) => a.name.localeCompare(b.name));
return m;
}, [tree]);
@@ -379,7 +380,7 @@ function StorageUnitValuePickerImpl({
collisionPadding={12}
className="w-auto min-w-[200px] max-w-[320px] p-1"
>
- <ul role="list" className="max-h-[200px] overflow-y-auto">
+ <ul className="max-h-[200px] overflow-y-auto">
{locations.length === 0 && (
<li className="px-2 py-1.5 text-xs text-muted-foreground">
Loading…
@@ -444,7 +445,7 @@ function StorageUnitValuePickerImpl({
/>
{/* List */}
- <ul role="list" className="max-h-[260px] overflow-y-auto py-1">
+ <ul className="max-h-[260px] overflow-y-auto py-1">
{searchResults ? (
searchResults.length === 0 ? (
<li className="px-3 py-6 text-center text-xs text-muted-foreground">
diff --git a/apps/mes/app/components/JobOperation/components/MaintenanceDispatch.tsx b/apps/mes/app/components/JobOperation/components/MaintenanceDispatch.tsx
index 62efe6bb8b..48853bdc0a 100644
--- a/apps/mes/app/components/JobOperation/components/MaintenanceDispatch.tsx
+++ b/apps/mes/app/components/JobOperation/components/MaintenanceDispatch.tsx
@@ -105,8 +105,7 @@ export function MaintenanceDispatch({
if (isOpen) {
failureModeFetcher.load(path.to.api.failureModes);
}
- // biome-ignore lint/correctness/useExhaustiveDependencies: ignore
- }, [isOpen]);
+ }, [isOpen, failureModeFetcher.load]);
const handleClose = () => {
setContent({});
@@ -121,7 +120,7 @@ export function MaintenanceDispatch({
handleClose();
}
// biome-ignore lint/correctness/useExhaustiveDependencies: ignore
- }, [fetcher.state, fetcher.data]);
+ }, [fetcher.state, fetcher.data, handleClose]);
const onUploadImage = async (file: File) => {
const fileType = file.name.split(".").pop();
diff --git a/apps/mes/app/components/JobOperation/components/QualityIssueModal.tsx b/apps/mes/app/components/JobOperation/components/QualityIssueModal.tsx
index 04d81fedb2..785ee0a450 100644
--- a/apps/mes/app/components/JobOperation/components/QualityIssueModal.tsx
+++ b/apps/mes/app/components/JobOperation/components/QualityIssueModal.tsx
@@ -41,16 +41,14 @@ export function QualityIssueModal({
if (isOpen) {
issueTypeFetcher.load(path.to.api.qualityIssueTypes);
}
- // biome-ignore lint/correctness/useExhaustiveDependencies: ignore
- }, [isOpen]);
+ }, [isOpen, issueTypeFetcher.load]);
useEffect(() => {
if (fetcher.state === "idle" && fetcher.data?.success) {
toast.success(t`Quality issue created`);
onClose();
}
- // biome-ignore lint/correctness/useExhaustiveDependencies: ignore
- }, [fetcher.state, fetcher.data]);
+ }, [fetcher.state, fetcher.data, onClose, t]);
if (!isOpen) return null;
diff --git a/packages/database/src/types.ts b/packages/database/src/types.ts
index e69de29bb2..fc4823c4b6 100644
--- a/packages/database/src/types.ts
+++ b/packages/database/src/types.ts
@@ -0,0 +1,67252 @@
+export type Json =
+ | string
+ | number
+ | boolean
+ | null
+ | { [key: string]: Json | undefined }
+ | Json[]
+
+export type Database = {
+ graphql_public: {
+ Tables: {
+ [_ in never]: never
+ }
+ Views: {
+ [_ in never]: never
+ }
+ Functions: {
+ graphql: {
+ Args: {
+ extensions?: Json
+ operationName?: string
+ query?: string
+ variables?: Json
+ }
+ Returns: Json
+ }
+ }
+ Enums: {
+ [_ in never]: never
+ }
+ CompositeTypes: {
+ [_ in never]: never
+ }
+ }
+ public: {
+ Tables: {
+ ability: {
+ Row: {
+ active: boolean
+ companyId: string
+ createdAt: string
+ createdBy: string
+ curve: Json
+ id: string
+ name: string
+ shadowWeeks: number
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ active?: boolean
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ curve?: Json
+ id?: string
+ name: string
+ shadowWeeks?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ active?: boolean
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ curve?: Json
+ id?: string
+ name?: string
+ shadowWeeks?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "abilities_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "abilities_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "abilities_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "abilities_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "abilities_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "abilities_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "abilities_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "abilities_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "abilities_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "abilities_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "abilities_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "abilities_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "abilities_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "abilities_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ account: {
+ Row: {
+ accountType: Database["public"]["Enums"]["accountType"] | null
+ active: boolean
+ class: Database["public"]["Enums"]["glAccountClass"] | null
+ companyGroupId: string
+ consolidatedRate: Database["public"]["Enums"]["glConsolidatedRate"]
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ id: string
+ incomeBalance: Database["public"]["Enums"]["glIncomeBalance"]
+ isGroup: boolean
+ isSystem: boolean
+ name: string
+ number: string | null
+ parentId: string | null
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ accountType?: Database["public"]["Enums"]["accountType"] | null
+ active?: boolean
+ class?: Database["public"]["Enums"]["glAccountClass"] | null
+ companyGroupId: string
+ consolidatedRate?: Database["public"]["Enums"]["glConsolidatedRate"]
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ id?: string
+ incomeBalance: Database["public"]["Enums"]["glIncomeBalance"]
+ isGroup?: boolean
+ isSystem?: boolean
+ name: string
+ number?: string | null
+ parentId?: string | null
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ accountType?: Database["public"]["Enums"]["accountType"] | null
+ active?: boolean
+ class?: Database["public"]["Enums"]["glAccountClass"] | null
+ companyGroupId?: string
+ consolidatedRate?: Database["public"]["Enums"]["glConsolidatedRate"]
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ id?: string
+ incomeBalance?: Database["public"]["Enums"]["glIncomeBalance"]
+ isGroup?: boolean
+ isSystem?: boolean
+ name?: string
+ number?: string | null
+ parentId?: string | null
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "account_companyGroupId_fkey"
+ columns: ["companyGroupId"]
+ isOneToOne: false
+ referencedRelation: "companyGroup"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "account_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "account_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "account_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "account_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "account_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "account_parentId_fkey"
+ columns: ["parentId"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "account_parentId_fkey"
+ columns: ["parentId"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "account_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "account_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "account_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "account_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "account_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ accountDefault: {
+ Row: {
+ accumulatedDepreciationAccount: string
+ accumulatedDepreciationOnDisposalAccount: string
+ assetAquisitionCostAccount: string
+ assetAquisitionCostOnDisposalAccount: string
+ assetDepreciationExpenseAccount: string
+ assetGainsAndLossesAccount: string
+ bankCashAccount: string
+ bankForeignCurrencyAccount: string
+ bankLocalCurrencyAccount: string
+ companyId: string
+ costOfGoodsSoldAccount: string
+ currencyTranslationAccount: string
+ customerPaymentDiscountAccount: string
+ deferredTaxExpenseAccountId: string | null
+ deferredTaxLiabilityAccountId: string | null
+ goodsReceivedNotInvoicedAccount: string
+ indirectCostAccount: string
+ interestAccount: string
+ inventoryAccount: string
+ inventoryAdjustmentVarianceAccount: string
+ inventoryShippedNotInvoicedAccount: string
+ laborAbsorptionAccount: string | null
+ laborAndMachineVarianceAccount: string
+ lotSizeVarianceAccount: string
+ maintenanceAccount: string
+ materialVarianceAccount: string
+ overheadVarianceAccount: string
+ payablesAccount: string
+ prepaymentAccount: string
+ purchaseTaxPayableAccount: string
+ purchaseVarianceAccount: string
+ receivablesAccount: string
+ retainedEarningsAccount: string
+ reverseChargeSalesTaxPayableAccount: string
+ roundingAccount: string
+ salesAccount: string
+ salesDiscountAccount: string
+ salesTaxPayableAccount: string
+ serviceChargeAccount: string
+ subcontractingVarianceAccount: string
+ supplierPaymentDiscountAccount: string
+ updatedBy: string | null
+ workInProgressAccount: string
+ }
+ Insert: {
+ accumulatedDepreciationAccount: string
+ accumulatedDepreciationOnDisposalAccount: string
+ assetAquisitionCostAccount: string
+ assetAquisitionCostOnDisposalAccount: string
+ assetDepreciationExpenseAccount: string
+ assetGainsAndLossesAccount: string
+ bankCashAccount: string
+ bankForeignCurrencyAccount: string
+ bankLocalCurrencyAccount: string
+ companyId: string
+ costOfGoodsSoldAccount: string
+ currencyTranslationAccount: string
+ customerPaymentDiscountAccount: string
+ deferredTaxExpenseAccountId?: string | null
+ deferredTaxLiabilityAccountId?: string | null
+ goodsReceivedNotInvoicedAccount: string
+ indirectCostAccount: string
+ interestAccount: string
+ inventoryAccount: string
+ inventoryAdjustmentVarianceAccount: string
+ inventoryShippedNotInvoicedAccount: string
+ laborAbsorptionAccount?: string | null
+ laborAndMachineVarianceAccount: string
+ lotSizeVarianceAccount: string
+ maintenanceAccount: string
+ materialVarianceAccount: string
+ overheadVarianceAccount: string
+ payablesAccount: string
+ prepaymentAccount: string
+ purchaseTaxPayableAccount: string
+ purchaseVarianceAccount: string
+ receivablesAccount: string
+ retainedEarningsAccount: string
+ reverseChargeSalesTaxPayableAccount: string
+ roundingAccount: string
+ salesAccount: string
+ salesDiscountAccount: string
+ salesTaxPayableAccount: string
+ serviceChargeAccount: string
+ subcontractingVarianceAccount: string
+ supplierPaymentDiscountAccount: string
+ updatedBy?: string | null
+ workInProgressAccount: string
+ }
+ Update: {
+ accumulatedDepreciationAccount?: string
+ accumulatedDepreciationOnDisposalAccount?: string
+ assetAquisitionCostAccount?: string
+ assetAquisitionCostOnDisposalAccount?: string
+ assetDepreciationExpenseAccount?: string
+ assetGainsAndLossesAccount?: string
+ bankCashAccount?: string
+ bankForeignCurrencyAccount?: string
+ bankLocalCurrencyAccount?: string
+ companyId?: string
+ costOfGoodsSoldAccount?: string
+ currencyTranslationAccount?: string
+ customerPaymentDiscountAccount?: string
+ deferredTaxExpenseAccountId?: string | null
+ deferredTaxLiabilityAccountId?: string | null
+ goodsReceivedNotInvoicedAccount?: string
+ indirectCostAccount?: string
+ interestAccount?: string
+ inventoryAccount?: string
+ inventoryAdjustmentVarianceAccount?: string
+ inventoryShippedNotInvoicedAccount?: string
+ laborAbsorptionAccount?: string | null
+ laborAndMachineVarianceAccount?: string
+ lotSizeVarianceAccount?: string
+ maintenanceAccount?: string
+ materialVarianceAccount?: string
+ overheadVarianceAccount?: string
+ payablesAccount?: string
+ prepaymentAccount?: string
+ purchaseTaxPayableAccount?: string
+ purchaseVarianceAccount?: string
+ receivablesAccount?: string
+ retainedEarningsAccount?: string
+ reverseChargeSalesTaxPayableAccount?: string
+ roundingAccount?: string
+ salesAccount?: string
+ salesDiscountAccount?: string
+ salesTaxPayableAccount?: string
+ serviceChargeAccount?: string
+ subcontractingVarianceAccount?: string
+ supplierPaymentDiscountAccount?: string
+ updatedBy?: string | null
+ workInProgressAccount?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "accountDefault_accumulatedDepreciationAccount_fkey"
+ columns: ["accumulatedDepreciationAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_accumulatedDepreciationAccount_fkey"
+ columns: ["accumulatedDepreciationAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_accumulatedDepreciationOnDisposalAccount_fkey"
+ columns: ["accumulatedDepreciationOnDisposalAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_accumulatedDepreciationOnDisposalAccount_fkey"
+ columns: ["accumulatedDepreciationOnDisposalAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_aquisitionCostAccount_fkey"
+ columns: ["assetAquisitionCostAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_aquisitionCostAccount_fkey"
+ columns: ["assetAquisitionCostAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_aquisitionCostOnDisposalAccount_fkey"
+ columns: ["assetAquisitionCostOnDisposalAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_aquisitionCostOnDisposalAccount_fkey"
+ columns: ["assetAquisitionCostOnDisposalAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_assetDepreciationExpenseAccount_fkey"
+ columns: ["assetDepreciationExpenseAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_assetDepreciationExpenseAccount_fkey"
+ columns: ["assetDepreciationExpenseAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_assetGainsAndLossesAccount_fkey"
+ columns: ["assetGainsAndLossesAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_assetGainsAndLossesAccount_fkey"
+ columns: ["assetGainsAndLossesAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_bankCashAccount_fkey"
+ columns: ["bankCashAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_bankCashAccount_fkey"
+ columns: ["bankCashAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_bankForeignCurrencyAccount_fkey"
+ columns: ["bankForeignCurrencyAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_bankForeignCurrencyAccount_fkey"
+ columns: ["bankForeignCurrencyAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_bankLocalCurrencyAccount_fkey"
+ columns: ["bankLocalCurrencyAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_bankLocalCurrencyAccount_fkey"
+ columns: ["bankLocalCurrencyAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_costOfGoodsSoldAccount_fkey"
+ columns: ["costOfGoodsSoldAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_costOfGoodsSoldAccount_fkey"
+ columns: ["costOfGoodsSoldAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_currencyTranslationAccount_fkey"
+ columns: ["currencyTranslationAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_currencyTranslationAccount_fkey"
+ columns: ["currencyTranslationAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_customerPaymentDiscountAccount_fkey"
+ columns: ["customerPaymentDiscountAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_customerPaymentDiscountAccount_fkey"
+ columns: ["customerPaymentDiscountAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_deferredTaxExpenseAccountId_fkey"
+ columns: ["deferredTaxExpenseAccountId"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_deferredTaxExpenseAccountId_fkey"
+ columns: ["deferredTaxExpenseAccountId"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_deferredTaxLiabilityAccountId_fkey"
+ columns: ["deferredTaxLiabilityAccountId"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_deferredTaxLiabilityAccountId_fkey"
+ columns: ["deferredTaxLiabilityAccountId"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_fkey"
+ columns: ["companyId"]
+ isOneToOne: true
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_fkey"
+ columns: ["companyId"]
+ isOneToOne: true
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_fkey"
+ columns: ["companyId"]
+ isOneToOne: true
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "accountDefault_fkey"
+ columns: ["companyId"]
+ isOneToOne: true
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "accountDefault_goodsReceivedNotInvoicedAccount_fkey"
+ columns: ["goodsReceivedNotInvoicedAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_goodsReceivedNotInvoicedAccount_fkey"
+ columns: ["goodsReceivedNotInvoicedAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_indirectCostAccount_fkey"
+ columns: ["indirectCostAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_indirectCostAccount_fkey"
+ columns: ["indirectCostAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_interestAccount_fkey"
+ columns: ["interestAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_interestAccount_fkey"
+ columns: ["interestAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_inventoryAccount_fkey"
+ columns: ["inventoryAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_inventoryAccount_fkey"
+ columns: ["inventoryAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_inventoryAdjustmentVarianceAccount_fkey"
+ columns: ["inventoryAdjustmentVarianceAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_inventoryAdjustmentVarianceAccount_fkey"
+ columns: ["inventoryAdjustmentVarianceAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_inventoryShippedNotInvoicedAccount_fkey"
+ columns: ["inventoryShippedNotInvoicedAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_inventoryShippedNotInvoicedAccount_fkey"
+ columns: ["inventoryShippedNotInvoicedAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_laborAbsorptionAccount_fkey"
+ columns: ["laborAbsorptionAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_laborAbsorptionAccount_fkey"
+ columns: ["laborAbsorptionAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_laborAndMachineVarianceAccount_fkey"
+ columns: ["laborAndMachineVarianceAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_laborAndMachineVarianceAccount_fkey"
+ columns: ["laborAndMachineVarianceAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_lotSizeVarianceAccount_fkey"
+ columns: ["lotSizeVarianceAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_lotSizeVarianceAccount_fkey"
+ columns: ["lotSizeVarianceAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_maintenanceAccount_fkey"
+ columns: ["maintenanceAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_maintenanceAccount_fkey"
+ columns: ["maintenanceAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_materialVarianceAccount_fkey"
+ columns: ["materialVarianceAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_materialVarianceAccount_fkey"
+ columns: ["materialVarianceAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_overheadVarianceAccount_fkey"
+ columns: ["overheadVarianceAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_overheadVarianceAccount_fkey"
+ columns: ["overheadVarianceAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_payablesAccount_fkey"
+ columns: ["payablesAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_payablesAccount_fkey"
+ columns: ["payablesAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_prepaymentAccount_fkey"
+ columns: ["prepaymentAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_prepaymentAccount_fkey"
+ columns: ["prepaymentAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_purchaseTaxPayableAccount_fkey"
+ columns: ["purchaseTaxPayableAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_purchaseTaxPayableAccount_fkey"
+ columns: ["purchaseTaxPayableAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_purchaseVarianceAccount_fkey"
+ columns: ["purchaseVarianceAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_purchaseVarianceAccount_fkey"
+ columns: ["purchaseVarianceAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_receivablesAccount_fkey"
+ columns: ["receivablesAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_receivablesAccount_fkey"
+ columns: ["receivablesAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_retainedEarningsAccount_fkey"
+ columns: ["retainedEarningsAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_retainedEarningsAccount_fkey"
+ columns: ["retainedEarningsAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_reverseChargeSalesTaxPayableAccount_fkey"
+ columns: ["reverseChargeSalesTaxPayableAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_reverseChargeSalesTaxPayableAccount_fkey"
+ columns: ["reverseChargeSalesTaxPayableAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_roundingAccount_fkey"
+ columns: ["roundingAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_roundingAccount_fkey"
+ columns: ["roundingAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_salesAccount_fkey"
+ columns: ["salesAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_salesAccount_fkey"
+ columns: ["salesAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_salesDiscountAccount_fkey"
+ columns: ["salesDiscountAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_salesDiscountAccount_fkey"
+ columns: ["salesDiscountAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_salesTaxPayableAccount_fkey"
+ columns: ["salesTaxPayableAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_salesTaxPayableAccount_fkey"
+ columns: ["salesTaxPayableAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_serviceChargeAccount_fkey"
+ columns: ["serviceChargeAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_serviceChargeAccount_fkey"
+ columns: ["serviceChargeAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_subcontractingVarianceAccount_fkey"
+ columns: ["subcontractingVarianceAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_subcontractingVarianceAccount_fkey"
+ columns: ["subcontractingVarianceAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_supplierPaymentDiscountAccount_fkey"
+ columns: ["supplierPaymentDiscountAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_supplierPaymentDiscountAccount_fkey"
+ columns: ["supplierPaymentDiscountAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "accountDefault_workInProgressAccount_fkey"
+ columns: ["workInProgressAccount"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_workInProgressAccount_fkey"
+ columns: ["workInProgressAccount"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ accountingPeriod: {
+ Row: {
+ closedAt: string | null
+ closedBy: string | null
+ companyId: string
+ createdAt: string
+ createdBy: string
+ endDate: string
+ id: string
+ startDate: string
+ status: Database["public"]["Enums"]["accountingPeriodStatus"]
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ closedAt?: string | null
+ closedBy?: string | null
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ endDate: string
+ id?: string
+ startDate: string
+ status?: Database["public"]["Enums"]["accountingPeriodStatus"]
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ closedAt?: string | null
+ closedBy?: string | null
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ endDate?: string
+ id?: string
+ startDate?: string
+ status?: Database["public"]["Enums"]["accountingPeriodStatus"]
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "accountingPeriod_closedBy_fkey"
+ columns: ["closedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountingPeriod_closedBy_fkey"
+ columns: ["closedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountingPeriod_closedBy_fkey"
+ columns: ["closedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountingPeriod_closedBy_fkey"
+ columns: ["closedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountingPeriod_closedBy_fkey"
+ columns: ["closedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "accountingPeriod_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountingPeriod_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountingPeriod_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountingPeriod_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountingPeriod_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "accountingPeriod_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountingPeriod_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountingPeriod_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "accountingPeriod_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "accountingPeriod_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountingPeriod_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountingPeriod_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountingPeriod_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountingPeriod_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ address: {
+ Row: {
+ addressLine1: string | null
+ addressLine2: string | null
+ city: string | null
+ companyId: string
+ countryCode: string | null
+ fax: string | null
+ id: string
+ phone: string | null
+ postalCode: string | null
+ stateProvince: string | null
+ }
+ Insert: {
+ addressLine1?: string | null
+ addressLine2?: string | null
+ city?: string | null
+ companyId: string
+ countryCode?: string | null
+ fax?: string | null
+ id?: string
+ phone?: string | null
+ postalCode?: string | null
+ stateProvince?: string | null
+ }
+ Update: {
+ addressLine1?: string | null
+ addressLine2?: string | null
+ city?: string | null
+ companyId?: string
+ countryCode?: string | null
+ fax?: string | null
+ id?: string
+ phone?: string | null
+ postalCode?: string | null
+ stateProvince?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "address_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "address_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "address_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "address_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "address_countryCode_fkey"
+ columns: ["countryCode"]
+ isOneToOne: false
+ referencedRelation: "country"
+ referencedColumns: ["alpha2"]
+ },
+ ]
+ }
+ apiKey: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ expiresAt: string | null
+ id: string
+ keyHash: string
+ keyPreview: string | null
+ lastUsedAt: string | null
+ name: string
+ rateLimit: number
+ rateLimitWindow: string
+ scopes: Json
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ expiresAt?: string | null
+ id?: string
+ keyHash: string
+ keyPreview?: string | null
+ lastUsedAt?: string | null
+ name: string
+ rateLimit?: number
+ rateLimitWindow?: string
+ scopes?: Json
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ expiresAt?: string | null
+ id?: string
+ keyHash?: string
+ keyPreview?: string | null
+ lastUsedAt?: string | null
+ name?: string
+ rateLimit?: number
+ rateLimitWindow?: string
+ scopes?: Json
+ }
+ Relationships: [
+ {
+ foreignKeyName: "apiKey_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "apiKey_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "apiKey_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "apiKey_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "apiKey_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "apiKey_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "apiKey_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "apiKey_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "apiKey_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ apiKeyRateLimit: {
+ Row: {
+ apiKeyId: string
+ requestCount: number
+ windowStart: string
+ }
+ Insert: {
+ apiKeyId: string
+ requestCount?: number
+ windowStart: string
+ }
+ Update: {
+ apiKeyId?: string
+ requestCount?: number
+ windowStart?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "apiKeyRateLimit_apiKeyId_fkey"
+ columns: ["apiKeyId"]
+ isOneToOne: false
+ referencedRelation: "apiKey"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ approvalRequest: {
+ Row: {
+ amount: number | null
+ companyId: string
+ createdAt: string
+ createdBy: string
+ decisionAt: string | null
+ decisionBy: string | null
+ decisionNotes: string | null
+ documentId: string
+ documentType: Database["public"]["Enums"]["approvalDocumentType"]
+ id: string
+ requestedAt: string
+ requestedBy: string
+ status: Database["public"]["Enums"]["approvalStatus"]
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ amount?: number | null
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ decisionAt?: string | null
+ decisionBy?: string | null
+ decisionNotes?: string | null
+ documentId: string
+ documentType: Database["public"]["Enums"]["approvalDocumentType"]
+ id?: string
+ requestedAt?: string
+ requestedBy: string
+ status?: Database["public"]["Enums"]["approvalStatus"]
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ amount?: number | null
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ decisionAt?: string | null
+ decisionBy?: string | null
+ decisionNotes?: string | null
+ documentId?: string
+ documentType?: Database["public"]["Enums"]["approvalDocumentType"]
+ id?: string
+ requestedAt?: string
+ requestedBy?: string
+ status?: Database["public"]["Enums"]["approvalStatus"]
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "approvalRequest_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRequest_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRequest_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "approvalRequest_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "approvalRequest_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRequest_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRequest_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRequest_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRequest_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "approvalRequest_decisionBy_fkey"
+ columns: ["decisionBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRequest_decisionBy_fkey"
+ columns: ["decisionBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRequest_decisionBy_fkey"
+ columns: ["decisionBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRequest_decisionBy_fkey"
+ columns: ["decisionBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRequest_decisionBy_fkey"
+ columns: ["decisionBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "approvalRequest_requestedBy_fkey"
+ columns: ["requestedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRequest_requestedBy_fkey"
+ columns: ["requestedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRequest_requestedBy_fkey"
+ columns: ["requestedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRequest_requestedBy_fkey"
+ columns: ["requestedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRequest_requestedBy_fkey"
+ columns: ["requestedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "approvalRequest_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRequest_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRequest_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRequest_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRequest_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ approvalRule: {
+ Row: {
+ approverGroupIds: string[] | null
+ companyId: string
+ createdAt: string
+ createdBy: string
+ defaultApproverId: string | null
+ documentType: Database["public"]["Enums"]["approvalDocumentType"]
+ enabled: boolean
+ escalationDays: number | null
+ id: string
+ lowerBoundAmount: number
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ approverGroupIds?: string[] | null
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ defaultApproverId?: string | null
+ documentType: Database["public"]["Enums"]["approvalDocumentType"]
+ enabled?: boolean
+ escalationDays?: number | null
+ id?: string
+ lowerBoundAmount?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ approverGroupIds?: string[] | null
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ defaultApproverId?: string | null
+ documentType?: Database["public"]["Enums"]["approvalDocumentType"]
+ enabled?: boolean
+ escalationDays?: number | null
+ id?: string
+ lowerBoundAmount?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "approvalRule_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRule_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRule_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "approvalRule_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "approvalRule_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRule_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRule_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRule_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRule_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "approvalRule_defaultApproverId_fkey"
+ columns: ["defaultApproverId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRule_defaultApproverId_fkey"
+ columns: ["defaultApproverId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRule_defaultApproverId_fkey"
+ columns: ["defaultApproverId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRule_defaultApproverId_fkey"
+ columns: ["defaultApproverId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRule_defaultApproverId_fkey"
+ columns: ["defaultApproverId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "approvalRule_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRule_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRule_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRule_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRule_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ attributeDataType: {
+ Row: {
+ id: number
+ isBoolean: boolean
+ isCustomer: boolean
+ isDate: boolean
+ isFile: boolean
+ isList: boolean
+ isNumeric: boolean
+ isSupplier: boolean
+ isText: boolean
+ isUser: boolean
+ label: string
+ }
+ Insert: {
+ id?: number
+ isBoolean?: boolean
+ isCustomer?: boolean
+ isDate?: boolean
+ isFile?: boolean
+ isList?: boolean
+ isNumeric?: boolean
+ isSupplier?: boolean
+ isText?: boolean
+ isUser?: boolean
+ label: string
+ }
+ Update: {
+ id?: number
+ isBoolean?: boolean
+ isCustomer?: boolean
+ isDate?: boolean
+ isFile?: boolean
+ isList?: boolean
+ isNumeric?: boolean
+ isSupplier?: boolean
+ isText?: boolean
+ isUser?: boolean
+ label?: string
+ }
+ Relationships: []
+ }
+ auditLogArchive: {
+ Row: {
+ archivePath: string
+ companyId: string
+ createdAt: string
+ endDate: string
+ id: string
+ rowCount: number
+ sizeBytes: number | null
+ startDate: string
+ }
+ Insert: {
+ archivePath: string
+ companyId: string
+ createdAt?: string
+ endDate: string
+ id?: string
+ rowCount: number
+ sizeBytes?: number | null
+ startDate: string
+ }
+ Update: {
+ archivePath?: string
+ companyId?: string
+ createdAt?: string
+ endDate?: string
+ id?: string
+ rowCount?: number
+ sizeBytes?: number | null
+ startDate?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "auditLogArchive_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "auditLogArchive_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "auditLogArchive_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "auditLogArchive_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ ]
+ }
+ balloon: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ inspectionDocumentId: string
+ inspectionFeatureId: string
+ pageNumber: number
+ regionHeight: number
+ regionWidth: number
+ regionX: number
+ regionY: number
+ updatedAt: string | null
+ updatedBy: string | null
+ xCoordinate: number
+ yCoordinate: number
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ inspectionDocumentId: string
+ inspectionFeatureId: string
+ pageNumber: number
+ regionHeight: number
+ regionWidth: number
+ regionX: number
+ regionY: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ xCoordinate: number
+ yCoordinate: number
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ inspectionDocumentId?: string
+ inspectionFeatureId?: string
+ pageNumber?: number
+ regionHeight?: number
+ regionWidth?: number
+ regionX?: number
+ regionY?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ xCoordinate?: number
+ yCoordinate?: number
+ }
+ Relationships: [
+ {
+ foreignKeyName: "balloon_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "balloon_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "balloon_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "balloon_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "balloon_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "balloon_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "balloon_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "balloon_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "balloon_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "balloon_document_company_fkey"
+ columns: ["inspectionDocumentId", "companyId"]
+ isOneToOne: false
+ referencedRelation: "inspectionDocument"
+ referencedColumns: ["id", "companyId"]
+ },
+ {
+ foreignKeyName: "balloon_document_company_fkey"
+ columns: ["inspectionDocumentId", "companyId"]
+ isOneToOne: false
+ referencedRelation: "inspectionDocuments"
+ referencedColumns: ["id", "companyId"]
+ },
+ {
+ foreignKeyName: "balloon_inspectionFeatureId_fkey"
+ columns: ["inspectionFeatureId", "companyId"]
+ isOneToOne: false
+ referencedRelation: "inspectionFeature"
+ referencedColumns: ["id", "companyId"]
+ },
+ {
+ foreignKeyName: "balloon_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "balloon_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "balloon_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "balloon_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "balloon_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ batchProperty: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ dataType: Database["public"]["Enums"]["configurationParameterDataType"]
+ id: string
+ itemId: string
+ label: string
+ listOptions: string[] | null
+ sortOrder: number
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ dataType: Database["public"]["Enums"]["configurationParameterDataType"]
+ id?: string
+ itemId: string
+ label: string
+ listOptions?: string[] | null
+ sortOrder?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ dataType?: Database["public"]["Enums"]["configurationParameterDataType"]
+ id?: string
+ itemId?: string
+ label?: string
+ listOptions?: string[] | null
+ sortOrder?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "batchProperty_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "batchProperty_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "batchProperty_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "batchProperty_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "batchProperty_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "batchProperty_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "batchProperty_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "batchProperty_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "batchProperty_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "batchProperty_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "batchProperty_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "batchProperty_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "batchProperty_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "batchProperty_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "batchProperty_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "batchProperty_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "batchProperty_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "batchProperty_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "batchProperty_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "batchProperty_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ challengeAttempt: {
+ Row: {
+ courseId: string
+ createdAt: string
+ id: number
+ passed: boolean
+ topicId: string
+ userId: string
+ }
+ Insert: {
+ courseId: string
+ createdAt?: string
+ id?: number
+ passed?: boolean
+ topicId: string
+ userId: string
+ }
+ Update: {
+ courseId?: string
+ createdAt?: string
+ id?: number
+ passed?: boolean
+ topicId?: string
+ userId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "challengeAttempt_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "challengeAttempt_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "challengeAttempt_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "challengeAttempt_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "challengeAttempt_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ company: {
+ Row: {
+ active: boolean
+ addressLine1: string | null
+ addressLine2: string | null
+ auditLogEnabled: boolean
+ baseCurrencyCode: string
+ city: string | null
+ companyGroupId: string | null
+ countryCode: string | null
+ createdAt: string
+ email: string | null
+ eori: string | null
+ fax: string | null
+ id: string
+ isEliminationEntity: boolean
+ logoDark: string | null
+ logoDarkIcon: string | null
+ logoLight: string | null
+ logoLightIcon: string | null
+ logoWatermark: string | null
+ name: string
+ parentCompanyId: string | null
+ phone: string | null
+ postalCode: string | null
+ slackChannel: string | null
+ stateProvince: string | null
+ suggestionNotificationGroup: string[]
+ taxId: string | null
+ updatedBy: string | null
+ vatNumber: string | null
+ website: string | null
+ }
+ Insert: {
+ active?: boolean
+ addressLine1?: string | null
+ addressLine2?: string | null
+ auditLogEnabled?: boolean
+ baseCurrencyCode: string
+ city?: string | null
+ companyGroupId?: string | null
+ countryCode?: string | null
+ createdAt?: string
+ email?: string | null
+ eori?: string | null
+ fax?: string | null
+ id?: string
+ isEliminationEntity?: boolean
+ logoDark?: string | null
+ logoDarkIcon?: string | null
+ logoLight?: string | null
+ logoLightIcon?: string | null
+ logoWatermark?: string | null
+ name: string
+ parentCompanyId?: string | null
+ phone?: string | null
+ postalCode?: string | null
+ slackChannel?: string | null
+ stateProvince?: string | null
+ suggestionNotificationGroup?: string[]
+ taxId?: string | null
+ updatedBy?: string | null
+ vatNumber?: string | null
+ website?: string | null
+ }
+ Update: {
+ active?: boolean
+ addressLine1?: string | null
+ addressLine2?: string | null
+ auditLogEnabled?: boolean
+ baseCurrencyCode?: string
+ city?: string | null
+ companyGroupId?: string | null
+ countryCode?: string | null
+ createdAt?: string
+ email?: string | null
+ eori?: string | null
+ fax?: string | null
+ id?: string
+ isEliminationEntity?: boolean
+ logoDark?: string | null
+ logoDarkIcon?: string | null
+ logoLight?: string | null
+ logoLightIcon?: string | null
+ logoWatermark?: string | null
+ name?: string
+ parentCompanyId?: string | null
+ phone?: string | null
+ postalCode?: string | null
+ slackChannel?: string | null
+ stateProvince?: string | null
+ suggestionNotificationGroup?: string[]
+ taxId?: string | null
+ updatedBy?: string | null
+ vatNumber?: string | null
+ website?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "accountDefault_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "company_baseCurrencyCode_fkey"
+ columns: ["baseCurrencyCode"]
+ isOneToOne: false
+ referencedRelation: "currencyCode"
+ referencedColumns: ["code"]
+ },
+ {
+ foreignKeyName: "company_companyGroupId_fkey"
+ columns: ["companyGroupId"]
+ isOneToOne: false
+ referencedRelation: "companyGroup"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "company_parentCompanyId_fkey"
+ columns: ["parentCompanyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "company_parentCompanyId_fkey"
+ columns: ["parentCompanyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "company_parentCompanyId_fkey"
+ columns: ["parentCompanyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "company_parentCompanyId_fkey"
+ columns: ["parentCompanyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ ]
+ }
+ companyAccountsPayableBillingAddress: {
+ Row: {
+ addressLine1: string | null
+ addressLine2: string | null
+ city: string | null
+ countryCode: string | null
+ email: string | null
+ fax: string | null
+ id: string
+ name: string | null
+ phone: string | null
+ postalCode: string | null
+ state: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ addressLine1?: string | null
+ addressLine2?: string | null
+ city?: string | null
+ countryCode?: string | null
+ email?: string | null
+ fax?: string | null
+ id: string
+ name?: string | null
+ phone?: string | null
+ postalCode?: string | null
+ state?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ addressLine1?: string | null
+ addressLine2?: string | null
+ city?: string | null
+ countryCode?: string | null
+ email?: string | null
+ fax?: string | null
+ id?: string
+ name?: string | null
+ phone?: string | null
+ postalCode?: string | null
+ state?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "companyAccountsPayableBillingAddress_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "companyAccountsPayableBillingAddress_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "companyAccountsPayableBillingAddress_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "companyAccountsPayableBillingAddress_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ ]
+ }
+ companyAccountsReceivableBillingAddress: {
+ Row: {
+ addressLine1: string | null
+ addressLine2: string | null
+ city: string | null
+ countryCode: string | null
+ email: string | null
+ fax: string | null
+ id: string
+ name: string | null
+ phone: string | null
+ postalCode: string | null
+ state: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ addressLine1?: string | null
+ addressLine2?: string | null
+ city?: string | null
+ countryCode?: string | null
+ email?: string | null
+ fax?: string | null
+ id: string
+ name?: string | null
+ phone?: string | null
+ postalCode?: string | null
+ state?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ addressLine1?: string | null
+ addressLine2?: string | null
+ city?: string | null
+ countryCode?: string | null
+ email?: string | null
+ fax?: string | null
+ id?: string
+ name?: string | null
+ phone?: string | null
+ postalCode?: string | null
+ state?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "companyAccountsReceivableBillingAddress_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "companyAccountsReceivableBillingAddress_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "companyAccountsReceivableBillingAddress_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "companyAccountsReceivableBillingAddress_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ ]
+ }
+ companyGroup: {
+ Row: {
+ createdAt: string
+ createdBy: string | null
+ id: string
+ name: string
+ ownerId: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ createdAt?: string
+ createdBy?: string | null
+ id?: string
+ name: string
+ ownerId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ createdAt?: string
+ createdBy?: string | null
+ id?: string
+ name?: string
+ ownerId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "companyGroup_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "companyGroup_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "companyGroup_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "companyGroup_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "companyGroup_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "companyGroup_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "companyGroup_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "companyGroup_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "companyGroup_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "companyGroup_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "companyGroup_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "companyGroup_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "companyGroup_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "companyGroup_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "companyGroup_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ companyIntegration: {
+ Row: {
+ active: boolean
+ companyId: string
+ id: string
+ metadata: Json
+ updatedAt: string
+ updatedBy: string | null
+ }
+ Insert: {
+ active?: boolean
+ companyId: string
+ id: string
+ metadata?: Json
+ updatedAt?: string
+ updatedBy?: string | null
+ }
+ Update: {
+ active?: boolean
+ companyId?: string
+ id?: string
+ metadata?: Json
+ updatedAt?: string
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "companyIntegration_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "companyIntegration_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "companyIntegration_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "companyIntegration_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "companyIntegration_id_fkey"
+ columns: ["id"]
+ isOneToOne: false
+ referencedRelation: "integration"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "companyIntegration_id_fkey"
+ columns: ["id"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ companyPlan: {
+ Row: {
+ aiTokensLimit: number
+ createdAt: string
+ id: string
+ planId: string
+ stripeCustomerId: string | null
+ stripeSubscriptionId: string | null
+ stripeSubscriptionStatus: string
+ subscriptionStartDate: string
+ tasksLimit: number
+ trialPeriodEndsAt: string | null
+ updatedAt: string
+ usersLimit: number
+ }
+ Insert: {
+ aiTokensLimit?: number
+ createdAt?: string
+ id?: string
+ planId: string
+ stripeCustomerId?: string | null
+ stripeSubscriptionId?: string | null
+ stripeSubscriptionStatus?: string
+ subscriptionStartDate: string
+ tasksLimit?: number
+ trialPeriodEndsAt?: string | null
+ updatedAt?: string
+ usersLimit?: number
+ }
+ Update: {
+ aiTokensLimit?: number
+ createdAt?: string
+ id?: string
+ planId?: string
+ stripeCustomerId?: string | null
+ stripeSubscriptionId?: string | null
+ stripeSubscriptionStatus?: string
+ subscriptionStartDate?: string
+ tasksLimit?: number
+ trialPeriodEndsAt?: string | null
+ updatedAt?: string
+ usersLimit?: number
+ }
+ Relationships: [
+ {
+ foreignKeyName: "fk_companyPlan_company"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fk_companyPlan_company"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fk_companyPlan_company"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "fk_companyPlan_company"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "fk_companyPlan_plan"
+ columns: ["planId"]
+ isOneToOne: false
+ referencedRelation: "plan"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ companySettings: {
+ Row: {
+ accountingEnabled: boolean
+ accountsPayableAddress: boolean | null
+ accountsPayableEmail: string | null
+ accountsReceivableAddress: boolean | null
+ accountsReceivableEmail: string | null
+ assetTaxDepreciationEnabled: boolean
+ assetTaxRate: number | null
+ consoleEnabled: boolean
+ defaultCustomerCc: string[] | null
+ defaultSupplierCc: string[] | null
+ digitalQuoteEnabled: boolean
+ digitalQuoteIncludesPurchaseOrders: boolean
+ digitalQuoteNotificationGroup: string[]
+ enforceInspectionFourEyes: boolean
+ gaugeCalibrationExpiredNotificationGroup: string[]
+ id: string
+ includeThumbnailsOnPurchasingPdfs: boolean
+ includeThumbnailsOnSalesPdfs: boolean
+ inventoryJobCompletedNotificationGroup: string[]
+ inventoryShelfLife: Json
+ jobTravelerIncludeWorkInstructions: boolean
+ kanbanOutput: Database["public"]["Enums"]["kanbanOutput"]
+ maintenanceAdvanceDays: number
+ maintenanceDispatchNotificationGroup: string[] | null
+ maintenanceGenerateInAdvance: boolean
+ materialGeneratedIds: boolean
+ operationsDispatchNotificationGroup: string[] | null
+ otherDispatchNotificationGroup: string[] | null
+ productLabelSize: string | null
+ purchasePriceUpdateTiming: Database["public"]["Enums"]["purchasePriceUpdateTiming"]
+ qualityDispatchNotificationGroup: string[] | null
+ qualityIssueTarget: number
+ quoteLineCategoryMarkups: Json | null
+ rfqReadyNotificationGroup: string[]
+ salesJobCompletedNotificationGroup: string[]
+ samplingStandard: Database["public"]["Enums"]["samplingStandard"]
+ shelfLabelSize: string | null
+ showCustomerReadableId: boolean
+ showSupplierReadableId: boolean
+ supplierQuoteNotificationGroup: string[]
+ timeCardEnabled: boolean
+ updateLeadTimesOnReceipt: boolean
+ useMetric: boolean
+ }
+ Insert: {
+ accountingEnabled?: boolean
+ accountsPayableAddress?: boolean | null
+ accountsPayableEmail?: string | null
+ accountsReceivableAddress?: boolean | null
+ accountsReceivableEmail?: string | null
+ assetTaxDepreciationEnabled?: boolean
+ assetTaxRate?: number | null
+ consoleEnabled?: boolean
+ defaultCustomerCc?: string[] | null
+ defaultSupplierCc?: string[] | null
+ digitalQuoteEnabled?: boolean
+ digitalQuoteIncludesPurchaseOrders?: boolean
+ digitalQuoteNotificationGroup?: string[]
+ enforceInspectionFourEyes?: boolean
+ gaugeCalibrationExpiredNotificationGroup?: string[]
+ id: string
+ includeThumbnailsOnPurchasingPdfs?: boolean
+ includeThumbnailsOnSalesPdfs?: boolean
+ inventoryJobCompletedNotificationGroup?: string[]
+ inventoryShelfLife?: Json
+ jobTravelerIncludeWorkInstructions?: boolean
+ kanbanOutput?: Database["public"]["Enums"]["kanbanOutput"]
+ maintenanceAdvanceDays?: number
+ maintenanceDispatchNotificationGroup?: string[] | null
+ maintenanceGenerateInAdvance?: boolean
+ materialGeneratedIds?: boolean
+ operationsDispatchNotificationGroup?: string[] | null
+ otherDispatchNotificationGroup?: string[] | null
+ productLabelSize?: string | null
+ purchasePriceUpdateTiming?: Database["public"]["Enums"]["purchasePriceUpdateTiming"]
+ qualityDispatchNotificationGroup?: string[] | null
+ qualityIssueTarget?: number
+ quoteLineCategoryMarkups?: Json | null
+ rfqReadyNotificationGroup?: string[]
+ salesJobCompletedNotificationGroup?: string[]
+ samplingStandard?: Database["public"]["Enums"]["samplingStandard"]
+ shelfLabelSize?: string | null
+ showCustomerReadableId?: boolean
+ showSupplierReadableId?: boolean
+ supplierQuoteNotificationGroup?: string[]
+ timeCardEnabled?: boolean
+ updateLeadTimesOnReceipt?: boolean
+ useMetric?: boolean
+ }
+ Update: {
+ accountingEnabled?: boolean
+ accountsPayableAddress?: boolean | null
+ accountsPayableEmail?: string | null
+ accountsReceivableAddress?: boolean | null
+ accountsReceivableEmail?: string | null
+ assetTaxDepreciationEnabled?: boolean
+ assetTaxRate?: number | null
+ consoleEnabled?: boolean
+ defaultCustomerCc?: string[] | null
+ defaultSupplierCc?: string[] | null
+ digitalQuoteEnabled?: boolean
+ digitalQuoteIncludesPurchaseOrders?: boolean
+ digitalQuoteNotificationGroup?: string[]
+ enforceInspectionFourEyes?: boolean
+ gaugeCalibrationExpiredNotificationGroup?: string[]
+ id?: string
+ includeThumbnailsOnPurchasingPdfs?: boolean
+ includeThumbnailsOnSalesPdfs?: boolean
+ inventoryJobCompletedNotificationGroup?: string[]
+ inventoryShelfLife?: Json
+ jobTravelerIncludeWorkInstructions?: boolean
+ kanbanOutput?: Database["public"]["Enums"]["kanbanOutput"]
+ maintenanceAdvanceDays?: number
+ maintenanceDispatchNotificationGroup?: string[] | null
+ maintenanceGenerateInAdvance?: boolean
+ materialGeneratedIds?: boolean
+ operationsDispatchNotificationGroup?: string[] | null
+ otherDispatchNotificationGroup?: string[] | null
+ productLabelSize?: string | null
+ purchasePriceUpdateTiming?: Database["public"]["Enums"]["purchasePriceUpdateTiming"]
+ qualityDispatchNotificationGroup?: string[] | null
+ qualityIssueTarget?: number
+ quoteLineCategoryMarkups?: Json | null
+ rfqReadyNotificationGroup?: string[]
+ salesJobCompletedNotificationGroup?: string[]
+ samplingStandard?: Database["public"]["Enums"]["samplingStandard"]
+ shelfLabelSize?: string | null
+ showCustomerReadableId?: boolean
+ showSupplierReadableId?: boolean
+ supplierQuoteNotificationGroup?: string[]
+ timeCardEnabled?: boolean
+ updateLeadTimesOnReceipt?: boolean
+ useMetric?: boolean
+ }
+ Relationships: [
+ {
+ foreignKeyName: "companySettings_companyId_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "companySettings_companyId_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "companySettings_companyId_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "companySettings_companyId_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ ]
+ }
+ companyUsage: {
+ Row: {
+ aiTokens: number
+ companyId: string
+ createdAt: string
+ id: string
+ nextResetDatetime: string
+ tasks: number
+ updatedAt: string
+ users: number
+ }
+ Insert: {
+ aiTokens?: number
+ companyId: string
+ createdAt?: string
+ id?: string
+ nextResetDatetime: string
+ tasks?: number
+ updatedAt?: string
+ users?: number
+ }
+ Update: {
+ aiTokens?: number
+ companyId?: string
+ createdAt?: string
+ id?: string
+ nextResetDatetime?: string
+ tasks?: number
+ updatedAt?: string
+ users?: number
+ }
+ Relationships: [
+ {
+ foreignKeyName: "fk_companyUsage_company"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fk_companyUsage_company"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fk_companyUsage_company"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "fk_companyUsage_company"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ ]
+ }
+ config: {
+ Row: {
+ anonKey: string
+ apiUrl: string
+ id: boolean
+ }
+ Insert: {
+ anonKey: string
+ apiUrl: string
+ id?: boolean
+ }
+ Update: {
+ anonKey?: string
+ apiUrl?: string
+ id?: boolean
+ }
+ Relationships: []
+ }
+ configurationParameter: {
+ Row: {
+ companyId: string
+ configurationParameterGroupId: string | null
+ createdAt: string
+ createdBy: string
+ dataType: Database["public"]["Enums"]["configurationParameterDataType"]
+ id: string
+ itemId: string
+ key: string
+ label: string
+ listOptions: string[] | null
+ materialFormFilterId: string | null
+ sortOrder: number
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ configurationParameterGroupId?: string | null
+ createdAt?: string
+ createdBy: string
+ dataType: Database["public"]["Enums"]["configurationParameterDataType"]
+ id?: string
+ itemId: string
+ key: string
+ label: string
+ listOptions?: string[] | null
+ materialFormFilterId?: string | null
+ sortOrder?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ configurationParameterGroupId?: string | null
+ createdAt?: string
+ createdBy?: string
+ dataType?: Database["public"]["Enums"]["configurationParameterDataType"]
+ id?: string
+ itemId?: string
+ key?: string
+ label?: string
+ listOptions?: string[] | null
+ materialFormFilterId?: string | null
+ sortOrder?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "configurationParameter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationParameter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationParameter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "configurationParameter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "configurationParameter_configurationParameterGroupId_fkey"
+ columns: ["configurationParameterGroupId"]
+ isOneToOne: false
+ referencedRelation: "configurationParameterGroup"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationParameter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationParameter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationParameter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationParameter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationParameter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "configurationParameter_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationParameter_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationParameter_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationParameter_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationParameter_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationParameter_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationParameter_materialFormFilterId_fkey"
+ columns: ["materialFormFilterId"]
+ isOneToOne: false
+ referencedRelation: "materialForm"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationParameter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationParameter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationParameter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationParameter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationParameter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ configurationParameterGroup: {
+ Row: {
+ companyId: string
+ id: string
+ isUngrouped: boolean
+ itemId: string
+ name: string
+ sortOrder: number
+ }
+ Insert: {
+ companyId: string
+ id?: string
+ isUngrouped?: boolean
+ itemId: string
+ name: string
+ sortOrder?: number
+ }
+ Update: {
+ companyId?: string
+ id?: string
+ isUngrouped?: boolean
+ itemId?: string
+ name?: string
+ sortOrder?: number
+ }
+ Relationships: [
+ {
+ foreignKeyName: "configurationParameterGroup_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationParameterGroup_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationParameterGroup_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "configurationParameterGroup_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "configurationParameterGroup_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationParameterGroup_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationParameterGroup_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationParameterGroup_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationParameterGroup_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationParameterGroup_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ configurationRule: {
+ Row: {
+ code: string
+ companyId: string
+ field: string
+ itemId: string
+ updatedAt: string
+ updatedBy: string | null
+ }
+ Insert: {
+ code: string
+ companyId: string
+ field: string
+ itemId: string
+ updatedAt?: string
+ updatedBy?: string | null
+ }
+ Update: {
+ code?: string
+ companyId?: string
+ field?: string
+ itemId?: string
+ updatedAt?: string
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "configurationRule_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationRule_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationRule_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "configurationRule_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "configurationRule_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationRule_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationRule_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationRule_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationRule_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationRule_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationRule_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationRule_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationRule_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationRule_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "configurationRule_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ consumable: {
+ Row: {
+ approved: boolean
+ approvedBy: string | null
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ id: string
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ approved?: boolean
+ approvedBy?: string | null
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ id: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ approved?: boolean
+ approvedBy?: string | null
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ id?: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "consumable_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "consumable_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "consumable_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "consumable_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "consumable_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "consumable_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "consumable_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "consumable_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "consumable_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "consumable_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "consumable_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "consumable_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "consumable_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "consumable_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "consumable_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "consumable_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "consumable_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "consumable_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "consumable_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ contact: {
+ Row: {
+ companyId: string
+ email: string | null
+ fax: string | null
+ firstName: string | null
+ fullName: string | null
+ homePhone: string | null
+ id: string
+ isCustomer: boolean
+ lastName: string | null
+ mobilePhone: string | null
+ notes: string | null
+ title: string | null
+ workPhone: string | null
+ }
+ Insert: {
+ companyId: string
+ email?: string | null
+ fax?: string | null
+ firstName?: string | null
+ fullName?: string | null
+ homePhone?: string | null
+ id?: string
+ isCustomer?: boolean
+ lastName?: string | null
+ mobilePhone?: string | null
+ notes?: string | null
+ title?: string | null
+ workPhone?: string | null
+ }
+ Update: {
+ companyId?: string
+ email?: string | null
+ fax?: string | null
+ firstName?: string | null
+ fullName?: string | null
+ homePhone?: string | null
+ id?: string
+ isCustomer?: boolean
+ lastName?: string | null
+ mobilePhone?: string | null
+ notes?: string | null
+ title?: string | null
+ workPhone?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "contact_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "contact_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "contact_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "contact_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ ]
+ }
+ contractor: {
+ Row: {
+ active: boolean
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ hoursPerWeek: number
+ id: string
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ active?: boolean
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ hoursPerWeek?: number
+ id: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ active?: boolean
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ hoursPerWeek?: number
+ id?: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "contractor_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "contractor_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "contractor_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "contractor_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "contractor_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "contractor_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "contractor_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "contractor_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "contractor_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "contractor_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "supplierContact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "contractor_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "contractor_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "contractor_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "contractor_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "contractor_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ contractorAbility: {
+ Row: {
+ abilityId: string
+ contractorId: string
+ createdAt: string
+ createdBy: string
+ }
+ Insert: {
+ abilityId: string
+ contractorId: string
+ createdAt?: string
+ createdBy: string
+ }
+ Update: {
+ abilityId?: string
+ contractorId?: string
+ createdAt?: string
+ createdBy?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "contractorAbility_abilityId_fkey"
+ columns: ["abilityId"]
+ isOneToOne: false
+ referencedRelation: "ability"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "contractorAbility_contractorId_fkey"
+ columns: ["contractorId"]
+ isOneToOne: false
+ referencedRelation: "contractor"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "contractorAbility_contractorId_fkey"
+ columns: ["contractorId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierContactId"]
+ },
+ {
+ foreignKeyName: "contractorAbility_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "contractorAbility_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "contractorAbility_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "contractorAbility_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "contractorAbility_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ costCenter: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ id: string
+ name: string
+ ownerId: string | null
+ parentCostCenterId: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ id?: string
+ name: string
+ ownerId?: string | null
+ parentCostCenterId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ id?: string
+ name?: string
+ ownerId?: string | null
+ parentCostCenterId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "costCenter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "costCenter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "costCenter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "costCenter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "costCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "costCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "costCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "costCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "costCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "costCenter_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "costCenter_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "costCenter_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "costCenter_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "costCenter_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "costCenter_parentCostCenterId_fkey"
+ columns: ["parentCostCenterId"]
+ isOneToOne: false
+ referencedRelation: "costCenter"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "costCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "costCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "costCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "costCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "costCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ costLedger: {
+ Row: {
+ adjustment: boolean
+ companyId: string
+ cost: number
+ costLedgerType: Database["public"]["Enums"]["costLedgerType"]
+ createdAt: string
+ documentId: string | null
+ documentType:
+ | Database["public"]["Enums"]["itemLedgerDocumentType"]
+ | null
+ entryNumber: number
+ externalDocumentId: string | null
+ id: string
+ itemId: string | null
+ itemLedgerType: Database["public"]["Enums"]["itemLedgerType"]
+ nominalCost: number
+ postingDate: string
+ quantity: number
+ remainingQuantity: number
+ supplierId: string | null
+ }
+ Insert: {
+ adjustment?: boolean
+ companyId: string
+ cost?: number
+ costLedgerType: Database["public"]["Enums"]["costLedgerType"]
+ createdAt?: string
+ documentId?: string | null
+ documentType?:
+ | Database["public"]["Enums"]["itemLedgerDocumentType"]
+ | null
+ entryNumber?: number
+ externalDocumentId?: string | null
+ id?: string
+ itemId?: string | null
+ itemLedgerType: Database["public"]["Enums"]["itemLedgerType"]
+ nominalCost?: number
+ postingDate?: string
+ quantity?: number
+ remainingQuantity?: number
+ supplierId?: string | null
+ }
+ Update: {
+ adjustment?: boolean
+ companyId?: string
+ cost?: number
+ costLedgerType?: Database["public"]["Enums"]["costLedgerType"]
+ createdAt?: string
+ documentId?: string | null
+ documentType?:
+ | Database["public"]["Enums"]["itemLedgerDocumentType"]
+ | null
+ entryNumber?: number
+ externalDocumentId?: string | null
+ id?: string
+ itemId?: string | null
+ itemLedgerType?: Database["public"]["Enums"]["itemLedgerType"]
+ nominalCost?: number
+ postingDate?: string
+ quantity?: number
+ remainingQuantity?: number
+ supplierId?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "costLedger_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "costLedger_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "costLedger_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "costLedger_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "costLedger_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "costLedger_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "costLedger_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "costLedger_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "costLedger_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ country: {
+ Row: {
+ alpha2: string
+ alpha3: string
+ name: string
+ }
+ Insert: {
+ alpha2: string
+ alpha3: string
+ name: string
+ }
+ Update: {
+ alpha2?: string
+ alpha3?: string
+ name?: string
+ }
+ Relationships: []
+ }
+ currency: {
+ Row: {
+ active: boolean
+ code: string
+ companyGroupId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ decimalPlaces: number
+ exchangeRate: number
+ historicalExchangeRate: number | null
+ id: string
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ active?: boolean
+ code: string
+ companyGroupId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ decimalPlaces?: number
+ exchangeRate?: number
+ historicalExchangeRate?: number | null
+ id?: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ active?: boolean
+ code?: string
+ companyGroupId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ decimalPlaces?: number
+ exchangeRate?: number
+ historicalExchangeRate?: number | null
+ id?: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "currency_companyGroupId_fkey"
+ columns: ["companyGroupId"]
+ isOneToOne: false
+ referencedRelation: "companyGroup"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "currency_currencyCode_fkey"
+ columns: ["code"]
+ isOneToOne: false
+ referencedRelation: "currencyCode"
+ referencedColumns: ["code"]
+ },
+ {
+ foreignKeyName: "currency_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "currency_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "currency_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "currency_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "currency_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ currencyCode: {
+ Row: {
+ code: string
+ name: string
+ }
+ Insert: {
+ code: string
+ name: string
+ }
+ Update: {
+ code?: string
+ name?: string
+ }
+ Relationships: []
+ }
+ customer: {
+ Row: {
+ accountManagerId: string | null
+ assignee: string | null
+ companyId: string
+ createdAt: string
+ createdBy: string | null
+ currencyCode: string | null
+ customerStatusId: string | null
+ customerTypeId: string | null
+ customFields: Json | null
+ defaultCc: string[] | null
+ embedding: unknown
+ fax: string | null
+ id: string
+ intercompanyCompanyId: string | null
+ logo: string | null
+ name: string
+ phone: string | null
+ readableId: string
+ salesContactId: string | null
+ tags: string[] | null
+ taxPercent: number
+ updatedAt: string | null
+ updatedBy: string | null
+ website: string | null
+ }
+ Insert: {
+ accountManagerId?: string | null
+ assignee?: string | null
+ companyId: string
+ createdAt?: string
+ createdBy?: string | null
+ currencyCode?: string | null
+ customerStatusId?: string | null
+ customerTypeId?: string | null
+ customFields?: Json | null
+ defaultCc?: string[] | null
+ embedding?: unknown
+ fax?: string | null
+ id?: string
+ intercompanyCompanyId?: string | null
+ logo?: string | null
+ name: string
+ phone?: string | null
+ readableId?: string
+ salesContactId?: string | null
+ tags?: string[] | null
+ taxPercent?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ website?: string | null
+ }
+ Update: {
+ accountManagerId?: string | null
+ assignee?: string | null
+ companyId?: string
+ createdAt?: string
+ createdBy?: string | null
+ currencyCode?: string | null
+ customerStatusId?: string | null
+ customerTypeId?: string | null
+ customFields?: Json | null
+ defaultCc?: string[] | null
+ embedding?: unknown
+ fax?: string | null
+ id?: string
+ intercompanyCompanyId?: string | null
+ logo?: string | null
+ name?: string
+ phone?: string | null
+ readableId?: string
+ salesContactId?: string | null
+ tags?: string[] | null
+ taxPercent?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ website?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "customer_accountManagerId_fkey"
+ columns: ["accountManagerId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_accountManagerId_fkey"
+ columns: ["accountManagerId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_accountManagerId_fkey"
+ columns: ["accountManagerId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_accountManagerId_fkey"
+ columns: ["accountManagerId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_accountManagerId_fkey"
+ columns: ["accountManagerId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "customer_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "customer_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customer_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customer_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "customer_currencyCode_fkey"
+ columns: ["currencyCode"]
+ isOneToOne: false
+ referencedRelation: "currencyCode"
+ referencedColumns: ["code"]
+ },
+ {
+ foreignKeyName: "customer_customerStatusId_fkey"
+ columns: ["customerStatusId"]
+ isOneToOne: false
+ referencedRelation: "customerStatus"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_customerTypeId_fkey"
+ columns: ["customerTypeId"]
+ isOneToOne: false
+ referencedRelation: "customerType"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_intercompanyCompanyId_fkey"
+ columns: ["intercompanyCompanyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_intercompanyCompanyId_fkey"
+ columns: ["intercompanyCompanyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_intercompanyCompanyId_fkey"
+ columns: ["intercompanyCompanyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customer_intercompanyCompanyId_fkey"
+ columns: ["intercompanyCompanyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customer_salesContactId_fkey"
+ columns: ["salesContactId"]
+ isOneToOne: false
+ referencedRelation: "customerContact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ customerAccount: {
+ Row: {
+ active: boolean
+ companyId: string
+ customerId: string
+ id: string
+ }
+ Insert: {
+ active?: boolean
+ companyId: string
+ customerId: string
+ id: string
+ }
+ Update: {
+ active?: boolean
+ companyId?: string
+ customerId?: string
+ id?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "customerAccount_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerAccount_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerAccount_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customerAccount_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customerAccount_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerAccount_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerAccount_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerAccount_id_fkey"
+ columns: ["id"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerAccount_id_fkey"
+ columns: ["id"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerAccount_id_fkey"
+ columns: ["id"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerAccount_id_fkey"
+ columns: ["id"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerAccount_id_fkey"
+ columns: ["id"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ customerContact: {
+ Row: {
+ contactId: string
+ customerId: string
+ customerLocationId: string | null
+ customFields: Json | null
+ id: string
+ tags: string[] | null
+ userId: string | null
+ }
+ Insert: {
+ contactId: string
+ customerId: string
+ customerLocationId?: string | null
+ customFields?: Json | null
+ id?: string
+ tags?: string[] | null
+ userId?: string | null
+ }
+ Update: {
+ contactId?: string
+ customerId?: string
+ customerLocationId?: string | null
+ customFields?: Json | null
+ id?: string
+ tags?: string[] | null
+ userId?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "customerContact_contactId_fkey"
+ columns: ["contactId"]
+ isOneToOne: false
+ referencedRelation: "contact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerContact_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerContact_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerContact_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerContact_customerLocationId_fkey"
+ columns: ["customerLocationId"]
+ isOneToOne: false
+ referencedRelation: "customerLocation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerContact_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerContact_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerContact_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerContact_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerContact_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ customerItemPriceOverride: {
+ Row: {
+ active: boolean
+ applyRulesOnTop: boolean
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customerId: string | null
+ customerTypeId: string | null
+ id: string
+ itemId: string
+ notes: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ validFrom: string | null
+ validTo: string | null
+ }
+ Insert: {
+ active?: boolean
+ applyRulesOnTop?: boolean
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customerId?: string | null
+ customerTypeId?: string | null
+ id?: string
+ itemId: string
+ notes?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ validFrom?: string | null
+ validTo?: string | null
+ }
+ Update: {
+ active?: boolean
+ applyRulesOnTop?: boolean
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customerId?: string | null
+ customerTypeId?: string | null
+ id?: string
+ itemId?: string
+ notes?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ validFrom?: string | null
+ validTo?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "customerItemPriceOverride_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverride_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverride_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverride_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverride_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverride_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverride_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverride_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverride_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverride_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverride_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverride_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverride_customerTypeId_fkey"
+ columns: ["customerTypeId"]
+ isOneToOne: false
+ referencedRelation: "customerType"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverride_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverride_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverride_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverride_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverride_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverride_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverride_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverride_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverride_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverride_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverride_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ customerItemPriceOverrideBreak: {
+ Row: {
+ active: boolean
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customerItemPriceOverrideId: string
+ id: string
+ overridePrice: number
+ quantity: number
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ active?: boolean
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customerItemPriceOverrideId: string
+ id?: string
+ overridePrice: number
+ quantity: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ active?: boolean
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customerItemPriceOverrideId?: string
+ id?: string
+ overridePrice?: number
+ quantity?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "customerItemPriceOverrideBreak_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverrideBreak_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverrideBreak_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverrideBreak_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverrideBreak_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverrideBreak_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverrideBreak_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverrideBreak_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverrideBreak_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverrideBreak_override_fkey"
+ columns: ["customerItemPriceOverrideId", "companyId"]
+ isOneToOne: false
+ referencedRelation: "customerItemPriceOverride"
+ referencedColumns: ["id", "companyId"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverrideBreak_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverrideBreak_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverrideBreak_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverrideBreak_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerItemPriceOverrideBreak_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ customerLocation: {
+ Row: {
+ addressId: string
+ customerId: string
+ customFields: Json | null
+ id: string
+ name: string
+ tags: string[] | null
+ }
+ Insert: {
+ addressId: string
+ customerId: string
+ customFields?: Json | null
+ id?: string
+ name: string
+ tags?: string[] | null
+ }
+ Update: {
+ addressId?: string
+ customerId?: string
+ customFields?: Json | null
+ id?: string
+ name?: string
+ tags?: string[] | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "customerLocation_addressId_fkey"
+ columns: ["addressId"]
+ isOneToOne: false
+ referencedRelation: "address"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerLocation_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerLocation_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerLocation_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ customerPartToItem: {
+ Row: {
+ companyId: string
+ customerId: string
+ customerPartId: string
+ customerPartRevision: string | null
+ id: string
+ itemId: string
+ }
+ Insert: {
+ companyId: string
+ customerId: string
+ customerPartId: string
+ customerPartRevision?: string | null
+ id?: string
+ itemId: string
+ }
+ Update: {
+ companyId?: string
+ customerId?: string
+ customerPartId?: string
+ customerPartRevision?: string | null
+ id?: string
+ itemId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "customerPartToItem_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerPartToItem_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerPartToItem_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customerPartToItem_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customerPartToItem_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerPartToItem_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerPartToItem_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerPartToItem_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerPartToItem_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerPartToItem_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerPartToItem_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerPartToItem_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerPartToItem_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ customerPayment: {
+ Row: {
+ companyId: string
+ customerId: string
+ invoiceCustomerContactId: string | null
+ invoiceCustomerId: string | null
+ invoiceCustomerLocationId: string | null
+ paymentTermId: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ customerId: string
+ invoiceCustomerContactId?: string | null
+ invoiceCustomerId?: string | null
+ invoiceCustomerLocationId?: string | null
+ paymentTermId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ customerId?: string
+ invoiceCustomerContactId?: string | null
+ invoiceCustomerId?: string | null
+ invoiceCustomerLocationId?: string | null
+ paymentTermId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "customerPayment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerPayment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerPayment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customerPayment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customerPayment_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: true
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerPayment_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: true
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerPayment_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: true
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerPayment_invoiceCustomerContactId_fkey"
+ columns: ["invoiceCustomerContactId"]
+ isOneToOne: false
+ referencedRelation: "customerContact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerPayment_invoiceCustomerId_fkey"
+ columns: ["invoiceCustomerId"]
+ isOneToOne: false
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerPayment_invoiceCustomerId_fkey"
+ columns: ["invoiceCustomerId"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerPayment_invoiceCustomerId_fkey"
+ columns: ["invoiceCustomerId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerPayment_invoiceCustomerLocationId_fkey"
+ columns: ["invoiceCustomerLocationId"]
+ isOneToOne: false
+ referencedRelation: "customerLocation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerPayment_paymentTermId_fkey"
+ columns: ["paymentTermId"]
+ isOneToOne: false
+ referencedRelation: "paymentTerm"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerPayment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerPayment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerPayment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerPayment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerPayment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ customerShipping: {
+ Row: {
+ companyId: string
+ customerId: string
+ incoterm: Database["public"]["Enums"]["incoterm"] | null
+ incotermLocation: string | null
+ shippingCustomerContactId: string | null
+ shippingCustomerId: string | null
+ shippingCustomerLocationId: string | null
+ shippingMethodId: string | null
+ shippingTermId: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ customerId: string
+ incoterm?: Database["public"]["Enums"]["incoterm"] | null
+ incotermLocation?: string | null
+ shippingCustomerContactId?: string | null
+ shippingCustomerId?: string | null
+ shippingCustomerLocationId?: string | null
+ shippingMethodId?: string | null
+ shippingTermId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ customerId?: string
+ incoterm?: Database["public"]["Enums"]["incoterm"] | null
+ incotermLocation?: string | null
+ shippingCustomerContactId?: string | null
+ shippingCustomerId?: string | null
+ shippingCustomerLocationId?: string | null
+ shippingMethodId?: string | null
+ shippingTermId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "customerShipping_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerShipping_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerShipping_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customerShipping_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customerShipping_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: true
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerShipping_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: true
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerShipping_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: true
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerShipping_shippingCustomerContactId_fkey"
+ columns: ["shippingCustomerContactId"]
+ isOneToOne: false
+ referencedRelation: "customerContact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerShipping_shippingCustomerId_fkey"
+ columns: ["shippingCustomerId"]
+ isOneToOne: false
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerShipping_shippingCustomerId_fkey"
+ columns: ["shippingCustomerId"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerShipping_shippingCustomerId_fkey"
+ columns: ["shippingCustomerId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerShipping_shippingCustomerLocationId_fkey"
+ columns: ["shippingCustomerLocationId"]
+ isOneToOne: false
+ referencedRelation: "customerLocation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerShipping_shippingMethodId_fkey"
+ columns: ["shippingMethodId"]
+ isOneToOne: false
+ referencedRelation: "shippingMethod"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerShipping_shippingTermId_fkey"
+ columns: ["shippingTermId"]
+ isOneToOne: false
+ referencedRelation: "shippingTerm"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerShipping_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerShipping_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerShipping_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerShipping_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerShipping_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ customerStatus: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ id: string
+ name: string
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ id?: string
+ name: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ id?: string
+ name?: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "customerStatus_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerStatus_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerStatus_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customerStatus_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customerStatus_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerStatus_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerStatus_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerStatus_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerStatus_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "customerStatus_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerStatus_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerStatus_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerStatus_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerStatus_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ customerTax: {
+ Row: {
+ companyId: string
+ customerId: string
+ eori: string | null
+ taxExempt: boolean
+ taxExemptionCertificateNumber: string | null
+ taxExemptionCertificatePath: string | null
+ taxExemptionReason:
+ | Database["public"]["Enums"]["taxExemptionReason"]
+ | null
+ taxId: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ vatNumber: string | null
+ }
+ Insert: {
+ companyId: string
+ customerId: string
+ eori?: string | null
+ taxExempt?: boolean
+ taxExemptionCertificateNumber?: string | null
+ taxExemptionCertificatePath?: string | null
+ taxExemptionReason?:
+ | Database["public"]["Enums"]["taxExemptionReason"]
+ | null
+ taxId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ vatNumber?: string | null
+ }
+ Update: {
+ companyId?: string
+ customerId?: string
+ eori?: string | null
+ taxExempt?: boolean
+ taxExemptionCertificateNumber?: string | null
+ taxExemptionCertificatePath?: string | null
+ taxExemptionReason?:
+ | Database["public"]["Enums"]["taxExemptionReason"]
+ | null
+ taxId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ vatNumber?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "customerTax_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerTax_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerTax_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customerTax_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customerTax_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: true
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerTax_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: true
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerTax_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: true
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerTax_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerTax_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerTax_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerTax_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerTax_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ customerType: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ id: string
+ name: string
+ protected: boolean
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ id?: string
+ name: string
+ protected?: boolean
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ id?: string
+ name?: string
+ protected?: boolean
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "customerType_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerType_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerType_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customerType_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customerType_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerType_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerType_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerType_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerType_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "customerType_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerType_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerType_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerType_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customerType_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ customField: {
+ Row: {
+ active: boolean | null
+ companyId: string
+ createdAt: string
+ createdBy: string
+ dataTypeId: number
+ id: string
+ listOptions: string[] | null
+ name: string
+ required: boolean
+ sortOrder: number
+ table: string
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ active?: boolean | null
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ dataTypeId: number
+ id?: string
+ listOptions?: string[] | null
+ name: string
+ required?: boolean
+ sortOrder?: number
+ table: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ active?: boolean | null
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ dataTypeId?: number
+ id?: string
+ listOptions?: string[] | null
+ name?: string
+ required?: boolean
+ sortOrder?: number
+ table?: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "customField_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customField_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customField_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customField_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customField_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customField_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customField_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customField_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customField_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "customField_customFieldTable_fkey"
+ columns: ["table"]
+ isOneToOne: false
+ referencedRelation: "customFieldTable"
+ referencedColumns: ["table"]
+ },
+ {
+ foreignKeyName: "customField_customFieldTable_fkey"
+ columns: ["table"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["table"]
+ },
+ {
+ foreignKeyName: "customField_dataTypeId_fkey"
+ columns: ["dataTypeId"]
+ isOneToOne: false
+ referencedRelation: "attributeDataType"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customField_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customField_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customField_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customField_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customField_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ customFieldTable: {
+ Row: {
+ module: Database["public"]["Enums"]["module"]
+ name: string
+ table: string
+ }
+ Insert: {
+ module: Database["public"]["Enums"]["module"]
+ name: string
+ table: string
+ }
+ Update: {
+ module?: Database["public"]["Enums"]["module"]
+ name?: string
+ table?: string
+ }
+ Relationships: []
+ }
+ customRule: {
+ Row: {
+ active: boolean
+ appliesToAll: boolean
+ companyId: string
+ conditionAst: Json
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ description: string | null
+ filteredItemGroupIds: string[]
+ filteredItemMatchAll: boolean
+ filteredItemTypes: string[]
+ id: string
+ message: string
+ name: string
+ severity: string
+ surfaces: Database["public"]["Enums"]["transactionSurface"][]
+ targetType: Database["public"]["Enums"]["customRuleTargetType"]
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ active?: boolean
+ appliesToAll?: boolean
+ companyId: string
+ conditionAst: Json
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ description?: string | null
+ filteredItemGroupIds?: string[]
+ filteredItemMatchAll?: boolean
+ filteredItemTypes?: string[]
+ id?: string
+ message: string
+ name: string
+ severity: string
+ surfaces?: Database["public"]["Enums"]["transactionSurface"][]
+ targetType?: Database["public"]["Enums"]["customRuleTargetType"]
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ active?: boolean
+ appliesToAll?: boolean
+ companyId?: string
+ conditionAst?: Json
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ description?: string | null
+ filteredItemGroupIds?: string[]
+ filteredItemMatchAll?: boolean
+ filteredItemTypes?: string[]
+ id?: string
+ message?: string
+ name?: string
+ severity?: string
+ surfaces?: Database["public"]["Enums"]["transactionSurface"][]
+ targetType?: Database["public"]["Enums"]["customRuleTargetType"]
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "customRule_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRule_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRule_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customRule_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customRule_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRule_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRule_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRule_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRule_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "customRule_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRule_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRule_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRule_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRule_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ customRuleItemAssignment: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ itemId: string
+ ruleId: string
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ itemId: string
+ ruleId: string
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ itemId?: string
+ ruleId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "customRuleItemAssignment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRuleItemAssignment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRuleItemAssignment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customRuleItemAssignment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customRuleItemAssignment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRuleItemAssignment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRuleItemAssignment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRuleItemAssignment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRuleItemAssignment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "customRuleItemAssignment_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRuleItemAssignment_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRuleItemAssignment_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRuleItemAssignment_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRuleItemAssignment_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRuleItemAssignment_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRuleItemAssignment_ruleId_fkey"
+ columns: ["ruleId"]
+ isOneToOne: false
+ referencedRelation: "customRule"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ customRuleStorageUnitAssignment: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ ruleId: string
+ storageUnitId: string
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ ruleId: string
+ storageUnitId: string
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ ruleId?: string
+ storageUnitId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "customRuleStorageUnitAssignment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRuleStorageUnitAssignment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRuleStorageUnitAssignment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customRuleStorageUnitAssignment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customRuleStorageUnitAssignment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRuleStorageUnitAssignment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRuleStorageUnitAssignment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRuleStorageUnitAssignment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRuleStorageUnitAssignment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "customRuleStorageUnitAssignment_ruleId_fkey"
+ columns: ["ruleId"]
+ isOneToOne: false
+ referencedRelation: "customRule"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRuleStorageUnitAssignment_storageUnitId_fkey"
+ columns: ["storageUnitId"]
+ isOneToOne: false
+ referencedRelation: "storageUnit"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ customRuleWorkCenterAssignment: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ ruleId: string
+ workCenterId: string
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ ruleId: string
+ workCenterId: string
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ ruleId?: string
+ workCenterId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "customRuleWorkCenterAssignment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRuleWorkCenterAssignment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRuleWorkCenterAssignment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customRuleWorkCenterAssignment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customRuleWorkCenterAssignment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRuleWorkCenterAssignment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRuleWorkCenterAssignment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRuleWorkCenterAssignment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRuleWorkCenterAssignment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "customRuleWorkCenterAssignment_ruleId_fkey"
+ columns: ["ruleId"]
+ isOneToOne: false
+ referencedRelation: "customRule"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRuleWorkCenterAssignment_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "riskRegisters"
+ referencedColumns: ["workCenterId"]
+ },
+ {
+ foreignKeyName: "customRuleWorkCenterAssignment_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenter"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRuleWorkCenterAssignment_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenters"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customRuleWorkCenterAssignment_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ demandActual: {
+ Row: {
+ actualQuantity: number
+ companyId: string
+ createdAt: string
+ createdBy: string
+ itemId: string
+ locationId: string
+ notes: string | null
+ periodId: string
+ sourceType: Database["public"]["Enums"]["demandSourceType"]
+ updatedAt: string
+ updatedBy: string
+ }
+ Insert: {
+ actualQuantity?: number
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ itemId: string
+ locationId: string
+ notes?: string | null
+ periodId: string
+ sourceType: Database["public"]["Enums"]["demandSourceType"]
+ updatedAt?: string
+ updatedBy: string
+ }
+ Update: {
+ actualQuantity?: number
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ itemId?: string
+ locationId?: string
+ notes?: string | null
+ periodId?: string
+ sourceType?: Database["public"]["Enums"]["demandSourceType"]
+ updatedAt?: string
+ updatedBy?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "demandActual_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandActual_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandActual_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "demandActual_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "demandActual_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandActual_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandActual_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandActual_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandActual_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "demandActual_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandActual_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandActual_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandActual_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandActual_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandActual_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandActual_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandActual_periodId_fkey"
+ columns: ["periodId"]
+ isOneToOne: false
+ referencedRelation: "period"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandActual_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandActual_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandActual_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandActual_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandActual_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ demandForecast: {
+ Row: {
+ companyId: string
+ confidence: number | null
+ createdAt: string
+ createdBy: string
+ forecastMethod: string | null
+ forecastQuantity: number
+ itemId: string
+ locationId: string
+ notes: string | null
+ periodId: string
+ updatedAt: string
+ updatedBy: string
+ }
+ Insert: {
+ companyId: string
+ confidence?: number | null
+ createdAt?: string
+ createdBy: string
+ forecastMethod?: string | null
+ forecastQuantity?: number
+ itemId: string
+ locationId: string
+ notes?: string | null
+ periodId: string
+ updatedAt?: string
+ updatedBy: string
+ }
+ Update: {
+ companyId?: string
+ confidence?: number | null
+ createdAt?: string
+ createdBy?: string
+ forecastMethod?: string | null
+ forecastQuantity?: number
+ itemId?: string
+ locationId?: string
+ notes?: string | null
+ periodId?: string
+ updatedAt?: string
+ updatedBy?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "demandForecast_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecast_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecast_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "demandForecast_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "demandForecast_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecast_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecast_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecast_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecast_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "demandForecast_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecast_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecast_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecast_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecast_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecast_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecast_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecast_periodId_fkey"
+ columns: ["periodId"]
+ isOneToOne: false
+ referencedRelation: "period"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecast_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecast_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecast_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecast_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecast_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ demandForecastSource: {
+ Row: {
+ companyId: string
+ createdAt: string
+ demandProjectionId: string | null
+ id: string
+ itemId: string
+ jobId: string | null
+ locationId: string | null
+ parentItemId: string
+ periodId: string
+ quantity: number
+ salesOrderLineId: string | null
+ sourceType: Database["public"]["Enums"]["demandForecastSourceType"]
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ demandProjectionId?: string | null
+ id?: string
+ itemId: string
+ jobId?: string | null
+ locationId?: string | null
+ parentItemId: string
+ periodId: string
+ quantity: number
+ salesOrderLineId?: string | null
+ sourceType: Database["public"]["Enums"]["demandForecastSourceType"]
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ demandProjectionId?: string | null
+ id?: string
+ itemId?: string
+ jobId?: string | null
+ locationId?: string | null
+ parentItemId?: string
+ periodId?: string
+ quantity?: number
+ salesOrderLineId?: string | null
+ sourceType?: Database["public"]["Enums"]["demandForecastSourceType"]
+ }
+ Relationships: [
+ {
+ foreignKeyName: "demandForecastSource_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecastSource_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecastSource_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "demandForecastSource_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "demandForecastSource_demandProjectionId_fkey"
+ columns: ["demandProjectionId"]
+ isOneToOne: false
+ referencedRelation: "demandProjection"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecastSource_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecastSource_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecastSource_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecastSource_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecastSource_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecastSource_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecastSource_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "job"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecastSource_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecastSource_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "openProductionOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecastSource_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecastSource_parentItemId_fkey"
+ columns: ["parentItemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecastSource_parentItemId_fkey"
+ columns: ["parentItemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecastSource_parentItemId_fkey"
+ columns: ["parentItemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecastSource_parentItemId_fkey"
+ columns: ["parentItemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecastSource_parentItemId_fkey"
+ columns: ["parentItemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecastSource_parentItemId_fkey"
+ columns: ["parentItemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecastSource_periodId_fkey"
+ columns: ["periodId"]
+ isOneToOne: false
+ referencedRelation: "period"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecastSource_salesOrderLineId_fkey"
+ columns: ["salesOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "openSalesOrderLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecastSource_salesOrderLineId_fkey"
+ columns: ["salesOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderLine"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandForecastSource_salesOrderLineId_fkey"
+ columns: ["salesOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderLines"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ demandProjection: {
+ Row: {
+ companyId: string
+ confidence: number | null
+ createdAt: string
+ createdBy: string
+ forecastMethod: string | null
+ forecastQuantity: number
+ id: string
+ itemId: string
+ locationId: string
+ notes: string | null
+ periodId: string
+ updatedAt: string
+ updatedBy: string
+ }
+ Insert: {
+ companyId: string
+ confidence?: number | null
+ createdAt?: string
+ createdBy: string
+ forecastMethod?: string | null
+ forecastQuantity?: number
+ id?: string
+ itemId: string
+ locationId: string
+ notes?: string | null
+ periodId: string
+ updatedAt?: string
+ updatedBy: string
+ }
+ Update: {
+ companyId?: string
+ confidence?: number | null
+ createdAt?: string
+ createdBy?: string
+ forecastMethod?: string | null
+ forecastQuantity?: number
+ id?: string
+ itemId?: string
+ locationId?: string
+ notes?: string | null
+ periodId?: string
+ updatedAt?: string
+ updatedBy?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "demandProjection_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandProjection_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandProjection_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "demandProjection_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "demandProjection_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandProjection_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandProjection_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandProjection_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandProjection_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "demandProjection_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandProjection_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandProjection_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandProjection_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandProjection_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandProjection_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandProjection_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandProjection_periodId_fkey"
+ columns: ["periodId"]
+ isOneToOne: false
+ referencedRelation: "period"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandProjection_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandProjection_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandProjection_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandProjection_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "demandProjection_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ department: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ id: string
+ name: string
+ parentDepartmentId: string | null
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ id?: string
+ name: string
+ parentDepartmentId?: string | null
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ id?: string
+ name?: string
+ parentDepartmentId?: string | null
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "department_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "department_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "department_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "department_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "department_parentDepartmentId_fkey"
+ columns: ["parentDepartmentId"]
+ isOneToOne: false
+ referencedRelation: "department"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ depreciationRun: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ depreciationRunId: string
+ id: string
+ periodEnd: string
+ postedAt: string | null
+ postedBy: string | null
+ status: string
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ depreciationRunId: string
+ id?: string
+ periodEnd: string
+ postedAt?: string | null
+ postedBy?: string | null
+ status?: string
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ depreciationRunId?: string
+ id?: string
+ periodEnd?: string
+ postedAt?: string | null
+ postedBy?: string | null
+ status?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "depreciationRun_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "depreciationRun_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "depreciationRun_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "depreciationRun_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "depreciationRun_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "depreciationRun_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "depreciationRun_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "depreciationRun_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "depreciationRun_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "depreciationRun_postedBy_fkey"
+ columns: ["postedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "depreciationRun_postedBy_fkey"
+ columns: ["postedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "depreciationRun_postedBy_fkey"
+ columns: ["postedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "depreciationRun_postedBy_fkey"
+ columns: ["postedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "depreciationRun_postedBy_fkey"
+ columns: ["postedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ depreciationRunLine: {
+ Row: {
+ amount: number
+ companyId: string
+ depreciationRunId: string
+ fixedAssetId: string
+ id: string
+ journalId: string | null
+ taxAmount: number | null
+ }
+ Insert: {
+ amount: number
+ companyId: string
+ depreciationRunId: string
+ fixedAssetId: string
+ id?: string
+ journalId?: string | null
+ taxAmount?: number | null
+ }
+ Update: {
+ amount?: number
+ companyId?: string
+ depreciationRunId?: string
+ fixedAssetId?: string
+ id?: string
+ journalId?: string | null
+ taxAmount?: number | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "depreciationRunLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "depreciationRunLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "depreciationRunLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "depreciationRunLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "depreciationRunLine_depreciationRunId_fkey"
+ columns: ["depreciationRunId"]
+ isOneToOne: false
+ referencedRelation: "depreciationRun"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "depreciationRunLine_fixedAssetId_fkey"
+ columns: ["fixedAssetId"]
+ isOneToOne: false
+ referencedRelation: "fixedAsset"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "depreciationRunLine_journalId_fkey"
+ columns: ["journalId"]
+ isOneToOne: false
+ referencedRelation: "journal"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "depreciationRunLine_journalId_fkey"
+ columns: ["journalId"]
+ isOneToOne: false
+ referencedRelation: "journalEntries"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ dimension: {
+ Row: {
+ active: boolean
+ companyGroupId: string
+ createdAt: string
+ createdBy: string
+ entityType: Database["public"]["Enums"]["dimensionEntityType"]
+ id: string
+ name: string
+ required: boolean
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ active?: boolean
+ companyGroupId: string
+ createdAt?: string
+ createdBy: string
+ entityType?: Database["public"]["Enums"]["dimensionEntityType"]
+ id?: string
+ name: string
+ required?: boolean
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ active?: boolean
+ companyGroupId?: string
+ createdAt?: string
+ createdBy?: string
+ entityType?: Database["public"]["Enums"]["dimensionEntityType"]
+ id?: string
+ name?: string
+ required?: boolean
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "dimension_companyGroupId_fkey"
+ columns: ["companyGroupId"]
+ isOneToOne: false
+ referencedRelation: "companyGroup"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "dimension_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "dimension_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "dimension_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "dimension_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "dimension_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "dimension_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "dimension_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "dimension_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "dimension_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "dimension_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ dimensionValue: {
+ Row: {
+ companyGroupId: string
+ createdAt: string
+ createdBy: string
+ dimensionId: string
+ id: string
+ name: string
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyGroupId: string
+ createdAt?: string
+ createdBy: string
+ dimensionId: string
+ id?: string
+ name: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyGroupId?: string
+ createdAt?: string
+ createdBy?: string
+ dimensionId?: string
+ id?: string
+ name?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "dimensionValue_companyGroupId_fkey"
+ columns: ["companyGroupId"]
+ isOneToOne: false
+ referencedRelation: "companyGroup"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "dimensionValue_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "dimensionValue_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "dimensionValue_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "dimensionValue_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "dimensionValue_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "dimensionValue_dimensionId_fkey"
+ columns: ["dimensionId"]
+ isOneToOne: false
+ referencedRelation: "dimension"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "dimensionValue_dimensionId_fkey"
+ columns: ["dimensionId"]
+ isOneToOne: false
+ referencedRelation: "dimensionValues"
+ referencedColumns: ["dimensionId"]
+ },
+ {
+ foreignKeyName: "dimensionValue_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "dimensionValue_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "dimensionValue_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "dimensionValue_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "dimensionValue_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ document: {
+ Row: {
+ active: boolean
+ companyId: string
+ createdAt: string
+ createdBy: string
+ description: string | null
+ extension: string | null
+ id: string
+ name: string
+ path: string
+ readGroups: string[] | null
+ size: number
+ sourceDocument:
+ | Database["public"]["Enums"]["documentSourceType"]
+ | null
+ sourceDocumentId: string | null
+ type: Database["public"]["Enums"]["documentType"]
+ updatedAt: string | null
+ updatedBy: string | null
+ writeGroups: string[] | null
+ }
+ Insert: {
+ active?: boolean
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ description?: string | null
+ extension?: string | null
+ id?: string
+ name: string
+ path: string
+ readGroups?: string[] | null
+ size: number
+ sourceDocument?:
+ | Database["public"]["Enums"]["documentSourceType"]
+ | null
+ sourceDocumentId?: string | null
+ type: Database["public"]["Enums"]["documentType"]
+ updatedAt?: string | null
+ updatedBy?: string | null
+ writeGroups?: string[] | null
+ }
+ Update: {
+ active?: boolean
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ description?: string | null
+ extension?: string | null
+ id?: string
+ name?: string
+ path?: string
+ readGroups?: string[] | null
+ size?: number
+ sourceDocument?:
+ | Database["public"]["Enums"]["documentSourceType"]
+ | null
+ sourceDocumentId?: string | null
+ type?: Database["public"]["Enums"]["documentType"]
+ updatedAt?: string | null
+ updatedBy?: string | null
+ writeGroups?: string[] | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "document_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "document_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "document_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "document_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "document_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "document_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "document_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "document_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "document_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "document_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ documentFavorite: {
+ Row: {
+ documentId: string
+ userId: string
+ }
+ Insert: {
+ documentId: string
+ userId: string
+ }
+ Update: {
+ documentId?: string
+ userId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "documentFavorites_documentId_fkey"
+ columns: ["documentId"]
+ isOneToOne: false
+ referencedRelation: "document"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "documentFavorites_documentId_fkey"
+ columns: ["documentId"]
+ isOneToOne: false
+ referencedRelation: "documents"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "documentFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "documentFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "documentFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "documentFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "documentFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ documentLabel: {
+ Row: {
+ documentId: string
+ label: string
+ userId: string
+ }
+ Insert: {
+ documentId: string
+ label: string
+ userId: string
+ }
+ Update: {
+ documentId?: string
+ label?: string
+ userId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "documentLabels_documentId_fkey"
+ columns: ["documentId"]
+ isOneToOne: false
+ referencedRelation: "document"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "documentLabels_documentId_fkey"
+ columns: ["documentId"]
+ isOneToOne: false
+ referencedRelation: "documents"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "documentLabels_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "documentLabels_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "documentLabels_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "documentLabels_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "documentLabels_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ documentTransaction: {
+ Row: {
+ createdAt: string
+ documentId: string
+ id: string
+ type: Database["public"]["Enums"]["documentTransactionType"]
+ userId: string
+ }
+ Insert: {
+ createdAt?: string
+ documentId: string
+ id?: string
+ type: Database["public"]["Enums"]["documentTransactionType"]
+ userId: string
+ }
+ Update: {
+ createdAt?: string
+ documentId?: string
+ id?: string
+ type?: Database["public"]["Enums"]["documentTransactionType"]
+ userId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "documentTransaction_documentId_fkey"
+ columns: ["documentId"]
+ isOneToOne: false
+ referencedRelation: "document"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "documentTransaction_documentId_fkey"
+ columns: ["documentId"]
+ isOneToOne: false
+ referencedRelation: "documents"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "documentTransaction_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "documentTransaction_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "documentTransaction_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "documentTransaction_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "documentTransaction_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ employee: {
+ Row: {
+ active: boolean
+ companyId: string
+ employeeTypeId: string
+ id: string
+ pin: string | null
+ }
+ Insert: {
+ active?: boolean
+ companyId: string
+ employeeTypeId: string
+ id?: string
+ pin?: string | null
+ }
+ Update: {
+ active?: boolean
+ companyId?: string
+ employeeTypeId?: string
+ id?: string
+ pin?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "employee_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employee_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employee_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "employee_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "employee_employeeTypeId_fkey"
+ columns: ["employeeTypeId"]
+ isOneToOne: false
+ referencedRelation: "employeeType"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ employeeAbility: {
+ Row: {
+ abilityId: string
+ active: boolean
+ companyId: string
+ employeeId: string
+ id: string
+ lastTrainingDate: string | null
+ trainingCompleted: boolean | null
+ trainingDays: number
+ }
+ Insert: {
+ abilityId: string
+ active?: boolean
+ companyId: string
+ employeeId: string
+ id?: string
+ lastTrainingDate?: string | null
+ trainingCompleted?: boolean | null
+ trainingDays?: number
+ }
+ Update: {
+ abilityId?: string
+ active?: boolean
+ companyId?: string
+ employeeId?: string
+ id?: string
+ lastTrainingDate?: string | null
+ trainingCompleted?: boolean | null
+ trainingDays?: number
+ }
+ Relationships: [
+ {
+ foreignKeyName: "employeeAbilities_abilityId_fkey"
+ columns: ["abilityId"]
+ isOneToOne: false
+ referencedRelation: "ability"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeAbilities_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeAbilities_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeAbilities_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "employeeAbilities_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "employeeAbilities_employeeId_fkey"
+ columns: ["employeeId", "companyId"]
+ isOneToOne: false
+ referencedRelation: "employee"
+ referencedColumns: ["id", "companyId"]
+ },
+ {
+ foreignKeyName: "employeeAbility_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeAbility_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeAbility_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "employeeAbility_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ ]
+ }
+ employeeJob: {
+ Row: {
+ companyId: string
+ customFields: Json | null
+ departmentId: string | null
+ id: string
+ locationId: string | null
+ managerId: string | null
+ shiftId: string | null
+ startDate: string | null
+ tags: string[] | null
+ title: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ customFields?: Json | null
+ departmentId?: string | null
+ id: string
+ locationId?: string | null
+ managerId?: string | null
+ shiftId?: string | null
+ startDate?: string | null
+ tags?: string[] | null
+ title?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ customFields?: Json | null
+ departmentId?: string | null
+ id?: string
+ locationId?: string | null
+ managerId?: string | null
+ shiftId?: string | null
+ startDate?: string | null
+ tags?: string[] | null
+ title?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "employeeJob_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeJob_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeJob_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "employeeJob_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "employeeJob_departmentId_fkey"
+ columns: ["departmentId"]
+ isOneToOne: false
+ referencedRelation: "department"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeJob_id_fkey"
+ columns: ["id"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeJob_id_fkey"
+ columns: ["id"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeJob_id_fkey"
+ columns: ["id"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeJob_id_fkey"
+ columns: ["id"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeJob_id_fkey"
+ columns: ["id"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "employeeJob_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeJob_managerId_fkey"
+ columns: ["managerId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeJob_managerId_fkey"
+ columns: ["managerId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeJob_managerId_fkey"
+ columns: ["managerId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeJob_managerId_fkey"
+ columns: ["managerId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeJob_managerId_fkey"
+ columns: ["managerId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "employeeJob_shiftId_fkey"
+ columns: ["shiftId"]
+ isOneToOne: false
+ referencedRelation: "shift"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeJob_shiftId_fkey"
+ columns: ["shiftId"]
+ isOneToOne: false
+ referencedRelation: "shifts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeJob_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeJob_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeJob_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeJob_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeJob_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ employeeShift: {
+ Row: {
+ employeeId: string
+ id: string
+ shiftId: string
+ }
+ Insert: {
+ employeeId: string
+ id?: string
+ shiftId: string
+ }
+ Update: {
+ employeeId?: string
+ id?: string
+ shiftId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "employeeShift_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeShift_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeShift_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeShift_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeShift_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "employeeShift_shiftId_fkey"
+ columns: ["shiftId"]
+ isOneToOne: false
+ referencedRelation: "shift"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeShift_shiftId_fkey"
+ columns: ["shiftId"]
+ isOneToOne: false
+ referencedRelation: "shifts"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ employeeType: {
+ Row: {
+ companyId: string
+ createdAt: string
+ id: string
+ name: string
+ protected: boolean
+ systemType:
+ | Database["public"]["Enums"]["employeeTypeSystemType"]
+ | null
+ updatedAt: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ id?: string
+ name: string
+ protected?: boolean
+ systemType?:
+ | Database["public"]["Enums"]["employeeTypeSystemType"]
+ | null
+ updatedAt?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ id?: string
+ name?: string
+ protected?: boolean
+ systemType?:
+ | Database["public"]["Enums"]["employeeTypeSystemType"]
+ | null
+ updatedAt?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "employeeType_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeType_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeType_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "employeeType_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ ]
+ }
+ employeeTypePermission: {
+ Row: {
+ create: string[]
+ createdAt: string
+ delete: string[]
+ employeeTypeId: string
+ module: Database["public"]["Enums"]["module"]
+ update: string[]
+ updatedAt: string | null
+ view: string[]
+ }
+ Insert: {
+ create?: string[]
+ createdAt?: string
+ delete?: string[]
+ employeeTypeId: string
+ module: Database["public"]["Enums"]["module"]
+ update?: string[]
+ updatedAt?: string | null
+ view?: string[]
+ }
+ Update: {
+ create?: string[]
+ createdAt?: string
+ delete?: string[]
+ employeeTypeId?: string
+ module?: Database["public"]["Enums"]["module"]
+ update?: string[]
+ updatedAt?: string | null
+ view?: string[]
+ }
+ Relationships: [
+ {
+ foreignKeyName: "employeeTypePermission_new_employeeTypeId_fkey"
+ columns: ["employeeTypeId"]
+ isOneToOne: false
+ referencedRelation: "employeeType"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ eventSystemSubscription: {
+ Row: {
+ active: boolean | null
+ companyId: string
+ config: Json
+ createdAt: string | null
+ filter: Json | null
+ handlerType: string
+ id: string
+ name: string
+ operations: string[]
+ table: string
+ }
+ Insert: {
+ active?: boolean | null
+ companyId: string
+ config?: Json
+ createdAt?: string | null
+ filter?: Json | null
+ handlerType: string
+ id?: string
+ name: string
+ operations: string[]
+ table: string
+ }
+ Update: {
+ active?: boolean | null
+ companyId?: string
+ config?: Json
+ createdAt?: string | null
+ filter?: Json | null
+ handlerType?: string
+ id?: string
+ name?: string
+ operations?: string[]
+ table?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "eventSystemSubscription_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "eventSystemSubscription_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "eventSystemSubscription_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "eventSystemSubscription_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ ]
+ }
+ exchangeRateHistory: {
+ Row: {
+ companyGroupId: string
+ createdAt: string
+ createdBy: string
+ currencyCode: string
+ effectiveDate: string
+ id: string
+ rate: number
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyGroupId: string
+ createdAt?: string
+ createdBy: string
+ currencyCode: string
+ effectiveDate: string
+ id?: string
+ rate: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyGroupId?: string
+ createdAt?: string
+ createdBy?: string
+ currencyCode?: string
+ effectiveDate?: string
+ id?: string
+ rate?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "exchangeRateHistory_companyGroupId_fkey"
+ columns: ["companyGroupId"]
+ isOneToOne: false
+ referencedRelation: "companyGroup"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "exchangeRateHistory_currencyCode_fkey"
+ columns: ["currencyCode"]
+ isOneToOne: false
+ referencedRelation: "currencyCode"
+ referencedColumns: ["code"]
+ },
+ ]
+ }
+ externalIntegrationMapping: {
+ Row: {
+ allowDuplicateExternalId: boolean
+ companyId: string
+ createdAt: string
+ createdBy: string | null
+ entityId: string
+ entityType: string
+ externalId: string | null
+ id: string
+ integration: string
+ lastSyncedAt: string | null
+ metadata: Json | null
+ remoteUpdatedAt: string | null
+ updatedAt: string
+ }
+ Insert: {
+ allowDuplicateExternalId?: boolean
+ companyId: string
+ createdAt?: string
+ createdBy?: string | null
+ entityId: string
+ entityType: string
+ externalId?: string | null
+ id?: string
+ integration: string
+ lastSyncedAt?: string | null
+ metadata?: Json | null
+ remoteUpdatedAt?: string | null
+ updatedAt?: string
+ }
+ Update: {
+ allowDuplicateExternalId?: boolean
+ companyId?: string
+ createdAt?: string
+ createdBy?: string | null
+ entityId?: string
+ entityType?: string
+ externalId?: string | null
+ id?: string
+ integration?: string
+ lastSyncedAt?: string | null
+ metadata?: Json | null
+ remoteUpdatedAt?: string | null
+ updatedAt?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "externalIntegrationMapping_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "externalIntegrationMapping_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "externalIntegrationMapping_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "externalIntegrationMapping_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "externalIntegrationMapping_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "externalIntegrationMapping_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "externalIntegrationMapping_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "externalIntegrationMapping_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "externalIntegrationMapping_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ externalLink: {
+ Row: {
+ companyId: string
+ createdAt: string
+ customerId: string | null
+ documentId: string
+ documentType: Database["public"]["Enums"]["externalLinkDocumentType"]
+ expiresAt: string | null
+ id: string
+ supplierId: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ customerId?: string | null
+ documentId: string
+ documentType: Database["public"]["Enums"]["externalLinkDocumentType"]
+ expiresAt?: string | null
+ id?: string
+ supplierId?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ customerId?: string | null
+ documentId?: string
+ documentType?: Database["public"]["Enums"]["externalLinkDocumentType"]
+ expiresAt?: string | null
+ id?: string
+ supplierId?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "externalLink_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "externalLink_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "externalLink_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "externalLink_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "externalLink_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "externalLinks_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "externalLinks_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "externalLinks_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "externalLinks_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "externalLinks_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "externalLinks_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "externalLinks_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ feedback: {
+ Row: {
+ attachmentPath: string | null
+ feedback: string
+ id: string
+ location: string
+ userId: string | null
+ }
+ Insert: {
+ attachmentPath?: string | null
+ feedback: string
+ id?: string
+ location: string
+ userId?: string | null
+ }
+ Update: {
+ attachmentPath?: string | null
+ feedback?: string
+ id?: string
+ location?: string
+ userId?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "feedback_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "feedback_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "feedback_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "feedback_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "feedback_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ fiscalYearSettings: {
+ Row: {
+ companyId: string
+ startMonth: Database["public"]["Enums"]["month"]
+ taxStartMonth: Database["public"]["Enums"]["month"]
+ updatedBy: string
+ }
+ Insert: {
+ companyId: string
+ startMonth?: Database["public"]["Enums"]["month"]
+ taxStartMonth?: Database["public"]["Enums"]["month"]
+ updatedBy: string
+ }
+ Update: {
+ companyId?: string
+ startMonth?: Database["public"]["Enums"]["month"]
+ taxStartMonth?: Database["public"]["Enums"]["month"]
+ updatedBy?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "fiscalYearSettings_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: true
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fiscalYearSettings_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: true
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fiscalYearSettings_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: true
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "fiscalYearSettings_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: true
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "fiscalYearSettings_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fiscalYearSettings_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fiscalYearSettings_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fiscalYearSettings_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fiscalYearSettings_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ fixedAsset: {
+ Row: {
+ accumulatedDepreciation: number
+ accumulatedTaxDepreciation: number
+ acquisitionCost: number
+ acquisitionDate: string | null
+ assetLifetimeUsage: number | null
+ bonusDepreciationPercent: number | null
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ depreciationMethod: Database["public"]["Enums"]["depreciationMethod"]
+ depreciationStartDate: string | null
+ description: string | null
+ disposalDate: string | null
+ disposalMethod: Database["public"]["Enums"]["disposalMethod"] | null
+ fixedAssetClassId: string
+ fixedAssetId: string
+ id: string
+ locationId: string | null
+ macrsConvention: Database["public"]["Enums"]["macrsConvention"] | null
+ macrsPropertyClass:
+ | Database["public"]["Enums"]["macrsPropertyClass"]
+ | null
+ name: string
+ notes: Json | null
+ residualValuePercent: number
+ saleProceeds: number | null
+ serialNumber: string | null
+ status: Database["public"]["Enums"]["fixedAssetStatus"]
+ taxDepreciationMethod:
+ | Database["public"]["Enums"]["taxDepreciationMethod"]
+ | null
+ taxResidualValuePercent: number | null
+ taxUsefulLifeMonths: number | null
+ updatedAt: string | null
+ updatedBy: string | null
+ usefulLifeMonths: number
+ }
+ Insert: {
+ accumulatedDepreciation?: number
+ accumulatedTaxDepreciation?: number
+ acquisitionCost?: number
+ acquisitionDate?: string | null
+ assetLifetimeUsage?: number | null
+ bonusDepreciationPercent?: number | null
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ depreciationMethod?: Database["public"]["Enums"]["depreciationMethod"]
+ depreciationStartDate?: string | null
+ description?: string | null
+ disposalDate?: string | null
+ disposalMethod?: Database["public"]["Enums"]["disposalMethod"] | null
+ fixedAssetClassId: string
+ fixedAssetId: string
+ id?: string
+ locationId?: string | null
+ macrsConvention?:
+ | Database["public"]["Enums"]["macrsConvention"]
+ | null
+ macrsPropertyClass?:
+ | Database["public"]["Enums"]["macrsPropertyClass"]
+ | null
+ name: string
+ notes?: Json | null
+ residualValuePercent?: number
+ saleProceeds?: number | null
+ serialNumber?: string | null
+ status?: Database["public"]["Enums"]["fixedAssetStatus"]
+ taxDepreciationMethod?:
+ | Database["public"]["Enums"]["taxDepreciationMethod"]
+ | null
+ taxResidualValuePercent?: number | null
+ taxUsefulLifeMonths?: number | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ usefulLifeMonths?: number
+ }
+ Update: {
+ accumulatedDepreciation?: number
+ accumulatedTaxDepreciation?: number
+ acquisitionCost?: number
+ acquisitionDate?: string | null
+ assetLifetimeUsage?: number | null
+ bonusDepreciationPercent?: number | null
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ depreciationMethod?: Database["public"]["Enums"]["depreciationMethod"]
+ depreciationStartDate?: string | null
+ description?: string | null
+ disposalDate?: string | null
+ disposalMethod?: Database["public"]["Enums"]["disposalMethod"] | null
+ fixedAssetClassId?: string
+ fixedAssetId?: string
+ id?: string
+ locationId?: string | null
+ macrsConvention?:
+ | Database["public"]["Enums"]["macrsConvention"]
+ | null
+ macrsPropertyClass?:
+ | Database["public"]["Enums"]["macrsPropertyClass"]
+ | null
+ name?: string
+ notes?: Json | null
+ residualValuePercent?: number
+ saleProceeds?: number | null
+ serialNumber?: string | null
+ status?: Database["public"]["Enums"]["fixedAssetStatus"]
+ taxDepreciationMethod?:
+ | Database["public"]["Enums"]["taxDepreciationMethod"]
+ | null
+ taxResidualValuePercent?: number | null
+ taxUsefulLifeMonths?: number | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ usefulLifeMonths?: number
+ }
+ Relationships: [
+ {
+ foreignKeyName: "fixedAsset_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAsset_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAsset_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "fixedAsset_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "fixedAsset_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAsset_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAsset_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAsset_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAsset_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "fixedAsset_fixedAssetClassId_fkey"
+ columns: ["fixedAssetClassId"]
+ isOneToOne: false
+ referencedRelation: "fixedAssetClass"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAsset_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAsset_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAsset_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAsset_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAsset_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAsset_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ fixedAssetClass: {
+ Row: {
+ accumulatedDepreciationAccountId: string
+ assetAccountId: string
+ bonusDepreciationPercent: number | null
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ depreciationExpenseAccountId: string
+ depreciationMethod: Database["public"]["Enums"]["depreciationMethod"]
+ description: string | null
+ disposalAccountId: string
+ id: string
+ macrsConvention: Database["public"]["Enums"]["macrsConvention"] | null
+ macrsPropertyClass:
+ | Database["public"]["Enums"]["macrsPropertyClass"]
+ | null
+ name: string
+ residualValuePercent: number
+ taxDepreciationMethod:
+ | Database["public"]["Enums"]["taxDepreciationMethod"]
+ | null
+ taxResidualValuePercent: number | null
+ taxUsefulLifeMonths: number | null
+ updatedAt: string | null
+ updatedBy: string | null
+ usefulLifeMonths: number
+ writeDownAccountId: string
+ writeOffAccountId: string
+ }
+ Insert: {
+ accumulatedDepreciationAccountId: string
+ assetAccountId: string
+ bonusDepreciationPercent?: number | null
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ depreciationExpenseAccountId: string
+ depreciationMethod?: Database["public"]["Enums"]["depreciationMethod"]
+ description?: string | null
+ disposalAccountId: string
+ id?: string
+ macrsConvention?:
+ | Database["public"]["Enums"]["macrsConvention"]
+ | null
+ macrsPropertyClass?:
+ | Database["public"]["Enums"]["macrsPropertyClass"]
+ | null
+ name: string
+ residualValuePercent?: number
+ taxDepreciationMethod?:
+ | Database["public"]["Enums"]["taxDepreciationMethod"]
+ | null
+ taxResidualValuePercent?: number | null
+ taxUsefulLifeMonths?: number | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ usefulLifeMonths?: number
+ writeDownAccountId: string
+ writeOffAccountId: string
+ }
+ Update: {
+ accumulatedDepreciationAccountId?: string
+ assetAccountId?: string
+ bonusDepreciationPercent?: number | null
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ depreciationExpenseAccountId?: string
+ depreciationMethod?: Database["public"]["Enums"]["depreciationMethod"]
+ description?: string | null
+ disposalAccountId?: string
+ id?: string
+ macrsConvention?:
+ | Database["public"]["Enums"]["macrsConvention"]
+ | null
+ macrsPropertyClass?:
+ | Database["public"]["Enums"]["macrsPropertyClass"]
+ | null
+ name?: string
+ residualValuePercent?: number
+ taxDepreciationMethod?:
+ | Database["public"]["Enums"]["taxDepreciationMethod"]
+ | null
+ taxResidualValuePercent?: number | null
+ taxUsefulLifeMonths?: number | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ usefulLifeMonths?: number
+ writeDownAccountId?: string
+ writeOffAccountId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "fixedAssetClass_accumulatedDepreciationAccountId_fkey"
+ columns: ["accumulatedDepreciationAccountId"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetClass_accumulatedDepreciationAccountId_fkey"
+ columns: ["accumulatedDepreciationAccountId"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetClass_assetAccountId_fkey"
+ columns: ["assetAccountId"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetClass_assetAccountId_fkey"
+ columns: ["assetAccountId"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetClass_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetClass_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetClass_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "fixedAssetClass_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "fixedAssetClass_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetClass_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetClass_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetClass_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetClass_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "fixedAssetClass_depreciationExpenseAccountId_fkey"
+ columns: ["depreciationExpenseAccountId"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetClass_depreciationExpenseAccountId_fkey"
+ columns: ["depreciationExpenseAccountId"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetClass_disposalAccountId_fkey"
+ columns: ["disposalAccountId"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetClass_disposalAccountId_fkey"
+ columns: ["disposalAccountId"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetClass_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetClass_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetClass_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetClass_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetClass_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "fixedAssetClass_writeDownAccountId_fkey"
+ columns: ["writeDownAccountId"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetClass_writeDownAccountId_fkey"
+ columns: ["writeDownAccountId"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetClass_writeOffAccountId_fkey"
+ columns: ["writeOffAccountId"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetClass_writeOffAccountId_fkey"
+ columns: ["writeOffAccountId"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ fixedAssetDisposal: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ disposalDate: string
+ disposalMethod: Database["public"]["Enums"]["disposalMethod"]
+ fixedAssetId: string
+ gainLoss: number
+ id: string
+ journalId: string | null
+ netBookValueAtDisposal: number
+ saleProceeds: number
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ disposalDate: string
+ disposalMethod: Database["public"]["Enums"]["disposalMethod"]
+ fixedAssetId: string
+ gainLoss: number
+ id?: string
+ journalId?: string | null
+ netBookValueAtDisposal: number
+ saleProceeds?: number
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ disposalDate?: string
+ disposalMethod?: Database["public"]["Enums"]["disposalMethod"]
+ fixedAssetId?: string
+ gainLoss?: number
+ id?: string
+ journalId?: string | null
+ netBookValueAtDisposal?: number
+ saleProceeds?: number
+ }
+ Relationships: [
+ {
+ foreignKeyName: "fixedAssetDisposal_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetDisposal_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetDisposal_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "fixedAssetDisposal_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "fixedAssetDisposal_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetDisposal_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetDisposal_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetDisposal_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetDisposal_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "fixedAssetDisposal_fixedAssetId_fkey"
+ columns: ["fixedAssetId"]
+ isOneToOne: false
+ referencedRelation: "fixedAsset"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetDisposal_journalId_fkey"
+ columns: ["journalId"]
+ isOneToOne: false
+ referencedRelation: "journal"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetDisposal_journalId_fkey"
+ columns: ["journalId"]
+ isOneToOne: false
+ referencedRelation: "journalEntries"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ fixedAssetUsageLog: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ fixedAssetId: string
+ id: string
+ periodEnd: string
+ periodStart: string
+ unitsProduced: number
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ fixedAssetId: string
+ id?: string
+ periodEnd: string
+ periodStart: string
+ unitsProduced: number
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ fixedAssetId?: string
+ id?: string
+ periodEnd?: string
+ periodStart?: string
+ unitsProduced?: number
+ }
+ Relationships: [
+ {
+ foreignKeyName: "fixedAssetUsageLog_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetUsageLog_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetUsageLog_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "fixedAssetUsageLog_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "fixedAssetUsageLog_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetUsageLog_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetUsageLog_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetUsageLog_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixedAssetUsageLog_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "fixedAssetUsageLog_fixedAssetId_fkey"
+ columns: ["fixedAssetId"]
+ isOneToOne: false
+ referencedRelation: "fixedAsset"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ fixture: {
+ Row: {
+ approved: boolean
+ approvedBy: string | null
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customerId: string | null
+ customFields: Json | null
+ id: string
+ itemId: string | null
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ approved?: boolean
+ approvedBy?: string | null
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customerId?: string | null
+ customFields?: Json | null
+ id: string
+ itemId?: string | null
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ approved?: boolean
+ approvedBy?: string | null
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customerId?: string | null
+ customFields?: Json | null
+ id?: string
+ itemId?: string | null
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "fixture_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixture_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixture_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixture_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixture_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "fixture_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixture_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixture_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "fixture_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "fixture_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixture_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixture_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixture_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixture_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "fixture_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixture_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixture_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixture_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixture_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixture_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixture_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixture_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixture_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixture_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixture_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixture_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixture_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fixture_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ fulfillment: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ jobId: string | null
+ quantity: number
+ salesOrderLineId: string
+ type: Database["public"]["Enums"]["fulfillmentType"]
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ jobId?: string | null
+ quantity: number
+ salesOrderLineId: string
+ type: Database["public"]["Enums"]["fulfillmentType"]
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ jobId?: string | null
+ quantity?: number
+ salesOrderLineId?: string
+ type?: Database["public"]["Enums"]["fulfillmentType"]
+ }
+ Relationships: [
+ {
+ foreignKeyName: "fulfillment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fulfillment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fulfillment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "fulfillment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "fulfillment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fulfillment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fulfillment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fulfillment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fulfillment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "fulfillment_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "job"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fulfillment_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fulfillment_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "openProductionOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fulfillment_salesOrderLineId_fkey"
+ columns: ["salesOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "openSalesOrderLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fulfillment_salesOrderLineId_fkey"
+ columns: ["salesOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderLine"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "fulfillment_salesOrderLineId_fkey"
+ columns: ["salesOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderLines"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ gauge: {
+ Row: {
+ calibrationIntervalInMonths: number
+ companyId: string | null
+ createdAt: string
+ createdBy: string
+ customFields: Json
+ dateAcquired: string | null
+ description: string | null
+ gaugeCalibrationStatus: Database["public"]["Enums"]["gaugeCalibrationStatus"]
+ gaugeId: string
+ gaugeRole: Database["public"]["Enums"]["gaugeRole"]
+ gaugeStatus: Database["public"]["Enums"]["gaugeStatus"]
+ gaugeTypeId: string
+ id: string
+ lastCalibrationDate: string | null
+ lastCalibrationStatus: Database["public"]["Enums"]["gaugeCalibrationStatus"]
+ locationId: string | null
+ modelNumber: string | null
+ nextCalibrationDate: string | null
+ serialNumber: string | null
+ storageUnitId: string | null
+ supplierId: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ calibrationIntervalInMonths?: number
+ companyId?: string | null
+ createdAt?: string
+ createdBy: string
+ customFields?: Json
+ dateAcquired?: string | null
+ description?: string | null
+ gaugeCalibrationStatus?: Database["public"]["Enums"]["gaugeCalibrationStatus"]
+ gaugeId: string
+ gaugeRole?: Database["public"]["Enums"]["gaugeRole"]
+ gaugeStatus?: Database["public"]["Enums"]["gaugeStatus"]
+ gaugeTypeId: string
+ id?: string
+ lastCalibrationDate?: string | null
+ lastCalibrationStatus?: Database["public"]["Enums"]["gaugeCalibrationStatus"]
+ locationId?: string | null
+ modelNumber?: string | null
+ nextCalibrationDate?: string | null
+ serialNumber?: string | null
+ storageUnitId?: string | null
+ supplierId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ calibrationIntervalInMonths?: number
+ companyId?: string | null
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json
+ dateAcquired?: string | null
+ description?: string | null
+ gaugeCalibrationStatus?: Database["public"]["Enums"]["gaugeCalibrationStatus"]
+ gaugeId?: string
+ gaugeRole?: Database["public"]["Enums"]["gaugeRole"]
+ gaugeStatus?: Database["public"]["Enums"]["gaugeStatus"]
+ gaugeTypeId?: string
+ id?: string
+ lastCalibrationDate?: string | null
+ lastCalibrationStatus?: Database["public"]["Enums"]["gaugeCalibrationStatus"]
+ locationId?: string | null
+ modelNumber?: string | null
+ nextCalibrationDate?: string | null
+ serialNumber?: string | null
+ storageUnitId?: string | null
+ supplierId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "gauge_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gauge_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gauge_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "gauge_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "gauge_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gauge_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gauge_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gauge_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gauge_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "gauge_gaugeTypeId_fkey"
+ columns: ["gaugeTypeId"]
+ isOneToOne: false
+ referencedRelation: "gaugeType"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gauge_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gauge_storageUnitId_fkey"
+ columns: ["storageUnitId"]
+ isOneToOne: false
+ referencedRelation: "storageUnit"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gauge_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "gauge_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "gauge_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gauge_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gauge_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gauge_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gauge_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gauge_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gauge_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gauge_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ gaugeCalibrationRecord: {
+ Row: {
+ approvedBy: string | null
+ calibrationAttempts: Json | null
+ companyId: string | null
+ createdAt: string
+ createdBy: string
+ customFields: Json
+ dateCalibrated: string
+ gaugeId: string
+ humidity: number | null
+ id: string
+ inspectionStatus: Database["public"]["Enums"]["inspectionStatus"]
+ measurementStandard: string | null
+ notes: Json
+ requiresAction: boolean
+ requiresAdjustment: boolean
+ requiresRepair: boolean
+ supplierId: string | null
+ temperature: number | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ approvedBy?: string | null
+ calibrationAttempts?: Json | null
+ companyId?: string | null
+ createdAt?: string
+ createdBy: string
+ customFields?: Json
+ dateCalibrated: string
+ gaugeId: string
+ humidity?: number | null
+ id?: string
+ inspectionStatus: Database["public"]["Enums"]["inspectionStatus"]
+ measurementStandard?: string | null
+ notes?: Json
+ requiresAction?: boolean
+ requiresAdjustment?: boolean
+ requiresRepair?: boolean
+ supplierId?: string | null
+ temperature?: number | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ approvedBy?: string | null
+ calibrationAttempts?: Json | null
+ companyId?: string | null
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json
+ dateCalibrated?: string
+ gaugeId?: string
+ humidity?: number | null
+ id?: string
+ inspectionStatus?: Database["public"]["Enums"]["inspectionStatus"]
+ measurementStandard?: string | null
+ notes?: Json
+ requiresAction?: boolean
+ requiresAdjustment?: boolean
+ requiresRepair?: boolean
+ supplierId?: string | null
+ temperature?: number | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "gaugeCalibrationRecord_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_gaugeId_fkey"
+ columns: ["gaugeId"]
+ isOneToOne: false
+ referencedRelation: "gauge"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_gaugeId_fkey"
+ columns: ["gaugeId"]
+ isOneToOne: false
+ referencedRelation: "gauges"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ gaugeType: {
+ Row: {
+ companyId: string | null
+ createdAt: string
+ createdBy: string
+ customFields: Json
+ id: string
+ name: string
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId?: string | null
+ createdAt?: string
+ createdBy: string
+ customFields?: Json
+ id?: string
+ name: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string | null
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json
+ id?: string
+ name?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "gaugeType_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeType_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeType_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "gaugeType_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "gaugeType_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeType_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeType_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeType_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeType_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "gaugeType_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeType_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeType_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeType_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeType_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ group: {
+ Row: {
+ companyId: string | null
+ createdAt: string
+ id: string
+ isCustomerOrgGroup: boolean
+ isCustomerTypeGroup: boolean
+ isEmployeeTypeGroup: boolean
+ isIdentityGroup: boolean
+ isSupplierOrgGroup: boolean
+ isSupplierTypeGroup: boolean
+ name: string
+ updatedAt: string | null
+ }
+ Insert: {
+ companyId?: string | null
+ createdAt?: string
+ id?: string
+ isCustomerOrgGroup?: boolean
+ isCustomerTypeGroup?: boolean
+ isEmployeeTypeGroup?: boolean
+ isIdentityGroup?: boolean
+ isSupplierOrgGroup?: boolean
+ isSupplierTypeGroup?: boolean
+ name: string
+ updatedAt?: string | null
+ }
+ Update: {
+ companyId?: string | null
+ createdAt?: string
+ id?: string
+ isCustomerOrgGroup?: boolean
+ isCustomerTypeGroup?: boolean
+ isEmployeeTypeGroup?: boolean
+ isIdentityGroup?: boolean
+ isSupplierOrgGroup?: boolean
+ isSupplierTypeGroup?: boolean
+ name?: string
+ updatedAt?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "group_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "group_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "group_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "group_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ ]
+ }
+ holiday: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ date: string
+ id: string
+ name: string
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ year: number | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ date: string
+ id?: string
+ name: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ year?: number | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ date?: string
+ id?: string
+ name?: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ year?: number | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "holiday_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "holiday_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "holiday_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "holiday_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "holiday_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "holiday_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "holiday_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "holiday_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "holiday_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "holiday_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "holiday_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "holiday_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "holiday_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "holiday_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ inboundInspection: {
+ Row: {
+ acceptanceNumber: number
+ aql: number | null
+ codeLetter: string | null
+ companyId: string
+ createdAt: string
+ createdBy: string
+ dispositionedAt: string | null
+ dispositionedBy: string | null
+ id: string
+ inboundInspectionId: string
+ inspectionLevel: Database["public"]["Enums"]["inspectionLevel"] | null
+ itemId: string
+ itemReadableId: string | null
+ lotSize: number
+ notes: string | null
+ receiptId: string
+ receiptLineId: string
+ rejectionNumber: number
+ sampleSize: number
+ samplingPlanType: Database["public"]["Enums"]["samplingPlanType"]
+ samplingStandard: Database["public"]["Enums"]["samplingStandard"]
+ severity: Database["public"]["Enums"]["inspectionSeverity"] | null
+ status: Database["public"]["Enums"]["inboundInspectionStatus"]
+ supplierId: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ acceptanceNumber: number
+ aql?: number | null
+ codeLetter?: string | null
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ dispositionedAt?: string | null
+ dispositionedBy?: string | null
+ id?: string
+ inboundInspectionId: string
+ inspectionLevel?:
+ | Database["public"]["Enums"]["inspectionLevel"]
+ | null
+ itemId: string
+ itemReadableId?: string | null
+ lotSize: number
+ notes?: string | null
+ receiptId: string
+ receiptLineId: string
+ rejectionNumber: number
+ sampleSize: number
+ samplingPlanType: Database["public"]["Enums"]["samplingPlanType"]
+ samplingStandard: Database["public"]["Enums"]["samplingStandard"]
+ severity?: Database["public"]["Enums"]["inspectionSeverity"] | null
+ status?: Database["public"]["Enums"]["inboundInspectionStatus"]
+ supplierId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ acceptanceNumber?: number
+ aql?: number | null
+ codeLetter?: string | null
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ dispositionedAt?: string | null
+ dispositionedBy?: string | null
+ id?: string
+ inboundInspectionId?: string
+ inspectionLevel?:
+ | Database["public"]["Enums"]["inspectionLevel"]
+ | null
+ itemId?: string
+ itemReadableId?: string | null
+ lotSize?: number
+ notes?: string | null
+ receiptId?: string
+ receiptLineId?: string
+ rejectionNumber?: number
+ sampleSize?: number
+ samplingPlanType?: Database["public"]["Enums"]["samplingPlanType"]
+ samplingStandard?: Database["public"]["Enums"]["samplingStandard"]
+ severity?: Database["public"]["Enums"]["inspectionSeverity"] | null
+ status?: Database["public"]["Enums"]["inboundInspectionStatus"]
+ supplierId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "inboundInspection_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspection_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspection_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "inboundInspection_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "inboundInspection_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspection_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspection_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspection_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspection_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "inboundInspection_dispositionedBy_fkey"
+ columns: ["dispositionedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspection_dispositionedBy_fkey"
+ columns: ["dispositionedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspection_dispositionedBy_fkey"
+ columns: ["dispositionedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspection_dispositionedBy_fkey"
+ columns: ["dispositionedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspection_dispositionedBy_fkey"
+ columns: ["dispositionedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "inboundInspection_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspection_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspection_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspection_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspection_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspection_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspection_receiptId_fkey"
+ columns: ["receiptId"]
+ isOneToOne: false
+ referencedRelation: "receipt"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspection_receiptId_fkey"
+ columns: ["receiptId"]
+ isOneToOne: false
+ referencedRelation: "receipts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspection_receiptLineId_fkey"
+ columns: ["receiptLineId"]
+ isOneToOne: true
+ referencedRelation: "receiptLine"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspection_receiptLineId_fkey"
+ columns: ["receiptLineId"]
+ isOneToOne: true
+ referencedRelation: "receiptLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspection_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "inboundInspection_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "inboundInspection_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspection_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspection_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspection_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspection_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspection_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspection_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspection_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ inboundInspectionHistory: {
+ Row: {
+ aql: number | null
+ companyId: string
+ createdAt: string
+ createdBy: string
+ defectsFound: number
+ id: string
+ inboundInspectionId: string
+ inspectionLevel: Database["public"]["Enums"]["inspectionLevel"] | null
+ itemId: string
+ lotSize: number
+ outcome: string
+ sampleSize: number
+ samplingStandard: Database["public"]["Enums"]["samplingStandard"]
+ severity: Database["public"]["Enums"]["inspectionSeverity"]
+ supplierId: string | null
+ }
+ Insert: {
+ aql?: number | null
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ defectsFound: number
+ id?: string
+ inboundInspectionId: string
+ inspectionLevel?:
+ | Database["public"]["Enums"]["inspectionLevel"]
+ | null
+ itemId: string
+ lotSize: number
+ outcome: string
+ sampleSize: number
+ samplingStandard: Database["public"]["Enums"]["samplingStandard"]
+ severity: Database["public"]["Enums"]["inspectionSeverity"]
+ supplierId?: string | null
+ }
+ Update: {
+ aql?: number | null
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ defectsFound?: number
+ id?: string
+ inboundInspectionId?: string
+ inspectionLevel?:
+ | Database["public"]["Enums"]["inspectionLevel"]
+ | null
+ itemId?: string
+ lotSize?: number
+ outcome?: string
+ sampleSize?: number
+ samplingStandard?: Database["public"]["Enums"]["samplingStandard"]
+ severity?: Database["public"]["Enums"]["inspectionSeverity"]
+ supplierId?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "inboundInspectionHistory_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspectionHistory_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspectionHistory_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "inboundInspectionHistory_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "inboundInspectionHistory_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspectionHistory_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspectionHistory_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspectionHistory_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspectionHistory_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "inboundInspectionHistory_inboundInspectionId_fkey"
+ columns: ["inboundInspectionId"]
+ isOneToOne: false
+ referencedRelation: "inboundInspection"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspectionHistory_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspectionHistory_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspectionHistory_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspectionHistory_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspectionHistory_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspectionHistory_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspectionHistory_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "inboundInspectionHistory_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "inboundInspectionHistory_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspectionHistory_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspectionHistory_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ inboundInspectionSample: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ inboundInspectionId: string
+ inspectedAt: string | null
+ inspectedBy: string | null
+ notes: string | null
+ status: Database["public"]["Enums"]["inboundInspectionSampleStatus"]
+ trackedEntityId: string
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ inboundInspectionId: string
+ inspectedAt?: string | null
+ inspectedBy?: string | null
+ notes?: string | null
+ status?: Database["public"]["Enums"]["inboundInspectionSampleStatus"]
+ trackedEntityId: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ inboundInspectionId?: string
+ inspectedAt?: string | null
+ inspectedBy?: string | null
+ notes?: string | null
+ status?: Database["public"]["Enums"]["inboundInspectionSampleStatus"]
+ trackedEntityId?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "inboundInspectionSample_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspectionSample_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspectionSample_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "inboundInspectionSample_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "inboundInspectionSample_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspectionSample_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspectionSample_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspectionSample_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspectionSample_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "inboundInspectionSample_inboundInspectionId_fkey"
+ columns: ["inboundInspectionId"]
+ isOneToOne: false
+ referencedRelation: "inboundInspection"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspectionSample_inspectedBy_fkey"
+ columns: ["inspectedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspectionSample_inspectedBy_fkey"
+ columns: ["inspectedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspectionSample_inspectedBy_fkey"
+ columns: ["inspectedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspectionSample_inspectedBy_fkey"
+ columns: ["inspectedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspectionSample_inspectedBy_fkey"
+ columns: ["inspectedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "inboundInspectionSample_trackedEntityId_fkey"
+ columns: ["trackedEntityId"]
+ isOneToOne: true
+ referencedRelation: "trackedEntity"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspectionSample_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspectionSample_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspectionSample_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspectionSample_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inboundInspectionSample_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ inspectionDocument: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ defaultPageHeight: number | null
+ defaultPageWidth: number | null
+ drawingNumber: string | null
+ fileName: string | null
+ id: string
+ pageCount: number | null
+ partId: string
+ storagePath: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ uploadedBy: string | null
+ version: number
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ defaultPageHeight?: number | null
+ defaultPageWidth?: number | null
+ drawingNumber?: string | null
+ fileName?: string | null
+ id?: string
+ pageCount?: number | null
+ partId: string
+ storagePath?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ uploadedBy?: string | null
+ version?: number
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ defaultPageHeight?: number | null
+ defaultPageWidth?: number | null
+ drawingNumber?: string | null
+ fileName?: string | null
+ id?: string
+ pageCount?: number | null
+ partId?: string
+ storagePath?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ uploadedBy?: string | null
+ version?: number
+ }
+ Relationships: [
+ {
+ foreignKeyName: "inspectionDocument_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_uploadedBy_fkey"
+ columns: ["uploadedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_uploadedBy_fkey"
+ columns: ["uploadedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_uploadedBy_fkey"
+ columns: ["uploadedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_uploadedBy_fkey"
+ columns: ["uploadedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_uploadedBy_fkey"
+ columns: ["uploadedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ inspectionFeature: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ description: string | null
+ id: string
+ inspectionDocumentId: string
+ label: string
+ nominalValue: string | null
+ pageNumber: number
+ toleranceMinus: string | null
+ tolerancePlus: string | null
+ type: Database["public"]["Enums"]["procedureStepType"]
+ unit: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ description?: string | null
+ id?: string
+ inspectionDocumentId: string
+ label: string
+ nominalValue?: string | null
+ pageNumber: number
+ toleranceMinus?: string | null
+ tolerancePlus?: string | null
+ type?: Database["public"]["Enums"]["procedureStepType"]
+ unit?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ description?: string | null
+ id?: string
+ inspectionDocumentId?: string
+ label?: string
+ nominalValue?: string | null
+ pageNumber?: number
+ toleranceMinus?: string | null
+ tolerancePlus?: string | null
+ type?: Database["public"]["Enums"]["procedureStepType"]
+ unit?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "inspectionFeature_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_document_company_fkey"
+ columns: ["inspectionDocumentId", "companyId"]
+ isOneToOne: false
+ referencedRelation: "inspectionDocument"
+ referencedColumns: ["id", "companyId"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_document_company_fkey"
+ columns: ["inspectionDocumentId", "companyId"]
+ isOneToOne: false
+ referencedRelation: "inspectionDocuments"
+ referencedColumns: ["id", "companyId"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ integration: {
+ Row: {
+ id: string
+ jsonschema: Json
+ }
+ Insert: {
+ id: string
+ jsonschema: Json
+ }
+ Update: {
+ id?: string
+ jsonschema?: Json
+ }
+ Relationships: []
+ }
+ intercompanyTransaction: {
+ Row: {
+ amount: number
+ companyGroupId: string
+ createdAt: string
+ currencyCode: string
+ description: string | null
+ documentId: string | null
+ documentType:
+ | Database["public"]["Enums"]["journalLineDocumentType"]
+ | null
+ eliminationJournalId: string | null
+ id: string
+ sourceCompanyId: string
+ sourceJournalLineId: string
+ status: string
+ targetCompanyId: string
+ targetJournalLineId: string | null
+ updatedAt: string | null
+ }
+ Insert: {
+ amount: number
+ companyGroupId: string
+ createdAt?: string
+ currencyCode: string
+ description?: string | null
+ documentId?: string | null
+ documentType?:
+ | Database["public"]["Enums"]["journalLineDocumentType"]
+ | null
+ eliminationJournalId?: string | null
+ id?: string
+ sourceCompanyId: string
+ sourceJournalLineId: string
+ status?: string
+ targetCompanyId: string
+ targetJournalLineId?: string | null
+ updatedAt?: string | null
+ }
+ Update: {
+ amount?: number
+ companyGroupId?: string
+ createdAt?: string
+ currencyCode?: string
+ description?: string | null
+ documentId?: string | null
+ documentType?:
+ | Database["public"]["Enums"]["journalLineDocumentType"]
+ | null
+ eliminationJournalId?: string | null
+ id?: string
+ sourceCompanyId?: string
+ sourceJournalLineId?: string
+ status?: string
+ targetCompanyId?: string
+ targetJournalLineId?: string | null
+ updatedAt?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "intercompanyTransaction_companyGroupId_fkey"
+ columns: ["companyGroupId"]
+ isOneToOne: false
+ referencedRelation: "companyGroup"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "intercompanyTransaction_eliminationJournalId_fkey"
+ columns: ["eliminationJournalId"]
+ isOneToOne: false
+ referencedRelation: "journal"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "intercompanyTransaction_eliminationJournalId_fkey"
+ columns: ["eliminationJournalId"]
+ isOneToOne: false
+ referencedRelation: "journalEntries"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "intercompanyTransaction_sourceCompanyId_fkey"
+ columns: ["sourceCompanyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "intercompanyTransaction_sourceCompanyId_fkey"
+ columns: ["sourceCompanyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "intercompanyTransaction_sourceCompanyId_fkey"
+ columns: ["sourceCompanyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "intercompanyTransaction_sourceCompanyId_fkey"
+ columns: ["sourceCompanyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "intercompanyTransaction_sourceJournalLineId_fkey"
+ columns: ["sourceJournalLineId"]
+ isOneToOne: false
+ referencedRelation: "journalLine"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "intercompanyTransaction_targetCompanyId_fkey"
+ columns: ["targetCompanyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "intercompanyTransaction_targetCompanyId_fkey"
+ columns: ["targetCompanyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "intercompanyTransaction_targetCompanyId_fkey"
+ columns: ["targetCompanyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "intercompanyTransaction_targetCompanyId_fkey"
+ columns: ["targetCompanyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "intercompanyTransaction_targetJournalLineId_fkey"
+ columns: ["targetJournalLineId"]
+ isOneToOne: false
+ referencedRelation: "journalLine"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ invite: {
+ Row: {
+ acceptedAt: string | null
+ code: string
+ companyId: string
+ createdAt: string
+ createdBy: string
+ email: string
+ id: string
+ permissions: Json
+ revokedAt: string | null
+ role: Database["public"]["Enums"]["role"]
+ }
+ Insert: {
+ acceptedAt?: string | null
+ code: string
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ email: string
+ id?: string
+ permissions?: Json
+ revokedAt?: string | null
+ role: Database["public"]["Enums"]["role"]
+ }
+ Update: {
+ acceptedAt?: string | null
+ code?: string
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ email?: string
+ id?: string
+ permissions?: Json
+ revokedAt?: string | null
+ role?: Database["public"]["Enums"]["role"]
+ }
+ Relationships: [
+ {
+ foreignKeyName: "invite_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "invite_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "invite_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "invite_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "invite_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "invite_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "invite_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "invite_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "invite_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ item: {
+ Row: {
+ active: boolean
+ assignee: string | null
+ companyId: string | null
+ createdAt: string
+ createdBy: string
+ defaultMethodType: Database["public"]["Enums"]["methodType"] | null
+ description: string | null
+ embedding: unknown
+ id: string
+ itemTrackingType: Database["public"]["Enums"]["itemTrackingType"]
+ modelUploadId: string | null
+ name: string
+ notes: Json | null
+ readableId: string
+ readableIdWithRevision: string | null
+ replenishmentSystem: Database["public"]["Enums"]["itemReplenishmentSystem"]
+ requiresInspection: boolean
+ revision: string | null
+ thumbnailPath: string | null
+ trackingMethod: string | null
+ type: Database["public"]["Enums"]["itemType"]
+ unitOfMeasureCode: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ active?: boolean
+ assignee?: string | null
+ companyId?: string | null
+ createdAt?: string
+ createdBy: string
+ defaultMethodType?: Database["public"]["Enums"]["methodType"] | null
+ description?: string | null
+ embedding?: unknown
+ id?: string
+ itemTrackingType: Database["public"]["Enums"]["itemTrackingType"]
+ modelUploadId?: string | null
+ name: string
+ notes?: Json | null
+ readableId: string
+ readableIdWithRevision?: string | null
+ replenishmentSystem?: Database["public"]["Enums"]["itemReplenishmentSystem"]
+ requiresInspection?: boolean
+ revision?: string | null
+ thumbnailPath?: string | null
+ trackingMethod?: string | null
+ type: Database["public"]["Enums"]["itemType"]
+ unitOfMeasureCode?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ active?: boolean
+ assignee?: string | null
+ companyId?: string | null
+ createdAt?: string
+ createdBy?: string
+ defaultMethodType?: Database["public"]["Enums"]["methodType"] | null
+ description?: string | null
+ embedding?: unknown
+ id?: string
+ itemTrackingType?: Database["public"]["Enums"]["itemTrackingType"]
+ modelUploadId?: string | null
+ name?: string
+ notes?: Json | null
+ readableId?: string
+ readableIdWithRevision?: string | null
+ replenishmentSystem?: Database["public"]["Enums"]["itemReplenishmentSystem"]
+ requiresInspection?: boolean
+ revision?: string | null
+ thumbnailPath?: string | null
+ trackingMethod?: string | null
+ type?: Database["public"]["Enums"]["itemType"]
+ unitOfMeasureCode?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "item_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "item_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "item_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "item_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "item_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "item_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "modelUpload"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "salesRfqLines"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "item_unitOfMeasureCode_fkey"
+ columns: ["unitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "item_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ itemCost: {
+ Row: {
+ companyId: string
+ costingMethod: Database["public"]["Enums"]["itemCostingMethod"]
+ costIsAdjusted: boolean
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ itemId: string
+ itemPostingGroupId: string | null
+ standardCost: number
+ tags: string[] | null
+ unitCost: number | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ costingMethod: Database["public"]["Enums"]["itemCostingMethod"]
+ costIsAdjusted?: boolean
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ itemId: string
+ itemPostingGroupId?: string | null
+ standardCost?: number
+ tags?: string[] | null
+ unitCost?: number | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ costingMethod?: Database["public"]["Enums"]["itemCostingMethod"]
+ costIsAdjusted?: boolean
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ itemId?: string
+ itemPostingGroupId?: string | null
+ standardCost?: number
+ tags?: string[] | null
+ unitCost?: number | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "itemCost_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemCost_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemCost_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "itemCost_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "itemCost_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemCost_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemCost_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemCost_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemCost_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemCost_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemCost_itemPostingGroupId_fkey"
+ columns: ["itemPostingGroupId"]
+ isOneToOne: false
+ referencedRelation: "itemPostingGroup"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPostingGroup_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPostingGroup_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPostingGroup_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPostingGroup_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPostingGroup_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "itemPostingGroup_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPostingGroup_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPostingGroup_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPostingGroup_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPostingGroup_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ itemLedger: {
+ Row: {
+ comment: string | null
+ companyId: string
+ createdAt: string
+ createdBy: string
+ documentId: string | null
+ documentLineId: string | null
+ documentType:
+ | Database["public"]["Enums"]["itemLedgerDocumentType"]
+ | null
+ entryNumber: number
+ entryType: Database["public"]["Enums"]["itemLedgerType"]
+ externalDocumentId: string | null
+ id: string
+ itemId: string
+ locationId: string | null
+ postingDate: string
+ quantity: number
+ storageUnitId: string | null
+ trackedEntityId: string | null
+ trackedEntityStatus:
+ | Database["public"]["Enums"]["trackedEntityStatus"]
+ | null
+ }
+ Insert: {
+ comment?: string | null
+ companyId: string
+ createdAt?: string
+ createdBy?: string
+ documentId?: string | null
+ documentLineId?: string | null
+ documentType?:
+ | Database["public"]["Enums"]["itemLedgerDocumentType"]
+ | null
+ entryNumber?: number
+ entryType: Database["public"]["Enums"]["itemLedgerType"]
+ externalDocumentId?: string | null
+ id?: string
+ itemId: string
+ locationId?: string | null
+ postingDate?: string
+ quantity: number
+ storageUnitId?: string | null
+ trackedEntityId?: string | null
+ trackedEntityStatus?:
+ | Database["public"]["Enums"]["trackedEntityStatus"]
+ | null
+ }
+ Update: {
+ comment?: string | null
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ documentId?: string | null
+ documentLineId?: string | null
+ documentType?:
+ | Database["public"]["Enums"]["itemLedgerDocumentType"]
+ | null
+ entryNumber?: number
+ entryType?: Database["public"]["Enums"]["itemLedgerType"]
+ externalDocumentId?: string | null
+ id?: string
+ itemId?: string
+ locationId?: string | null
+ postingDate?: string
+ quantity?: number
+ storageUnitId?: string | null
+ trackedEntityId?: string | null
+ trackedEntityStatus?:
+ | Database["public"]["Enums"]["trackedEntityStatus"]
+ | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "itemLedger_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemLedger_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemLedger_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemLedger_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemLedger_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "itemLedger_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemLedger_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemLedger_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemLedger_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemLedger_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemLedger_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemLedger_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemLedger_storageUnitId_fkey"
+ columns: ["storageUnitId"]
+ isOneToOne: false
+ referencedRelation: "storageUnit"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemLedger_trackedEntityId_fkey"
+ columns: ["trackedEntityId"]
+ isOneToOne: false
+ referencedRelation: "trackedEntity"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "partLeger_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "partLeger_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "partLeger_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "partLeger_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ ]
+ }
+ itemPlanning: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ critical: boolean
+ customFields: Json | null
+ demandAccumulationIncludesInventory: boolean
+ demandAccumulationPeriod: number
+ demandAccumulationSafetyStock: number
+ itemId: string
+ locationId: string
+ maximumInventoryQuantity: number
+ maximumOrderQuantity: number
+ minimumOrderQuantity: number
+ orderMultiple: number
+ reorderingPolicy: Database["public"]["Enums"]["itemReorderingPolicy"]
+ reorderPoint: number
+ reorderQuantity: number
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ critical?: boolean
+ customFields?: Json | null
+ demandAccumulationIncludesInventory?: boolean
+ demandAccumulationPeriod?: number
+ demandAccumulationSafetyStock?: number
+ itemId: string
+ locationId: string
+ maximumInventoryQuantity?: number
+ maximumOrderQuantity?: number
+ minimumOrderQuantity?: number
+ orderMultiple?: number
+ reorderingPolicy?: Database["public"]["Enums"]["itemReorderingPolicy"]
+ reorderPoint?: number
+ reorderQuantity?: number
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ critical?: boolean
+ customFields?: Json | null
+ demandAccumulationIncludesInventory?: boolean
+ demandAccumulationPeriod?: number
+ demandAccumulationSafetyStock?: number
+ itemId?: string
+ locationId?: string
+ maximumInventoryQuantity?: number
+ maximumOrderQuantity?: number
+ minimumOrderQuantity?: number
+ orderMultiple?: number
+ reorderingPolicy?: Database["public"]["Enums"]["itemReorderingPolicy"]
+ reorderPoint?: number
+ reorderQuantity?: number
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "itemPlanning_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPlanning_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPlanning_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "itemPlanning_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "itemPlanning_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPlanning_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPlanning_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPlanning_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPlanning_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "itemPlanning_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPlanning_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPlanning_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPlanning_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPlanning_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPlanning_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPlanning_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPlanning_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPlanning_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPlanning_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPlanning_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPlanning_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ itemPostingGroup: {
+ Row: {
+ active: boolean
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ description: string | null
+ id: string
+ name: string
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ active?: boolean
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ description?: string | null
+ id?: string
+ name: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ active?: boolean
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ description?: string | null
+ id?: string
+ name?: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "itemPostingGroup_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPostingGroup_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPostingGroup_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "itemPostingGroup_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "itemPostingGroup_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPostingGroup_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPostingGroup_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPostingGroup_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPostingGroup_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "itemPostingGroup_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPostingGroup_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPostingGroup_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPostingGroup_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemPostingGroup_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ itemReplenishment: {
+ Row: {
+ companyId: string
+ conversionFactor: number
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ itemId: string
+ leadTime: number
+ lotSize: number | null
+ manufacturingBlocked: boolean
+ preferredSupplierId: string | null
+ purchasingBlocked: boolean
+ purchasingUnitOfMeasureCode: string | null
+ requiresConfiguration: boolean
+ scrapPercentage: number
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ conversionFactor?: number
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ itemId: string
+ leadTime?: number
+ lotSize?: number | null
+ manufacturingBlocked?: boolean
+ preferredSupplierId?: string | null
+ purchasingBlocked?: boolean
+ purchasingUnitOfMeasureCode?: string | null
+ requiresConfiguration?: boolean
+ scrapPercentage?: number
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ conversionFactor?: number
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ itemId?: string
+ leadTime?: number
+ lotSize?: number | null
+ manufacturingBlocked?: boolean
+ preferredSupplierId?: string | null
+ purchasingBlocked?: boolean
+ purchasingUnitOfMeasureCode?: string | null
+ requiresConfiguration?: boolean
+ scrapPercentage?: number
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "itemReplenishment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemReplenishment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemReplenishment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "itemReplenishment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "itemReplenishment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemReplenishment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemReplenishment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemReplenishment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemReplenishment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "itemReplenishment_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: true
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemReplenishment_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: true
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemReplenishment_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: true
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemReplenishment_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: true
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemReplenishment_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: true
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemReplenishment_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: true
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemReplenishment_preferredSupplierId_fkey"
+ columns: ["preferredSupplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "itemReplenishment_preferredSupplierId_fkey"
+ columns: ["preferredSupplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "itemReplenishment_preferredSupplierId_fkey"
+ columns: ["preferredSupplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemReplenishment_preferredSupplierId_fkey"
+ columns: ["preferredSupplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemReplenishment_preferredSupplierId_fkey"
+ columns: ["preferredSupplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemReplenishment_purchaseUnitOfMeasureCode_fkey"
+ columns: ["purchasingUnitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "itemReplenishment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemReplenishment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemReplenishment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemReplenishment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemReplenishment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ itemSamplingPlan: {
+ Row: {
+ aql: number | null
+ companyId: string
+ createdAt: string
+ createdBy: string
+ inspectionLevel: Database["public"]["Enums"]["inspectionLevel"]
+ itemId: string
+ percentage: number | null
+ sampleSize: number | null
+ severity: Database["public"]["Enums"]["inspectionSeverity"]
+ type: Database["public"]["Enums"]["samplingPlanType"]
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ aql?: number | null
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ inspectionLevel?: Database["public"]["Enums"]["inspectionLevel"]
+ itemId: string
+ percentage?: number | null
+ sampleSize?: number | null
+ severity?: Database["public"]["Enums"]["inspectionSeverity"]
+ type?: Database["public"]["Enums"]["samplingPlanType"]
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ aql?: number | null
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ inspectionLevel?: Database["public"]["Enums"]["inspectionLevel"]
+ itemId?: string
+ percentage?: number | null
+ sampleSize?: number | null
+ severity?: Database["public"]["Enums"]["inspectionSeverity"]
+ type?: Database["public"]["Enums"]["samplingPlanType"]
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "itemSamplingPlan_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemSamplingPlan_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemSamplingPlan_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "itemSamplingPlan_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "itemSamplingPlan_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemSamplingPlan_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemSamplingPlan_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemSamplingPlan_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemSamplingPlan_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "itemSamplingPlan_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: true
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemSamplingPlan_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: true
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemSamplingPlan_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: true
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemSamplingPlan_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: true
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemSamplingPlan_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: true
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemSamplingPlan_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: true
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemSamplingPlan_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemSamplingPlan_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemSamplingPlan_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemSamplingPlan_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemSamplingPlan_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ itemShelfLife: {
+ Row: {
+ calculateFromBom: boolean
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ days: number | null
+ itemId: string
+ mode: Database["public"]["Enums"]["shelfLifeMode"]
+ triggerProcessId: string | null
+ triggerTiming: Database["public"]["Enums"]["shelfLifeTriggerTiming"]
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ calculateFromBom?: boolean
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ days?: number | null
+ itemId: string
+ mode: Database["public"]["Enums"]["shelfLifeMode"]
+ triggerProcessId?: string | null
+ triggerTiming?: Database["public"]["Enums"]["shelfLifeTriggerTiming"]
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ calculateFromBom?: boolean
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ days?: number | null
+ itemId?: string
+ mode?: Database["public"]["Enums"]["shelfLifeMode"]
+ triggerProcessId?: string | null
+ triggerTiming?: Database["public"]["Enums"]["shelfLifeTriggerTiming"]
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "itemShelfLife_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemShelfLife_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemShelfLife_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "itemShelfLife_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "itemShelfLife_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemShelfLife_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemShelfLife_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemShelfLife_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemShelfLife_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "itemShelfLife_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: true
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemShelfLife_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: true
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemShelfLife_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: true
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemShelfLife_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: true
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemShelfLife_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: true
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemShelfLife_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: true
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemShelfLife_triggerProcessId_fkey"
+ columns: ["triggerProcessId"]
+ isOneToOne: false
+ referencedRelation: "process"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemShelfLife_triggerProcessId_fkey"
+ columns: ["triggerProcessId"]
+ isOneToOne: false
+ referencedRelation: "processes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemShelfLife_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemShelfLife_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemShelfLife_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemShelfLife_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemShelfLife_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ itemUnitSalePrice: {
+ Row: {
+ allowInvoiceDiscount: boolean
+ companyId: string
+ createdAt: string
+ createdBy: string
+ currencyCode: string
+ customFields: Json | null
+ itemId: string
+ priceIncludesTax: boolean
+ salesBlocked: boolean
+ salesUnitOfMeasureCode: string | null
+ tags: string[] | null
+ unitSalePrice: number
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ allowInvoiceDiscount?: boolean
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ currencyCode: string
+ customFields?: Json | null
+ itemId: string
+ priceIncludesTax?: boolean
+ salesBlocked?: boolean
+ salesUnitOfMeasureCode?: string | null
+ tags?: string[] | null
+ unitSalePrice?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ allowInvoiceDiscount?: boolean
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ currencyCode?: string
+ customFields?: Json | null
+ itemId?: string
+ priceIncludesTax?: boolean
+ salesBlocked?: boolean
+ salesUnitOfMeasureCode?: string | null
+ tags?: string[] | null
+ unitSalePrice?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "itemUnitSalePrice_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemUnitSalePrice_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemUnitSalePrice_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "itemUnitSalePrice_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "itemUnitSalePrice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemUnitSalePrice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemUnitSalePrice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemUnitSalePrice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemUnitSalePrice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "itemUnitSalePrice_currencyCode_fkey"
+ columns: ["currencyCode"]
+ isOneToOne: false
+ referencedRelation: "currencyCode"
+ referencedColumns: ["code"]
+ },
+ {
+ foreignKeyName: "itemUnitSalePrice_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemUnitSalePrice_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemUnitSalePrice_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemUnitSalePrice_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemUnitSalePrice_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemUnitSalePrice_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemUnitSalePrice_salesUnitOfMeasureId_fkey"
+ columns: ["salesUnitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "itemUnitSalePrice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemUnitSalePrice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemUnitSalePrice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemUnitSalePrice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemUnitSalePrice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ job: {
+ Row: {
+ actualTime: number | null
+ assignee: string | null
+ companyId: string
+ completedDate: string | null
+ configuration: Json | null
+ createdAt: string
+ createdBy: string
+ customerId: string | null
+ customFields: Json | null
+ deadlineType: Database["public"]["Enums"]["deadlineType"]
+ dueDate: string | null
+ estimatedTime: number | null
+ id: string
+ itemId: string
+ jobId: string
+ locationId: string
+ modelUploadId: string | null
+ notes: Json | null
+ priority: number
+ productionQuantity: number | null
+ quantity: number
+ quantityComplete: number
+ quantityReceivedToInventory: number
+ quantityShipped: number
+ quoteId: string | null
+ quoteLineId: string | null
+ releasedDate: string | null
+ salesOrderId: string | null
+ salesOrderLineId: string | null
+ scrapQuantity: number
+ secondsToComplete: number | null
+ startDate: string | null
+ status: Database["public"]["Enums"]["jobStatus"]
+ storageUnitId: string | null
+ tags: string[] | null
+ unitOfMeasureCode: string
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ actualTime?: number | null
+ assignee?: string | null
+ companyId: string
+ completedDate?: string | null
+ configuration?: Json | null
+ createdAt?: string
+ createdBy: string
+ customerId?: string | null
+ customFields?: Json | null
+ deadlineType?: Database["public"]["Enums"]["deadlineType"]
+ dueDate?: string | null
+ estimatedTime?: number | null
+ id?: string
+ itemId: string
+ jobId: string
+ locationId: string
+ modelUploadId?: string | null
+ notes?: Json | null
+ priority?: number
+ productionQuantity?: number | null
+ quantity?: number
+ quantityComplete?: number
+ quantityReceivedToInventory?: number
+ quantityShipped?: number
+ quoteId?: string | null
+ quoteLineId?: string | null
+ releasedDate?: string | null
+ salesOrderId?: string | null
+ salesOrderLineId?: string | null
+ scrapQuantity?: number
+ secondsToComplete?: number | null
+ startDate?: string | null
+ status?: Database["public"]["Enums"]["jobStatus"]
+ storageUnitId?: string | null
+ tags?: string[] | null
+ unitOfMeasureCode: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ actualTime?: number | null
+ assignee?: string | null
+ companyId?: string
+ completedDate?: string | null
+ configuration?: Json | null
+ createdAt?: string
+ createdBy?: string
+ customerId?: string | null
+ customFields?: Json | null
+ deadlineType?: Database["public"]["Enums"]["deadlineType"]
+ dueDate?: string | null
+ estimatedTime?: number | null
+ id?: string
+ itemId?: string
+ jobId?: string
+ locationId?: string
+ modelUploadId?: string | null
+ notes?: Json | null
+ priority?: number
+ productionQuantity?: number | null
+ quantity?: number
+ quantityComplete?: number
+ quantityReceivedToInventory?: number
+ quantityShipped?: number
+ quoteId?: string | null
+ quoteLineId?: string | null
+ releasedDate?: string | null
+ salesOrderId?: string | null
+ salesOrderLineId?: string | null
+ scrapQuantity?: number
+ secondsToComplete?: number | null
+ startDate?: string | null
+ status?: Database["public"]["Enums"]["jobStatus"]
+ storageUnitId?: string | null
+ tags?: string[] | null
+ unitOfMeasureCode?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "job_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "job_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "job_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "job_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "job_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quote"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quoteCustomerDetails"
+ referencedColumns: ["quoteId"]
+ },
+ {
+ foreignKeyName: "job_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quotes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrder"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderLocations"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_salesOrderLineId_fkey"
+ columns: ["salesOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "openSalesOrderLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_salesOrderLineId_fkey"
+ columns: ["salesOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderLine"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_salesOrderLineId_fkey"
+ columns: ["salesOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_storageUnitId_fkey"
+ columns: ["storageUnitId"]
+ isOneToOne: false
+ referencedRelation: "storageUnit"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_unitOfMeasureCode_fkey"
+ columns: ["unitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "job_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ jobFavorite: {
+ Row: {
+ jobId: string
+ userId: string
+ }
+ Insert: {
+ jobId: string
+ userId: string
+ }
+ Update: {
+ jobId?: string
+ userId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "jobFavorites_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "job"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobFavorites_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobFavorites_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "openProductionOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ jobMakeMethod: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ id: string
+ itemId: string
+ itemScrapPercentage: number
+ jobId: string
+ parentMaterialId: string | null
+ quantityPerParent: number
+ requiresBatchTracking: boolean
+ requiresSerialTracking: boolean
+ trackedEntityId: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ version: number
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ id?: string
+ itemId: string
+ itemScrapPercentage?: number
+ jobId: string
+ parentMaterialId?: string | null
+ quantityPerParent?: number
+ requiresBatchTracking?: boolean
+ requiresSerialTracking?: boolean
+ trackedEntityId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ version?: number
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ id?: string
+ itemId?: string
+ itemScrapPercentage?: number
+ jobId?: string
+ parentMaterialId?: string | null
+ quantityPerParent?: number
+ requiresBatchTracking?: boolean
+ requiresSerialTracking?: boolean
+ trackedEntityId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ version?: number
+ }
+ Relationships: [
+ {
+ foreignKeyName: "jobMakeMethod_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMakeMethod_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMakeMethod_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "jobMakeMethod_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "jobMakeMethod_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMakeMethod_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMakeMethod_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMakeMethod_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMakeMethod_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "jobMakeMethod_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMakeMethod_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMakeMethod_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMakeMethod_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMakeMethod_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMakeMethod_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMakeMethod_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "job"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMakeMethod_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMakeMethod_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "openProductionOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMakeMethod_parentMaterialId_fkey"
+ columns: ["parentMaterialId"]
+ isOneToOne: false
+ referencedRelation: "jobMaterial"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMakeMethod_parentMaterialId_fkey"
+ columns: ["parentMaterialId"]
+ isOneToOne: false
+ referencedRelation: "jobMaterialWithMakeMethodId"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMakeMethod_parentMaterialId_fkey"
+ columns: ["parentMaterialId"]
+ isOneToOne: false
+ referencedRelation: "openJobMaterialLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMakeMethod_trackedEntityId_fkey"
+ columns: ["trackedEntityId"]
+ isOneToOne: false
+ referencedRelation: "trackedEntity"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMakeMethod_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMakeMethod_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMakeMethod_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMakeMethod_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMakeMethod_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ jobMaterial: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ defaultStorageUnit: boolean | null
+ description: string
+ estimatedQuantity: number | null
+ id: string
+ itemId: string
+ itemScrapPercentage: number
+ itemType: string
+ jobId: string
+ jobMakeMethodId: string
+ jobOperationId: string | null
+ kit: boolean
+ methodType: Database["public"]["Enums"]["methodType"]
+ order: number
+ quantity: number
+ quantityIssued: number | null
+ quantityToIssue: number | null
+ requiresBatchTracking: boolean
+ requiresSerialTracking: boolean
+ scrapQuantity: number
+ storageUnitId: string | null
+ unitCost: number
+ unitOfMeasureCode: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ defaultStorageUnit?: boolean | null
+ description: string
+ estimatedQuantity?: number | null
+ id?: string
+ itemId: string
+ itemScrapPercentage?: number
+ itemType?: string
+ jobId: string
+ jobMakeMethodId: string
+ jobOperationId?: string | null
+ kit?: boolean
+ methodType?: Database["public"]["Enums"]["methodType"]
+ order?: number
+ quantity?: number
+ quantityIssued?: number | null
+ quantityToIssue?: number | null
+ requiresBatchTracking?: boolean
+ requiresSerialTracking?: boolean
+ scrapQuantity?: number
+ storageUnitId?: string | null
+ unitCost?: number
+ unitOfMeasureCode?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ defaultStorageUnit?: boolean | null
+ description?: string
+ estimatedQuantity?: number | null
+ id?: string
+ itemId?: string
+ itemScrapPercentage?: number
+ itemType?: string
+ jobId?: string
+ jobMakeMethodId?: string
+ jobOperationId?: string | null
+ kit?: boolean
+ methodType?: Database["public"]["Enums"]["methodType"]
+ order?: number
+ quantity?: number
+ quantityIssued?: number | null
+ quantityToIssue?: number | null
+ requiresBatchTracking?: boolean
+ requiresSerialTracking?: boolean
+ scrapQuantity?: number
+ storageUnitId?: string | null
+ unitCost?: number
+ unitOfMeasureCode?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "jobMaterial_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "jobMaterial_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "jobMaterial_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "jobMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "job"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "openProductionOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_jobMakeMethodId_fkey"
+ columns: ["jobMakeMethodId"]
+ isOneToOne: false
+ referencedRelation: "jobMakeMethod"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_jobMakeMethodId_fkey"
+ columns: ["jobMakeMethodId"]
+ isOneToOne: false
+ referencedRelation: "jobMaterialWithMakeMethodId"
+ referencedColumns: ["jobMaterialMakeMethodId"]
+ },
+ {
+ foreignKeyName: "jobMaterial_jobMakeMethodId_fkey"
+ columns: ["jobMakeMethodId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["jobMakeMethodId"]
+ },
+ {
+ foreignKeyName: "jobMaterial_jobOperationId_fkey"
+ columns: ["jobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_jobOperationId_fkey"
+ columns: ["jobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithDependencies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_jobOperationId_fkey"
+ columns: ["jobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithMakeMethods"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_storageUnitId_fkey"
+ columns: ["storageUnitId"]
+ isOneToOne: false
+ referencedRelation: "storageUnit"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_unitOfMeasureCode_fkey"
+ columns: ["unitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "jobMaterial_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ jobOperation: {
+ Row: {
+ assignee: string | null
+ companyId: string
+ conflictReason: string | null
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ description: string | null
+ dueDate: string | null
+ hasConflict: boolean | null
+ id: string
+ jobId: string
+ jobMakeMethodId: string | null
+ laborRate: number
+ laborTime: number
+ laborUnit: Database["public"]["Enums"]["factor"]
+ machineRate: number | null
+ machineTime: number
+ machineUnit: Database["public"]["Enums"]["factor"]
+ manuallyScheduled: boolean
+ operationLeadTime: number
+ operationMinimumCost: number
+ operationOrder: Database["public"]["Enums"]["methodOperationOrder"]
+ operationQuantity: number | null
+ operationSupplierProcessId: string | null
+ operationType: Database["public"]["Enums"]["operationType"]
+ operationUnitCost: number
+ order: number
+ overheadRate: number
+ priority: number
+ procedureId: string | null
+ processId: string
+ quantityComplete: number | null
+ quantityReworked: number | null
+ quantityScrapped: number | null
+ reworkId: string | null
+ setupTime: number
+ setupUnit: Database["public"]["Enums"]["factor"]
+ startDate: string | null
+ status: Database["public"]["Enums"]["jobOperationStatus"]
+ tags: string[] | null
+ targetQuantity: number | null
+ updatedAt: string | null
+ updatedBy: string | null
+ workCenterId: string | null
+ workInstruction: Json
+ }
+ Insert: {
+ assignee?: string | null
+ companyId: string
+ conflictReason?: string | null
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ description?: string | null
+ dueDate?: string | null
+ hasConflict?: boolean | null
+ id?: string
+ jobId: string
+ jobMakeMethodId?: string | null
+ laborRate?: number
+ laborTime?: number
+ laborUnit?: Database["public"]["Enums"]["factor"]
+ machineRate?: number | null
+ machineTime?: number
+ machineUnit?: Database["public"]["Enums"]["factor"]
+ manuallyScheduled?: boolean
+ operationLeadTime?: number
+ operationMinimumCost?: number
+ operationOrder?: Database["public"]["Enums"]["methodOperationOrder"]
+ operationQuantity?: number | null
+ operationSupplierProcessId?: string | null
+ operationType?: Database["public"]["Enums"]["operationType"]
+ operationUnitCost?: number
+ order?: number
+ overheadRate?: number
+ priority?: number
+ procedureId?: string | null
+ processId: string
+ quantityComplete?: number | null
+ quantityReworked?: number | null
+ quantityScrapped?: number | null
+ reworkId?: string | null
+ setupTime?: number
+ setupUnit?: Database["public"]["Enums"]["factor"]
+ startDate?: string | null
+ status?: Database["public"]["Enums"]["jobOperationStatus"]
+ tags?: string[] | null
+ targetQuantity?: number | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ workCenterId?: string | null
+ workInstruction?: Json
+ }
+ Update: {
+ assignee?: string | null
+ companyId?: string
+ conflictReason?: string | null
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ description?: string | null
+ dueDate?: string | null
+ hasConflict?: boolean | null
+ id?: string
+ jobId?: string
+ jobMakeMethodId?: string | null
+ laborRate?: number
+ laborTime?: number
+ laborUnit?: Database["public"]["Enums"]["factor"]
+ machineRate?: number | null
+ machineTime?: number
+ machineUnit?: Database["public"]["Enums"]["factor"]
+ manuallyScheduled?: boolean
+ operationLeadTime?: number
+ operationMinimumCost?: number
+ operationOrder?: Database["public"]["Enums"]["methodOperationOrder"]
+ operationQuantity?: number | null
+ operationSupplierProcessId?: string | null
+ operationType?: Database["public"]["Enums"]["operationType"]
+ operationUnitCost?: number
+ order?: number
+ overheadRate?: number
+ priority?: number
+ procedureId?: string | null
+ processId?: string
+ quantityComplete?: number | null
+ quantityReworked?: number | null
+ quantityScrapped?: number | null
+ reworkId?: string | null
+ setupTime?: number
+ setupUnit?: Database["public"]["Enums"]["factor"]
+ startDate?: string | null
+ status?: Database["public"]["Enums"]["jobOperationStatus"]
+ tags?: string[] | null
+ targetQuantity?: number | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ workCenterId?: string | null
+ workInstruction?: Json
+ }
+ Relationships: [
+ {
+ foreignKeyName: "jobOperation_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "jobOperation_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "jobOperation_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "jobOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "jobOperation_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "job"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "openProductionOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_jobMakeMethodId_fkey"
+ columns: ["jobMakeMethodId"]
+ isOneToOne: false
+ referencedRelation: "jobMakeMethod"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_jobMakeMethodId_fkey"
+ columns: ["jobMakeMethodId"]
+ isOneToOne: false
+ referencedRelation: "jobMaterialWithMakeMethodId"
+ referencedColumns: ["jobMaterialMakeMethodId"]
+ },
+ {
+ foreignKeyName: "jobOperation_jobMakeMethodId_fkey"
+ columns: ["jobMakeMethodId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["jobMakeMethodId"]
+ },
+ {
+ foreignKeyName: "jobOperation_procedureId_fkey"
+ columns: ["procedureId"]
+ isOneToOne: false
+ referencedRelation: "procedure"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_procedureId_fkey"
+ columns: ["procedureId"]
+ isOneToOne: false
+ referencedRelation: "procedures"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_processId_fkey"
+ columns: ["processId"]
+ isOneToOne: false
+ referencedRelation: "process"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_processId_fkey"
+ columns: ["processId"]
+ isOneToOne: false
+ referencedRelation: "processes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_reworkId_fkey"
+ columns: ["reworkId"]
+ isOneToOne: false
+ referencedRelation: "rework"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "jobOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "riskRegisters"
+ referencedColumns: ["workCenterId"]
+ },
+ {
+ foreignKeyName: "jobOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenter"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenters"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ jobOperationDependency: {
+ Row: {
+ companyId: string
+ createdAt: string
+ dependsOnId: string
+ jobId: string
+ operationId: string
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ dependsOnId: string
+ jobId: string
+ operationId: string
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ dependsOnId?: string
+ jobId?: string
+ operationId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "jobOperationDependency_companyId_fk"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationDependency_companyId_fk"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationDependency_companyId_fk"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "jobOperationDependency_companyId_fk"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "jobOperationDependency_dependsOnId_fk"
+ columns: ["dependsOnId"]
+ isOneToOne: false
+ referencedRelation: "jobOperation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationDependency_dependsOnId_fk"
+ columns: ["dependsOnId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithDependencies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationDependency_dependsOnId_fk"
+ columns: ["dependsOnId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithMakeMethods"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationDependency_jobId_fk"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "job"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationDependency_jobId_fk"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationDependency_jobId_fk"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "openProductionOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationDependency_operationId_fk"
+ columns: ["operationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationDependency_operationId_fk"
+ columns: ["operationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithDependencies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationDependency_operationId_fk"
+ columns: ["operationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithMakeMethods"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ jobOperationNote: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ jobOperationId: string
+ note: string
+ productionQuantityId: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ jobOperationId: string
+ note: string
+ productionQuantityId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ jobOperationId?: string
+ note?: string
+ productionQuantityId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "jobOperationNote_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationNote_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationNote_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "jobOperationNote_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "jobOperationNote_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationNote_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationNote_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationNote_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationNote_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "jobOperationNote_productionQuantityId_fkey"
+ columns: ["productionQuantityId"]
+ isOneToOne: false
+ referencedRelation: "productionQuantity"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationNote_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationNote_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationNote_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationNote_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationNote_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ jobOperationParameter: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ key: string
+ operationId: string
+ updatedAt: string | null
+ updatedBy: string | null
+ value: string
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ key: string
+ operationId: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ value: string
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ key?: string
+ operationId?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ value?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "jobOperationParameter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationParameter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationParameter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationParameter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationParameter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "jobOperationParameter_operationId_fkey"
+ columns: ["operationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationParameter_operationId_fkey"
+ columns: ["operationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithDependencies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationParameter_operationId_fkey"
+ columns: ["operationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithMakeMethods"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationParameter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationParameter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationParameter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationParameter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationParameter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ jobOperationStep: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ description: Json | null
+ fileTypes: string[] | null
+ id: string
+ listValues: string[] | null
+ maxValue: number | null
+ minValue: number | null
+ name: string
+ nonConformanceActionId: string | null
+ nonConformanceInvestigationId: string | null
+ operationId: string
+ required: boolean | null
+ sortOrder: number
+ type: Database["public"]["Enums"]["procedureStepType"]
+ unitOfMeasureCode: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ description?: Json | null
+ fileTypes?: string[] | null
+ id?: string
+ listValues?: string[] | null
+ maxValue?: number | null
+ minValue?: number | null
+ name: string
+ nonConformanceActionId?: string | null
+ nonConformanceInvestigationId?: string | null
+ operationId: string
+ required?: boolean | null
+ sortOrder?: number
+ type: Database["public"]["Enums"]["procedureStepType"]
+ unitOfMeasureCode?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ description?: Json | null
+ fileTypes?: string[] | null
+ id?: string
+ listValues?: string[] | null
+ maxValue?: number | null
+ minValue?: number | null
+ name?: string
+ nonConformanceActionId?: string | null
+ nonConformanceInvestigationId?: string | null
+ operationId?: string
+ required?: boolean | null
+ sortOrder?: number
+ type?: Database["public"]["Enums"]["procedureStepType"]
+ unitOfMeasureCode?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "jobOperationAttribute_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationAttribute_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationAttribute_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationAttribute_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationAttribute_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "jobOperationAttribute_operationId_fkey"
+ columns: ["operationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationAttribute_operationId_fkey"
+ columns: ["operationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithDependencies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationAttribute_operationId_fkey"
+ columns: ["operationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithMakeMethods"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationAttribute_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationAttribute_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationAttribute_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationAttribute_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationAttribute_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "jobOperationStep_nonConformanceActionId_fkey"
+ columns: ["nonConformanceActionId"]
+ isOneToOne: false
+ referencedRelation: "nonConformanceActionTask"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationStep_nonConformanceActionId_fkey"
+ columns: ["nonConformanceActionId"]
+ isOneToOne: false
+ referencedRelation: "qualityActions"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ jobOperationStepRecord: {
+ Row: {
+ booleanValue: boolean | null
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ index: number
+ jobOperationStepId: string
+ numericValue: number | null
+ updatedAt: string | null
+ updatedBy: string | null
+ userValue: string | null
+ value: string | null
+ }
+ Insert: {
+ booleanValue?: boolean | null
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ index?: number
+ jobOperationStepId: string
+ numericValue?: number | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ userValue?: string | null
+ value?: string | null
+ }
+ Update: {
+ booleanValue?: boolean | null
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ index?: number
+ jobOperationStepId?: string
+ numericValue?: number | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ userValue?: string | null
+ value?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "jobOperationAttributeRecord_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationAttributeRecord_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationAttributeRecord_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "jobOperationAttributeRecord_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "jobOperationAttributeRecord_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationAttributeRecord_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationAttributeRecord_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationAttributeRecord_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationAttributeRecord_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "jobOperationAttributeRecord_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationAttributeRecord_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationAttributeRecord_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationAttributeRecord_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationAttributeRecord_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "jobOperationAttributeRecord_userValue_fkey"
+ columns: ["userValue"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationAttributeRecord_userValue_fkey"
+ columns: ["userValue"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationAttributeRecord_userValue_fkey"
+ columns: ["userValue"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationAttributeRecord_userValue_fkey"
+ columns: ["userValue"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationAttributeRecord_userValue_fkey"
+ columns: ["userValue"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "jobOperationStepRecord_jobOperationStepId_fkey"
+ columns: ["jobOperationStepId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationStep"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ jobOperationTool: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ operationId: string
+ quantity: number
+ toolId: string
+ updatedAt: string
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ operationId: string
+ quantity?: number
+ toolId: string
+ updatedAt?: string
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ operationId?: string
+ quantity?: number
+ toolId?: string
+ updatedAt?: string
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "jobOperationTool_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationTool_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationTool_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "jobOperationTool_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "jobOperationTool_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationTool_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationTool_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationTool_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationTool_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "jobOperationTool_operationId_fkey"
+ columns: ["operationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationTool_operationId_fkey"
+ columns: ["operationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithDependencies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationTool_operationId_fkey"
+ columns: ["operationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithMakeMethods"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationTool_toolId_fkey"
+ columns: ["toolId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationTool_toolId_fkey"
+ columns: ["toolId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationTool_toolId_fkey"
+ columns: ["toolId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationTool_toolId_fkey"
+ columns: ["toolId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationTool_toolId_fkey"
+ columns: ["toolId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationTool_toolId_fkey"
+ columns: ["toolId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationTool_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationTool_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationTool_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationTool_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperationTool_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ journal: {
+ Row: {
+ accountingPeriodId: string | null
+ companyId: string
+ createdAt: string
+ createdBy: string | null
+ customFields: Json | null
+ description: string | null
+ id: string
+ journalEntryId: string
+ postedAt: string | null
+ postedBy: string | null
+ postingDate: string
+ reversalOfId: string | null
+ reversedById: string | null
+ sourceType:
+ | Database["public"]["Enums"]["journalEntrySourceType"]
+ | null
+ status: Database["public"]["Enums"]["journalEntryStatus"]
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ accountingPeriodId?: string | null
+ companyId: string
+ createdAt?: string
+ createdBy?: string | null
+ customFields?: Json | null
+ description?: string | null
+ id?: string
+ journalEntryId: string
+ postedAt?: string | null
+ postedBy?: string | null
+ postingDate?: string
+ reversalOfId?: string | null
+ reversedById?: string | null
+ sourceType?:
+ | Database["public"]["Enums"]["journalEntrySourceType"]
+ | null
+ status?: Database["public"]["Enums"]["journalEntryStatus"]
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ accountingPeriodId?: string | null
+ companyId?: string
+ createdAt?: string
+ createdBy?: string | null
+ customFields?: Json | null
+ description?: string | null
+ id?: string
+ journalEntryId?: string
+ postedAt?: string | null
+ postedBy?: string | null
+ postingDate?: string
+ reversalOfId?: string | null
+ reversedById?: string | null
+ sourceType?:
+ | Database["public"]["Enums"]["journalEntrySourceType"]
+ | null
+ status?: Database["public"]["Enums"]["journalEntryStatus"]
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "journal_accountPeriodId_fkey"
+ columns: ["accountingPeriodId"]
+ isOneToOne: false
+ referencedRelation: "accountingPeriod"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "journal_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "journal_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "journal_postedBy_fkey"
+ columns: ["postedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_postedBy_fkey"
+ columns: ["postedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_postedBy_fkey"
+ columns: ["postedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_postedBy_fkey"
+ columns: ["postedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_postedBy_fkey"
+ columns: ["postedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "journal_reversalOfId_fkey"
+ columns: ["reversalOfId"]
+ isOneToOne: false
+ referencedRelation: "journal"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_reversalOfId_fkey"
+ columns: ["reversalOfId"]
+ isOneToOne: false
+ referencedRelation: "journalEntries"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_reversedById_fkey"
+ columns: ["reversedById"]
+ isOneToOne: false
+ referencedRelation: "journal"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_reversedById_fkey"
+ columns: ["reversedById"]
+ isOneToOne: false
+ referencedRelation: "journalEntries"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ journalLine: {
+ Row: {
+ accountId: string | null
+ accrual: boolean
+ amount: number
+ companyId: string
+ createdAt: string
+ customFields: Json | null
+ description: string | null
+ documentId: string | null
+ documentLineReference: string | null
+ documentType:
+ | Database["public"]["Enums"]["journalLineDocumentType"]
+ | null
+ externalDocumentId: string | null
+ id: string
+ intercompanyPartnerId: string | null
+ journalId: string
+ journalLineReference: string
+ quantity: number
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ accountId?: string | null
+ accrual?: boolean
+ amount: number
+ companyId: string
+ createdAt?: string
+ customFields?: Json | null
+ description?: string | null
+ documentId?: string | null
+ documentLineReference?: string | null
+ documentType?:
+ | Database["public"]["Enums"]["journalLineDocumentType"]
+ | null
+ externalDocumentId?: string | null
+ id?: string
+ intercompanyPartnerId?: string | null
+ journalId: string
+ journalLineReference: string
+ quantity?: number
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ accountId?: string | null
+ accrual?: boolean
+ amount?: number
+ companyId?: string
+ createdAt?: string
+ customFields?: Json | null
+ description?: string | null
+ documentId?: string | null
+ documentLineReference?: string | null
+ documentType?:
+ | Database["public"]["Enums"]["journalLineDocumentType"]
+ | null
+ externalDocumentId?: string | null
+ id?: string
+ intercompanyPartnerId?: string | null
+ journalId?: string
+ journalLineReference?: string
+ quantity?: number
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "journalLine_accountId_fkey"
+ columns: ["accountId"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journalLine_accountId_fkey"
+ columns: ["accountId"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journalLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journalLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journalLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "journalLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "journalLine_intercompanyPartnerId_fkey"
+ columns: ["intercompanyPartnerId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journalLine_intercompanyPartnerId_fkey"
+ columns: ["intercompanyPartnerId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journalLine_intercompanyPartnerId_fkey"
+ columns: ["intercompanyPartnerId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "journalLine_intercompanyPartnerId_fkey"
+ columns: ["intercompanyPartnerId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "journalLine_journalId_fkey"
+ columns: ["journalId"]
+ isOneToOne: false
+ referencedRelation: "journal"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journalLine_journalId_fkey"
+ columns: ["journalId"]
+ isOneToOne: false
+ referencedRelation: "journalEntries"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journalLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journalLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journalLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journalLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journalLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ journalLineDimension: {
+ Row: {
+ companyId: string
+ createdAt: string
+ dimensionId: string
+ id: string
+ journalLineId: string
+ valueId: string
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ dimensionId: string
+ id?: string
+ journalLineId: string
+ valueId: string
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ dimensionId?: string
+ id?: string
+ journalLineId?: string
+ valueId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "journalLineDimension_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journalLineDimension_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journalLineDimension_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "journalLineDimension_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "journalLineDimension_dimensionId_fkey"
+ columns: ["dimensionId"]
+ isOneToOne: false
+ referencedRelation: "dimension"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journalLineDimension_dimensionId_fkey"
+ columns: ["dimensionId"]
+ isOneToOne: false
+ referencedRelation: "dimensionValues"
+ referencedColumns: ["dimensionId"]
+ },
+ {
+ foreignKeyName: "journalLineDimension_journalLineId_fkey"
+ columns: ["journalLineId"]
+ isOneToOne: false
+ referencedRelation: "journalLine"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ kanban: {
+ Row: {
+ autoRelease: boolean
+ autoStartJob: boolean
+ companyId: string
+ completedBarcodeOverride: string | null
+ conversionFactor: number
+ createdAt: string
+ createdBy: string
+ id: string
+ itemId: string
+ jobId: string | null
+ locationId: string
+ purchaseUnitOfMeasureCode: string | null
+ quantity: number
+ replenishmentSystem: Database["public"]["Enums"]["itemReplenishmentSystem"]
+ storageUnitId: string | null
+ supplierId: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ autoRelease?: boolean
+ autoStartJob?: boolean
+ companyId: string
+ completedBarcodeOverride?: string | null
+ conversionFactor?: number
+ createdAt?: string
+ createdBy: string
+ id?: string
+ itemId: string
+ jobId?: string | null
+ locationId: string
+ purchaseUnitOfMeasureCode?: string | null
+ quantity: number
+ replenishmentSystem?: Database["public"]["Enums"]["itemReplenishmentSystem"]
+ storageUnitId?: string | null
+ supplierId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ autoRelease?: boolean
+ autoStartJob?: boolean
+ companyId?: string
+ completedBarcodeOverride?: string | null
+ conversionFactor?: number
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ itemId?: string
+ jobId?: string | null
+ locationId?: string
+ purchaseUnitOfMeasureCode?: string | null
+ quantity?: number
+ replenishmentSystem?: Database["public"]["Enums"]["itemReplenishmentSystem"]
+ storageUnitId?: string | null
+ supplierId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "kanban_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "kanban_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "kanban_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "kanban_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "job"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "openProductionOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_purchaseUnitOfMeasureCode_fkey"
+ columns: ["purchaseUnitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "kanban_storageUnitId_fkey"
+ columns: ["storageUnitId"]
+ isOneToOne: false
+ referencedRelation: "storageUnit"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "kanban_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "kanban_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ lessonCompletion: {
+ Row: {
+ courseId: string
+ createdAt: string
+ lessonId: string
+ userId: string
+ }
+ Insert: {
+ courseId: string
+ createdAt?: string
+ lessonId: string
+ userId: string
+ }
+ Update: {
+ courseId?: string
+ createdAt?: string
+ lessonId?: string
+ userId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "lessonCompletion_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "lessonCompletion_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "lessonCompletion_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "lessonCompletion_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "lessonCompletion_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ location: {
+ Row: {
+ addressLine1: string
+ addressLine2: string | null
+ city: string
+ companyId: string
+ countryCode: string | null
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ id: string
+ latitude: number | null
+ longitude: number | null
+ name: string
+ postalCode: string
+ stateProvince: string | null
+ tags: string[] | null
+ timezone: string
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ addressLine1: string
+ addressLine2?: string | null
+ city: string
+ companyId: string
+ countryCode?: string | null
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ id?: string
+ latitude?: number | null
+ longitude?: number | null
+ name: string
+ postalCode: string
+ stateProvince?: string | null
+ tags?: string[] | null
+ timezone: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ addressLine1?: string
+ addressLine2?: string | null
+ city?: string
+ companyId?: string
+ countryCode?: string | null
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ id?: string
+ latitude?: number | null
+ longitude?: number | null
+ name?: string
+ postalCode?: string
+ stateProvince?: string | null
+ tags?: string[] | null
+ timezone?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "location_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "location_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "location_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "location_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ ]
+ }
+ maintenanceDispatch: {
+ Row: {
+ actualEndTime: string | null
+ actualFailureModeId: string | null
+ actualStartTime: string | null
+ assignee: string | null
+ companyId: string
+ completedAt: string | null
+ content: Json
+ createdAt: string
+ createdBy: string
+ duration: number | null
+ id: string
+ locationId: string | null
+ maintenanceDispatchId: string
+ maintenanceScheduleId: string | null
+ nonConformanceId: string | null
+ oeeImpact: Database["public"]["Enums"]["oeeImpact"]
+ plannedEndTime: string | null
+ plannedStartTime: string | null
+ priority: Database["public"]["Enums"]["maintenanceDispatchPriority"]
+ procedureId: string | null
+ severity: Database["public"]["Enums"]["maintenanceSeverity"]
+ source: Database["public"]["Enums"]["maintenanceSource"]
+ status: Database["public"]["Enums"]["maintenanceDispatchStatus"]
+ suspectedFailureModeId: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ workCenterId: string | null
+ }
+ Insert: {
+ actualEndTime?: string | null
+ actualFailureModeId?: string | null
+ actualStartTime?: string | null
+ assignee?: string | null
+ companyId: string
+ completedAt?: string | null
+ content?: Json
+ createdAt?: string
+ createdBy: string
+ duration?: number | null
+ id?: string
+ locationId?: string | null
+ maintenanceDispatchId: string
+ maintenanceScheduleId?: string | null
+ nonConformanceId?: string | null
+ oeeImpact?: Database["public"]["Enums"]["oeeImpact"]
+ plannedEndTime?: string | null
+ plannedStartTime?: string | null
+ priority?: Database["public"]["Enums"]["maintenanceDispatchPriority"]
+ procedureId?: string | null
+ severity: Database["public"]["Enums"]["maintenanceSeverity"]
+ source?: Database["public"]["Enums"]["maintenanceSource"]
+ status?: Database["public"]["Enums"]["maintenanceDispatchStatus"]
+ suspectedFailureModeId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ workCenterId?: string | null
+ }
+ Update: {
+ actualEndTime?: string | null
+ actualFailureModeId?: string | null
+ actualStartTime?: string | null
+ assignee?: string | null
+ companyId?: string
+ completedAt?: string | null
+ content?: Json
+ createdAt?: string
+ createdBy?: string
+ duration?: number | null
+ id?: string
+ locationId?: string | null
+ maintenanceDispatchId?: string
+ maintenanceScheduleId?: string | null
+ nonConformanceId?: string | null
+ oeeImpact?: Database["public"]["Enums"]["oeeImpact"]
+ plannedEndTime?: string | null
+ plannedStartTime?: string | null
+ priority?: Database["public"]["Enums"]["maintenanceDispatchPriority"]
+ procedureId?: string | null
+ severity?: Database["public"]["Enums"]["maintenanceSeverity"]
+ source?: Database["public"]["Enums"]["maintenanceSource"]
+ status?: Database["public"]["Enums"]["maintenanceDispatchStatus"]
+ suspectedFailureModeId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ workCenterId?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "maintenanceDispatch_actualFailureModeId_fkey"
+ columns: ["actualFailureModeId"]
+ isOneToOne: false
+ referencedRelation: "maintenanceFailureMode"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_maintenanceScheduleId_fkey"
+ columns: ["maintenanceScheduleId"]
+ isOneToOne: false
+ referencedRelation: "maintenanceSchedule"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_maintenanceScheduleId_fkey"
+ columns: ["maintenanceScheduleId"]
+ isOneToOne: false
+ referencedRelation: "maintenanceSchedules"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "issues"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "nonConformance"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_procedureId_fkey"
+ columns: ["procedureId"]
+ isOneToOne: false
+ referencedRelation: "procedure"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_procedureId_fkey"
+ columns: ["procedureId"]
+ isOneToOne: false
+ referencedRelation: "procedures"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_suspectedFailureModeId_fkey"
+ columns: ["suspectedFailureModeId"]
+ isOneToOne: false
+ referencedRelation: "maintenanceFailureMode"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "riskRegisters"
+ referencedColumns: ["workCenterId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenter"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenters"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ maintenanceDispatchComment: {
+ Row: {
+ comment: string
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ maintenanceDispatchId: string
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ comment: string
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ maintenanceDispatchId: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ comment?: string
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ maintenanceDispatchId?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "maintenanceDispatchComment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchComment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchComment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchComment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchComment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchComment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchComment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchComment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchComment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchComment_maintenanceDispatchId_fkey"
+ columns: ["maintenanceDispatchId"]
+ isOneToOne: false
+ referencedRelation: "activeMaintenanceDispatchesByLocation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchComment_maintenanceDispatchId_fkey"
+ columns: ["maintenanceDispatchId"]
+ isOneToOne: false
+ referencedRelation: "maintenanceDispatch"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchComment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchComment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchComment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchComment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchComment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ maintenanceDispatchEvent: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ duration: number | null
+ employeeId: string
+ endTime: string | null
+ id: string
+ maintenanceDispatchId: string
+ notes: string | null
+ startTime: string
+ updatedAt: string | null
+ updatedBy: string | null
+ workCenterId: string
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ duration?: number | null
+ employeeId: string
+ endTime?: string | null
+ id?: string
+ maintenanceDispatchId: string
+ notes?: string | null
+ startTime: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ workCenterId: string
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ duration?: number | null
+ employeeId?: string
+ endTime?: string | null
+ id?: string
+ maintenanceDispatchId?: string
+ notes?: string | null
+ startTime?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ workCenterId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "maintenanceDispatchEvent_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchEvent_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchEvent_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchEvent_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchEvent_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchEvent_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchEvent_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchEvent_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchEvent_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchEvent_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchEvent_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchEvent_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchEvent_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchEvent_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchEvent_maintenanceDispatchId_fkey"
+ columns: ["maintenanceDispatchId"]
+ isOneToOne: false
+ referencedRelation: "activeMaintenanceDispatchesByLocation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchEvent_maintenanceDispatchId_fkey"
+ columns: ["maintenanceDispatchId"]
+ isOneToOne: false
+ referencedRelation: "maintenanceDispatch"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchEvent_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchEvent_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchEvent_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchEvent_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchEvent_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchEvent_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "riskRegisters"
+ referencedColumns: ["workCenterId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchEvent_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenter"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchEvent_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenters"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchEvent_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ maintenanceDispatchItem: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ itemId: string
+ maintenanceDispatchId: string
+ quantity: number
+ totalCost: number | null
+ unitCost: number | null
+ unitOfMeasureCode: string
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ itemId: string
+ maintenanceDispatchId: string
+ quantity: number
+ totalCost?: number | null
+ unitCost?: number | null
+ unitOfMeasureCode: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ itemId?: string
+ maintenanceDispatchId?: string
+ quantity?: number
+ totalCost?: number | null
+ unitCost?: number | null
+ unitOfMeasureCode?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "maintenanceDispatchItem_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItem_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItem_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItem_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItem_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItem_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItem_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItem_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItem_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItem_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItem_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItem_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItem_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItem_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItem_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItem_maintenanceDispatchId_fkey"
+ columns: ["maintenanceDispatchId"]
+ isOneToOne: false
+ referencedRelation: "activeMaintenanceDispatchesByLocation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItem_maintenanceDispatchId_fkey"
+ columns: ["maintenanceDispatchId"]
+ isOneToOne: false
+ referencedRelation: "maintenanceDispatch"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItem_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItem_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItem_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItem_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItem_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ maintenanceDispatchItemTrackedEntity: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ maintenanceDispatchItemId: string
+ quantity: number
+ trackedEntityId: string
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ maintenanceDispatchItemId: string
+ quantity?: number
+ trackedEntityId: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ maintenanceDispatchItemId?: string
+ quantity?: number
+ trackedEntityId?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "maintenanceDispatchItemTrackedEntity_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItemTrackedEntity_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItemTrackedEntity_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItemTrackedEntity_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItemTrackedEntity_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItemTrackedEntity_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItemTrackedEntity_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItemTrackedEntity_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItemTrackedEntity_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItemTrackedEntity_maintenanceDispatchItemId_"
+ columns: ["maintenanceDispatchItemId"]
+ isOneToOne: false
+ referencedRelation: "maintenanceDispatchItem"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItemTrackedEntity_trackedEntityId_fkey"
+ columns: ["trackedEntityId"]
+ isOneToOne: false
+ referencedRelation: "trackedEntity"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItemTrackedEntity_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItemTrackedEntity_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItemTrackedEntity_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItemTrackedEntity_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchItemTrackedEntity_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ maintenanceDispatchWorkCenter: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ maintenanceDispatchId: string
+ updatedAt: string | null
+ updatedBy: string | null
+ workCenterId: string
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ maintenanceDispatchId: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ workCenterId: string
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ maintenanceDispatchId?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ workCenterId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "maintenanceDispatchWorkCenter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchWorkCenter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchWorkCenter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchWorkCenter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchWorkCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchWorkCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchWorkCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchWorkCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchWorkCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchWorkCenter_maintenanceDispatchId_fkey"
+ columns: ["maintenanceDispatchId"]
+ isOneToOne: false
+ referencedRelation: "activeMaintenanceDispatchesByLocation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchWorkCenter_maintenanceDispatchId_fkey"
+ columns: ["maintenanceDispatchId"]
+ isOneToOne: false
+ referencedRelation: "maintenanceDispatch"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchWorkCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchWorkCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchWorkCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchWorkCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchWorkCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchWorkCenter_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "riskRegisters"
+ referencedColumns: ["workCenterId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchWorkCenter_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenter"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchWorkCenter_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenters"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatchWorkCenter_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ maintenanceFailureMode: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ name: string
+ type: Database["public"]["Enums"]["maintenanceFailureModeType"]
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ name: string
+ type?: Database["public"]["Enums"]["maintenanceFailureModeType"]
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ name?: string
+ type?: Database["public"]["Enums"]["maintenanceFailureModeType"]
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "maintenanceFailureMode_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceFailureMode_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceFailureMode_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "maintenanceFailureMode_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "maintenanceFailureMode_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceFailureMode_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceFailureMode_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceFailureMode_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceFailureMode_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "maintenanceFailureMode_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceFailureMode_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceFailureMode_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceFailureMode_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceFailureMode_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ maintenanceSchedule: {
+ Row: {
+ active: boolean
+ companyId: string
+ createdAt: string
+ createdBy: string
+ description: string | null
+ estimatedDuration: number | null
+ frequency: Database["public"]["Enums"]["maintenanceFrequency"]
+ friday: boolean
+ id: string
+ lastGeneratedAt: string | null
+ locationId: string | null
+ monday: boolean
+ name: string
+ nextDueAt: string | null
+ priority: Database["public"]["Enums"]["maintenanceDispatchPriority"]
+ procedureId: string | null
+ saturday: boolean
+ skipHolidays: boolean
+ sunday: boolean
+ thursday: boolean
+ tuesday: boolean
+ updatedAt: string | null
+ updatedBy: string | null
+ wednesday: boolean
+ workCenterId: string
+ }
+ Insert: {
+ active?: boolean
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ description?: string | null
+ estimatedDuration?: number | null
+ frequency: Database["public"]["Enums"]["maintenanceFrequency"]
+ friday?: boolean
+ id?: string
+ lastGeneratedAt?: string | null
+ locationId?: string | null
+ monday?: boolean
+ name: string
+ nextDueAt?: string | null
+ priority?: Database["public"]["Enums"]["maintenanceDispatchPriority"]
+ procedureId?: string | null
+ saturday?: boolean
+ skipHolidays?: boolean
+ sunday?: boolean
+ thursday?: boolean
+ tuesday?: boolean
+ updatedAt?: string | null
+ updatedBy?: string | null
+ wednesday?: boolean
+ workCenterId: string
+ }
+ Update: {
+ active?: boolean
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ description?: string | null
+ estimatedDuration?: number | null
+ frequency?: Database["public"]["Enums"]["maintenanceFrequency"]
+ friday?: boolean
+ id?: string
+ lastGeneratedAt?: string | null
+ locationId?: string | null
+ monday?: boolean
+ name?: string
+ nextDueAt?: string | null
+ priority?: Database["public"]["Enums"]["maintenanceDispatchPriority"]
+ procedureId?: string | null
+ saturday?: boolean
+ skipHolidays?: boolean
+ sunday?: boolean
+ thursday?: boolean
+ tuesday?: boolean
+ updatedAt?: string | null
+ updatedBy?: string | null
+ wednesday?: boolean
+ workCenterId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "maintenanceSchedule_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_procedureId_fkey"
+ columns: ["procedureId"]
+ isOneToOne: false
+ referencedRelation: "procedure"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_procedureId_fkey"
+ columns: ["procedureId"]
+ isOneToOne: false
+ referencedRelation: "procedures"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "riskRegisters"
+ referencedColumns: ["workCenterId"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenter"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenters"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ maintenanceScheduleItem: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ itemId: string
+ maintenanceScheduleId: string
+ quantity: number
+ unitOfMeasureCode: string
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ itemId: string
+ maintenanceScheduleId: string
+ quantity: number
+ unitOfMeasureCode: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ itemId?: string
+ maintenanceScheduleId?: string
+ quantity?: number
+ unitOfMeasureCode?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "maintenanceScheduleItem_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceScheduleItem_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceScheduleItem_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "maintenanceScheduleItem_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "maintenanceScheduleItem_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceScheduleItem_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceScheduleItem_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceScheduleItem_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceScheduleItem_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "maintenanceScheduleItem_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceScheduleItem_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceScheduleItem_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceScheduleItem_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceScheduleItem_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceScheduleItem_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceScheduleItem_maintenanceScheduleId_fkey"
+ columns: ["maintenanceScheduleId"]
+ isOneToOne: false
+ referencedRelation: "maintenanceSchedule"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceScheduleItem_maintenanceScheduleId_fkey"
+ columns: ["maintenanceScheduleId"]
+ isOneToOne: false
+ referencedRelation: "maintenanceSchedules"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceScheduleItem_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceScheduleItem_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceScheduleItem_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceScheduleItem_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceScheduleItem_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ makeMethod: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ id: string
+ itemId: string
+ status: Database["public"]["Enums"]["makeMethodStatus"]
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ version: number
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ id?: string
+ itemId: string
+ status?: Database["public"]["Enums"]["makeMethodStatus"]
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ version?: number
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ id?: string
+ itemId?: string
+ status?: Database["public"]["Enums"]["makeMethodStatus"]
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ version?: number
+ }
+ Relationships: [
+ {
+ foreignKeyName: "method_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "method_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "method_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "method_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "method_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "method_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "method_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "method_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "method_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "method_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "method_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "method_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "method_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "method_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "method_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ material: {
+ Row: {
+ approved: boolean
+ approvedBy: string | null
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ dimensionId: string | null
+ finishId: string | null
+ gradeId: string | null
+ id: string
+ materialFormId: string | null
+ materialSubstanceId: string | null
+ materialTypeId: string | null
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ approved?: boolean
+ approvedBy?: string | null
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ dimensionId?: string | null
+ finishId?: string | null
+ gradeId?: string | null
+ id?: string
+ materialFormId?: string | null
+ materialSubstanceId?: string | null
+ materialTypeId?: string | null
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ approved?: boolean
+ approvedBy?: string | null
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ dimensionId?: string | null
+ finishId?: string | null
+ gradeId?: string | null
+ id?: string
+ materialFormId?: string | null
+ materialSubstanceId?: string | null
+ materialTypeId?: string | null
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "material_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "material_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "material_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "material_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "material_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "material_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "material_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "material_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "material_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "material_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "material_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "material_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "material_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "material_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "material_dimensionId_fkey"
+ columns: ["dimensionId"]
+ isOneToOne: false
+ referencedRelation: "materialDimension"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "material_dimensionId_fkey"
+ columns: ["dimensionId"]
+ isOneToOne: false
+ referencedRelation: "materialDimensions"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "material_finishId_fkey"
+ columns: ["finishId"]
+ isOneToOne: false
+ referencedRelation: "materialFinish"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "material_finishId_fkey"
+ columns: ["finishId"]
+ isOneToOne: false
+ referencedRelation: "materialFinishes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "material_gradeId_fkey"
+ columns: ["gradeId"]
+ isOneToOne: false
+ referencedRelation: "materialGrade"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "material_gradeId_fkey"
+ columns: ["gradeId"]
+ isOneToOne: false
+ referencedRelation: "materialGrades"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "material_materialFormId_fkey"
+ columns: ["materialFormId"]
+ isOneToOne: false
+ referencedRelation: "materialForm"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "material_materialSubstanceId_fkey"
+ columns: ["materialSubstanceId"]
+ isOneToOne: false
+ referencedRelation: "materialSubstance"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "material_materialTypeId_fkey"
+ columns: ["materialTypeId"]
+ isOneToOne: false
+ referencedRelation: "materialType"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "material_materialTypeId_fkey"
+ columns: ["materialTypeId"]
+ isOneToOne: false
+ referencedRelation: "materialTypes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "material_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "material_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "material_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "material_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "material_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ materialDimension: {
+ Row: {
+ companyId: string | null
+ id: string
+ isMetric: boolean
+ materialFormId: string
+ name: string
+ }
+ Insert: {
+ companyId?: string | null
+ id?: string
+ isMetric?: boolean
+ materialFormId: string
+ name: string
+ }
+ Update: {
+ companyId?: string | null
+ id?: string
+ isMetric?: boolean
+ materialFormId?: string
+ name?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "materialDimensions_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialDimensions_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialDimensions_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "materialDimensions_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "materialDimensions_materialFormId_fkey"
+ columns: ["materialFormId"]
+ isOneToOne: false
+ referencedRelation: "materialForm"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ materialFinish: {
+ Row: {
+ companyId: string | null
+ id: string
+ materialSubstanceId: string
+ name: string
+ }
+ Insert: {
+ companyId?: string | null
+ id?: string
+ materialSubstanceId: string
+ name: string
+ }
+ Update: {
+ companyId?: string | null
+ id?: string
+ materialSubstanceId?: string
+ name?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "materialFinish_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialFinish_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialFinish_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "materialFinish_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "materialFinish_materialSubstanceId_fkey"
+ columns: ["materialSubstanceId"]
+ isOneToOne: false
+ referencedRelation: "materialSubstance"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ materialForm: {
+ Row: {
+ code: string
+ companyId: string | null
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ id: string
+ name: string
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ code: string
+ companyId?: string | null
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ id?: string
+ name: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ code?: string
+ companyId?: string | null
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ id?: string
+ name?: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "materialForm_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialForm_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialForm_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "materialForm_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "materialForm_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialForm_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialForm_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialForm_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialForm_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "materialForm_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialForm_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialForm_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialForm_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialForm_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ materialGrade: {
+ Row: {
+ companyId: string | null
+ id: string
+ materialSubstanceId: string
+ name: string
+ }
+ Insert: {
+ companyId?: string | null
+ id?: string
+ materialSubstanceId: string
+ name: string
+ }
+ Update: {
+ companyId?: string | null
+ id?: string
+ materialSubstanceId?: string
+ name?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "materialGrade_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialGrade_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialGrade_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "materialGrade_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "materialGrade_materialSubstanceId_fkey"
+ columns: ["materialSubstanceId"]
+ isOneToOne: false
+ referencedRelation: "materialSubstance"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ materialSubstance: {
+ Row: {
+ code: string
+ companyId: string | null
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ id: string
+ name: string
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ code: string
+ companyId?: string | null
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ id?: string
+ name: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ code?: string
+ companyId?: string | null
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ id?: string
+ name?: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "materialSubstance_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialSubstance_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialSubstance_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "materialSubstance_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "materialSubstance_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialSubstance_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialSubstance_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialSubstance_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialSubstance_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "materialSubstance_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialSubstance_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialSubstance_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialSubstance_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialSubstance_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ materialType: {
+ Row: {
+ code: string
+ companyId: string | null
+ id: string
+ materialFormId: string
+ materialSubstanceId: string
+ name: string
+ }
+ Insert: {
+ code: string
+ companyId?: string | null
+ id?: string
+ materialFormId: string
+ materialSubstanceId: string
+ name: string
+ }
+ Update: {
+ code?: string
+ companyId?: string | null
+ id?: string
+ materialFormId?: string
+ materialSubstanceId?: string
+ name?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "materialType_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialType_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialType_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "materialType_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "materialType_materialFormId_fkey"
+ columns: ["materialFormId"]
+ isOneToOne: false
+ referencedRelation: "materialForm"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialType_materialSubstanceId_fkey"
+ columns: ["materialSubstanceId"]
+ isOneToOne: false
+ referencedRelation: "materialSubstance"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ membership: {
+ Row: {
+ groupId: string
+ id: number
+ memberGroupId: string | null
+ memberUserId: string | null
+ }
+ Insert: {
+ groupId: string
+ id?: number
+ memberGroupId?: string | null
+ memberUserId?: string | null
+ }
+ Update: {
+ groupId?: string
+ id?: number
+ memberGroupId?: string | null
+ memberUserId?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "membership_groupId_fkey"
+ columns: ["groupId"]
+ isOneToOne: false
+ referencedRelation: "group"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "membership_memberGroupId_fkey"
+ columns: ["memberGroupId"]
+ isOneToOne: false
+ referencedRelation: "group"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "membership_memberUserId_fkey"
+ columns: ["memberUserId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "membership_memberUserId_fkey"
+ columns: ["memberUserId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "membership_memberUserId_fkey"
+ columns: ["memberUserId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "membership_memberUserId_fkey"
+ columns: ["memberUserId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "membership_memberUserId_fkey"
+ columns: ["memberUserId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ methodMaterial: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ id: string
+ itemId: string
+ itemType: string
+ kit: boolean
+ makeMethodId: string
+ materialMakeMethodId: string | null
+ methodOperationId: string | null
+ methodType: Database["public"]["Enums"]["methodType"]
+ order: number
+ productionQuantity: number | null
+ quantity: number
+ scrapQuantity: number
+ sourcingType: Database["public"]["Enums"]["sourcingType"]
+ storageUnitIds: Json
+ tags: string[] | null
+ unitOfMeasureCode: string
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ id?: string
+ itemId: string
+ itemType?: string
+ kit?: boolean
+ makeMethodId: string
+ materialMakeMethodId?: string | null
+ methodOperationId?: string | null
+ methodType?: Database["public"]["Enums"]["methodType"]
+ order?: number
+ productionQuantity?: number | null
+ quantity: number
+ scrapQuantity?: number
+ sourcingType?: Database["public"]["Enums"]["sourcingType"]
+ storageUnitIds?: Json
+ tags?: string[] | null
+ unitOfMeasureCode: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ id?: string
+ itemId?: string
+ itemType?: string
+ kit?: boolean
+ makeMethodId?: string
+ materialMakeMethodId?: string | null
+ methodOperationId?: string | null
+ methodType?: Database["public"]["Enums"]["methodType"]
+ order?: number
+ productionQuantity?: number | null
+ quantity?: number
+ scrapQuantity?: number
+ sourcingType?: Database["public"]["Enums"]["sourcingType"]
+ storageUnitIds?: Json
+ tags?: string[] | null
+ unitOfMeasureCode?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "methodMaterial_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodMaterial_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodMaterial_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "methodMaterial_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "methodMaterial_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodMaterial_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodMaterial_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodMaterial_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodMaterial_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "methodMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodMaterial_materialMakeMethodId_fkey"
+ columns: ["materialMakeMethodId"]
+ isOneToOne: false
+ referencedRelation: "activeMakeMethods"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodMaterial_materialMakeMethodId_fkey"
+ columns: ["materialMakeMethodId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithMakeMethods"
+ referencedColumns: ["makeMethodId"]
+ },
+ {
+ foreignKeyName: "methodMaterial_materialMakeMethodId_fkey"
+ columns: ["materialMakeMethodId"]
+ isOneToOne: false
+ referencedRelation: "makeMethod"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodMaterial_materialMakeMethodId_fkey"
+ columns: ["materialMakeMethodId"]
+ isOneToOne: false
+ referencedRelation: "quoteOperationsWithMakeMethods"
+ referencedColumns: ["makeMethodId"]
+ },
+ {
+ foreignKeyName: "methodMaterial_methodId_fkey"
+ columns: ["makeMethodId"]
+ isOneToOne: false
+ referencedRelation: "activeMakeMethods"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodMaterial_methodId_fkey"
+ columns: ["makeMethodId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithMakeMethods"
+ referencedColumns: ["makeMethodId"]
+ },
+ {
+ foreignKeyName: "methodMaterial_methodId_fkey"
+ columns: ["makeMethodId"]
+ isOneToOne: false
+ referencedRelation: "makeMethod"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodMaterial_methodId_fkey"
+ columns: ["makeMethodId"]
+ isOneToOne: false
+ referencedRelation: "quoteOperationsWithMakeMethods"
+ referencedColumns: ["makeMethodId"]
+ },
+ {
+ foreignKeyName: "methodMaterial_methodOperation_fkey"
+ columns: ["methodOperationId"]
+ isOneToOne: false
+ referencedRelation: "methodOperation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodMaterial_unitOfMeasureCode_fkey"
+ columns: ["unitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "methodMaterial_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodMaterial_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodMaterial_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodMaterial_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodMaterial_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ methodOperation: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ description: string
+ id: string
+ laborTime: number
+ laborUnit: Database["public"]["Enums"]["factor"]
+ machineTime: number
+ machineUnit: Database["public"]["Enums"]["factor"]
+ makeMethodId: string
+ operationLeadTime: number | null
+ operationMinimumCost: number | null
+ operationOrder: Database["public"]["Enums"]["methodOperationOrder"]
+ operationSupplierProcessId: string | null
+ operationType: Database["public"]["Enums"]["operationType"]
+ operationUnitCost: number | null
+ order: number
+ procedureId: string | null
+ processId: string
+ setupTime: number
+ setupUnit: Database["public"]["Enums"]["factor"]
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ workCenterId: string | null
+ workInstruction: Json
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ description: string
+ id?: string
+ laborTime?: number
+ laborUnit?: Database["public"]["Enums"]["factor"]
+ machineTime?: number
+ machineUnit?: Database["public"]["Enums"]["factor"]
+ makeMethodId: string
+ operationLeadTime?: number | null
+ operationMinimumCost?: number | null
+ operationOrder?: Database["public"]["Enums"]["methodOperationOrder"]
+ operationSupplierProcessId?: string | null
+ operationType?: Database["public"]["Enums"]["operationType"]
+ operationUnitCost?: number | null
+ order?: number
+ procedureId?: string | null
+ processId: string
+ setupTime?: number
+ setupUnit?: Database["public"]["Enums"]["factor"]
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ workCenterId?: string | null
+ workInstruction?: Json
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ description?: string
+ id?: string
+ laborTime?: number
+ laborUnit?: Database["public"]["Enums"]["factor"]
+ machineTime?: number
+ machineUnit?: Database["public"]["Enums"]["factor"]
+ makeMethodId?: string
+ operationLeadTime?: number | null
+ operationMinimumCost?: number | null
+ operationOrder?: Database["public"]["Enums"]["methodOperationOrder"]
+ operationSupplierProcessId?: string | null
+ operationType?: Database["public"]["Enums"]["operationType"]
+ operationUnitCost?: number | null
+ order?: number
+ procedureId?: string | null
+ processId?: string
+ setupTime?: number
+ setupUnit?: Database["public"]["Enums"]["factor"]
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ workCenterId?: string | null
+ workInstruction?: Json
+ }
+ Relationships: [
+ {
+ foreignKeyName: "methodOperation_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperation_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperation_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "methodOperation_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "methodOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "methodOperation_methodId_fkey"
+ columns: ["makeMethodId"]
+ isOneToOne: false
+ referencedRelation: "activeMakeMethods"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperation_methodId_fkey"
+ columns: ["makeMethodId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithMakeMethods"
+ referencedColumns: ["makeMethodId"]
+ },
+ {
+ foreignKeyName: "methodOperation_methodId_fkey"
+ columns: ["makeMethodId"]
+ isOneToOne: false
+ referencedRelation: "makeMethod"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperation_methodId_fkey"
+ columns: ["makeMethodId"]
+ isOneToOne: false
+ referencedRelation: "quoteOperationsWithMakeMethods"
+ referencedColumns: ["makeMethodId"]
+ },
+ {
+ foreignKeyName: "methodOperation_procedureId_fkey"
+ columns: ["procedureId"]
+ isOneToOne: false
+ referencedRelation: "procedure"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperation_procedureId_fkey"
+ columns: ["procedureId"]
+ isOneToOne: false
+ referencedRelation: "procedures"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperation_processId_fkey"
+ columns: ["processId"]
+ isOneToOne: false
+ referencedRelation: "process"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperation_processId_fkey"
+ columns: ["processId"]
+ isOneToOne: false
+ referencedRelation: "processes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "methodOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "riskRegisters"
+ referencedColumns: ["workCenterId"]
+ },
+ {
+ foreignKeyName: "methodOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenter"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenters"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_operationSupplierProcessId_fkey"
+ columns: ["operationSupplierProcessId"]
+ isOneToOne: false
+ referencedRelation: "supplierProcess"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_operationSupplierProcessId_fkey"
+ columns: ["operationSupplierProcessId"]
+ isOneToOne: false
+ referencedRelation: "supplierProcesses"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ methodOperationParameter: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ key: string
+ operationId: string
+ updatedAt: string | null
+ updatedBy: string | null
+ value: string
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ key: string
+ operationId: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ value: string
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ key?: string
+ operationId?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ value?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "methodOperationParameter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationParameter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationParameter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationParameter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationParameter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "methodOperationParameter_operationId_fkey"
+ columns: ["operationId"]
+ isOneToOne: false
+ referencedRelation: "methodOperation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationParameter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationParameter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationParameter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationParameter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationParameter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ methodOperationStep: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ description: Json | null
+ fileTypes: string[] | null
+ id: string
+ listValues: string[] | null
+ maxValue: number | null
+ minValue: number | null
+ name: string
+ operationId: string
+ required: boolean | null
+ sortOrder: number
+ type: Database["public"]["Enums"]["procedureStepType"]
+ unitOfMeasureCode: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ description?: Json | null
+ fileTypes?: string[] | null
+ id?: string
+ listValues?: string[] | null
+ maxValue?: number | null
+ minValue?: number | null
+ name: string
+ operationId: string
+ required?: boolean | null
+ sortOrder?: number
+ type: Database["public"]["Enums"]["procedureStepType"]
+ unitOfMeasureCode?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ description?: Json | null
+ fileTypes?: string[] | null
+ id?: string
+ listValues?: string[] | null
+ maxValue?: number | null
+ minValue?: number | null
+ name?: string
+ operationId?: string
+ required?: boolean | null
+ sortOrder?: number
+ type?: Database["public"]["Enums"]["procedureStepType"]
+ unitOfMeasureCode?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "methodOperationAttribute_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationAttribute_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationAttribute_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationAttribute_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationAttribute_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "methodOperationAttribute_operationId_fkey"
+ columns: ["operationId"]
+ isOneToOne: false
+ referencedRelation: "methodOperation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationAttribute_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationAttribute_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationAttribute_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationAttribute_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationAttribute_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ methodOperationTool: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ operationId: string
+ quantity: number
+ toolId: string
+ updatedAt: string
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ operationId: string
+ quantity?: number
+ toolId: string
+ updatedAt?: string
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ operationId?: string
+ quantity?: number
+ toolId?: string
+ updatedAt?: string
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "methodOperationTool_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationTool_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationTool_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "methodOperationTool_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "methodOperationTool_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationTool_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationTool_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationTool_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationTool_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "methodOperationTool_operationId_fkey"
+ columns: ["operationId"]
+ isOneToOne: false
+ referencedRelation: "methodOperation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationTool_toolId_fkey"
+ columns: ["toolId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationTool_toolId_fkey"
+ columns: ["toolId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationTool_toolId_fkey"
+ columns: ["toolId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationTool_toolId_fkey"
+ columns: ["toolId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationTool_toolId_fkey"
+ columns: ["toolId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationTool_toolId_fkey"
+ columns: ["toolId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationTool_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationTool_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationTool_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationTool_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "methodOperationTool_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ modelUpload: {
+ Row: {
+ autodeskUrn: string | null
+ companyId: string
+ createdAt: string | null
+ createdBy: string
+ id: string
+ modelPath: string
+ name: string | null
+ size: number | null
+ thumbnailPath: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ autodeskUrn?: string | null
+ companyId: string
+ createdAt?: string | null
+ createdBy: string
+ id?: string
+ modelPath: string
+ name?: string | null
+ size?: number | null
+ thumbnailPath?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ autodeskUrn?: string | null
+ companyId?: string
+ createdAt?: string | null
+ createdBy?: string
+ id?: string
+ modelPath?: string
+ name?: string | null
+ size?: number | null
+ thumbnailPath?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "modelUpload_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "modelUpload_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "modelUpload_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "modelUpload_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "modelUpload_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "modelUpload_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "modelUpload_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "modelUpload_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "modelUpload_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "modelUpload_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "modelUpload_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "modelUpload_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "modelUpload_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "modelUpload_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ nonConformance: {
+ Row: {
+ approvalRequirements:
+ | Database["public"]["Enums"]["nonConformanceApproval"][]
+ | null
+ assignee: string | null
+ closeDate: string | null
+ companyId: string | null
+ content: Json
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ description: string | null
+ dueDate: string | null
+ id: string
+ locationId: string
+ name: string
+ nonConformanceId: string
+ nonConformanceTypeId: string
+ nonConformanceWorkflowId: string | null
+ openDate: string
+ priority: Database["public"]["Enums"]["nonConformancePriority"] | null
+ quantity: number
+ requiredActionIds: string[] | null
+ source: Database["public"]["Enums"]["nonConformanceSource"]
+ status: Database["public"]["Enums"]["nonConformanceStatus"]
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ approvalRequirements?:
+ | Database["public"]["Enums"]["nonConformanceApproval"][]
+ | null
+ assignee?: string | null
+ closeDate?: string | null
+ companyId?: string | null
+ content?: Json
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ description?: string | null
+ dueDate?: string | null
+ id?: string
+ locationId: string
+ name: string
+ nonConformanceId: string
+ nonConformanceTypeId: string
+ nonConformanceWorkflowId?: string | null
+ openDate: string
+ priority?:
+ | Database["public"]["Enums"]["nonConformancePriority"]
+ | null
+ quantity?: number
+ requiredActionIds?: string[] | null
+ source: Database["public"]["Enums"]["nonConformanceSource"]
+ status?: Database["public"]["Enums"]["nonConformanceStatus"]
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ approvalRequirements?:
+ | Database["public"]["Enums"]["nonConformanceApproval"][]
+ | null
+ assignee?: string | null
+ closeDate?: string | null
+ companyId?: string | null
+ content?: Json
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ description?: string | null
+ dueDate?: string | null
+ id?: string
+ locationId?: string
+ name?: string
+ nonConformanceId?: string
+ nonConformanceTypeId?: string
+ nonConformanceWorkflowId?: string | null
+ openDate?: string
+ priority?:
+ | Database["public"]["Enums"]["nonConformancePriority"]
+ | null
+ quantity?: number
+ requiredActionIds?: string[] | null
+ source?: Database["public"]["Enums"]["nonConformanceSource"]
+ status?: Database["public"]["Enums"]["nonConformanceStatus"]
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "nonConformance_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "nonConformance_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformance_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformance_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "nonConformance_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_nonConformanceTypeId_fkey"
+ columns: ["nonConformanceTypeId"]
+ isOneToOne: false
+ referencedRelation: "nonConformanceType"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_nonConformanceWorkflowId_fkey"
+ columns: ["nonConformanceWorkflowId"]
+ isOneToOne: false
+ referencedRelation: "nonConformanceWorkflow"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ nonConformanceActionProcess: {
+ Row: {
+ actionTaskId: string
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ processId: string
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ actionTaskId: string
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ processId: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ actionTaskId?: string
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ processId?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "nonConformanceActionProcess_actionTaskId_fkey"
+ columns: ["actionTaskId"]
+ isOneToOne: false
+ referencedRelation: "nonConformanceActionTask"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionProcess_actionTaskId_fkey"
+ columns: ["actionTaskId"]
+ isOneToOne: false
+ referencedRelation: "qualityActions"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionProcess_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionProcess_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionProcess_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionProcess_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionProcess_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionProcess_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionProcess_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionProcess_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionProcess_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionProcess_processId_fkey"
+ columns: ["processId"]
+ isOneToOne: false
+ referencedRelation: "process"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionProcess_processId_fkey"
+ columns: ["processId"]
+ isOneToOne: false
+ referencedRelation: "processes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionProcess_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionProcess_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionProcess_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionProcess_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionProcess_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ nonConformanceActionTask: {
+ Row: {
+ actionTypeId: string | null
+ assignee: string | null
+ companyId: string
+ completedDate: string | null
+ createdAt: string
+ createdBy: string
+ dueDate: string | null
+ id: string
+ nonConformanceId: string
+ notes: Json
+ sortOrder: number
+ status: Database["public"]["Enums"]["nonConformanceTaskStatus"]
+ supplierId: string | null
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ actionTypeId?: string | null
+ assignee?: string | null
+ companyId: string
+ completedDate?: string | null
+ createdAt?: string
+ createdBy: string
+ dueDate?: string | null
+ id?: string
+ nonConformanceId: string
+ notes?: Json
+ sortOrder?: number
+ status?: Database["public"]["Enums"]["nonConformanceTaskStatus"]
+ supplierId?: string | null
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ actionTypeId?: string | null
+ assignee?: string | null
+ companyId?: string
+ completedDate?: string | null
+ createdAt?: string
+ createdBy?: string
+ dueDate?: string | null
+ id?: string
+ nonConformanceId?: string
+ notes?: Json
+ sortOrder?: number
+ status?: Database["public"]["Enums"]["nonConformanceTaskStatus"]
+ supplierId?: string | null
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "nonConformanceActionTask_actionTypeId_fkey"
+ columns: ["actionTypeId"]
+ isOneToOne: false
+ referencedRelation: "nonConformanceRequiredAction"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "issues"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "nonConformance"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ nonConformanceApprovalTask: {
+ Row: {
+ approvalType:
+ | Database["public"]["Enums"]["nonConformanceApproval"]
+ | null
+ assignee: string | null
+ companyId: string
+ completedDate: string | null
+ createdAt: string
+ createdBy: string
+ dueDate: string | null
+ id: string
+ nonConformanceId: string
+ notes: Json
+ sortOrder: number
+ status: Database["public"]["Enums"]["nonConformanceTaskStatus"]
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ approvalType?:
+ | Database["public"]["Enums"]["nonConformanceApproval"]
+ | null
+ assignee?: string | null
+ companyId: string
+ completedDate?: string | null
+ createdAt?: string
+ createdBy: string
+ dueDate?: string | null
+ id?: string
+ nonConformanceId: string
+ notes?: Json
+ sortOrder?: number
+ status?: Database["public"]["Enums"]["nonConformanceTaskStatus"]
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ approvalType?:
+ | Database["public"]["Enums"]["nonConformanceApproval"]
+ | null
+ assignee?: string | null
+ companyId?: string
+ completedDate?: string | null
+ createdAt?: string
+ createdBy?: string
+ dueDate?: string | null
+ id?: string
+ nonConformanceId?: string
+ notes?: Json
+ sortOrder?: number
+ status?: Database["public"]["Enums"]["nonConformanceTaskStatus"]
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "nonConformanceApprovalTask_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceApprovalTask_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceApprovalTask_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceApprovalTask_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceApprovalTask_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "nonConformanceApprovalTask_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceApprovalTask_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceApprovalTask_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceApprovalTask_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceApprovalTask_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceApprovalTask_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceApprovalTask_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceApprovalTask_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceApprovalTask_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "nonConformanceApprovalTask_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "issues"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceApprovalTask_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "nonConformance"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceApprovalTask_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceApprovalTask_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceApprovalTask_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceApprovalTask_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceApprovalTask_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ nonConformanceCustomer: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customerId: string
+ id: string
+ nonConformanceId: string
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customerId: string
+ id?: string
+ nonConformanceId: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customerId?: string
+ id?: string
+ nonConformanceId?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "nonConformanceCustomer_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceCustomer_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceCustomer_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceCustomer_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceCustomer_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceCustomer_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceCustomer_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceCustomer_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceCustomer_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "nonConformanceCustomer_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceCustomer_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceCustomer_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceCustomer_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "issues"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceCustomer_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "nonConformance"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceCustomer_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceCustomer_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceCustomer_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceCustomer_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceCustomer_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ nonConformanceInboundInspection: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ inboundInspectionId: string
+ nonConformanceId: string
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ inboundInspectionId: string
+ nonConformanceId: string
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ inboundInspectionId?: string
+ nonConformanceId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "nonConformanceInboundInspection_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceInboundInspection_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceInboundInspection_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceInboundInspection_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceInboundInspection_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceInboundInspection_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceInboundInspection_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceInboundInspection_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceInboundInspection_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "nonConformanceInboundInspection_inboundInspectionId_fkey"
+ columns: ["inboundInspectionId"]
+ isOneToOne: false
+ referencedRelation: "inboundInspection"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceInboundInspection_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "issues"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceInboundInspection_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "nonConformance"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ nonConformanceItem: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ disposition: Database["public"]["Enums"]["disposition"] | null
+ id: string
+ itemId: string
+ nonConformanceId: string
+ quantity: number
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ disposition?: Database["public"]["Enums"]["disposition"] | null
+ id?: string
+ itemId: string
+ nonConformanceId: string
+ quantity?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ disposition?: Database["public"]["Enums"]["disposition"] | null
+ id?: string
+ itemId?: string
+ nonConformanceId?: string
+ quantity?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "nonConformanceItem_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceItem_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceItem_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceItem_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceItem_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceItem_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceItem_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceItem_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceItem_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "nonConformanceItem_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceItem_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceItem_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceItem_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceItem_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceItem_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceItem_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "issues"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceItem_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "nonConformance"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceItem_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceItem_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceItem_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceItem_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceItem_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ nonConformanceItemTrackedEntity: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ nonConformanceId: string
+ nonConformanceItemId: string
+ quantity: number
+ trackedEntityId: string
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ nonConformanceId: string
+ nonConformanceItemId: string
+ quantity?: number
+ trackedEntityId: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ nonConformanceId?: string
+ nonConformanceItemId?: string
+ quantity?: number
+ trackedEntityId?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "nciTrackedEntity_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nciTrackedEntity_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nciTrackedEntity_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nciTrackedEntity_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nciTrackedEntity_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nciTrackedEntity_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nciTrackedEntity_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nciTrackedEntity_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nciTrackedEntity_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "nciTrackedEntity_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "issues"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nciTrackedEntity_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "nonConformance"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nciTrackedEntity_nonConformanceItemId_fkey"
+ columns: ["nonConformanceItemId"]
+ isOneToOne: false
+ referencedRelation: "nonConformanceItem"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nciTrackedEntity_trackedEntityId_fkey"
+ columns: ["trackedEntityId"]
+ isOneToOne: false
+ referencedRelation: "trackedEntity"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nciTrackedEntity_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nciTrackedEntity_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nciTrackedEntity_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nciTrackedEntity_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nciTrackedEntity_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ nonConformanceJobOperation: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ jobId: string | null
+ jobOperationId: string
+ jobReadableId: string | null
+ nonConformanceId: string
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ jobId?: string | null
+ jobOperationId: string
+ jobReadableId?: string | null
+ nonConformanceId: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ jobId?: string | null
+ jobOperationId?: string
+ jobReadableId?: string | null
+ nonConformanceId?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "nonConformanceJobOperation_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceJobOperation_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceJobOperation_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceJobOperation_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceJobOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceJobOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceJobOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceJobOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceJobOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "nonConformanceJobOperation_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "job"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceJobOperation_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceJobOperation_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "openProductionOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceJobOperation_jobOperationId_fkey"
+ columns: ["jobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceJobOperation_jobOperationId_fkey"
+ columns: ["jobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithDependencies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceJobOperation_jobOperationId_fkey"
+ columns: ["jobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithMakeMethods"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceJobOperation_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "issues"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceJobOperation_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "nonConformance"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceJobOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceJobOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceJobOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceJobOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceJobOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ nonConformancePurchaseOrderLine: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ nonConformanceId: string
+ purchaseOrderId: string | null
+ purchaseOrderLineId: string
+ purchaseOrderReadableId: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ nonConformanceId: string
+ purchaseOrderId?: string | null
+ purchaseOrderLineId: string
+ purchaseOrderReadableId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ nonConformanceId?: string
+ purchaseOrderId?: string | null
+ purchaseOrderLineId?: string
+ purchaseOrderReadableId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "nonConformancePurchaseOrderLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformancePurchaseOrderLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformancePurchaseOrderLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformancePurchaseOrderLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformancePurchaseOrderLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformancePurchaseOrderLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformancePurchaseOrderLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformancePurchaseOrderLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformancePurchaseOrderLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "nonConformancePurchaseOrderLine_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "issues"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformancePurchaseOrderLine_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "nonConformance"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformancePurchaseOrderLine_purchaseOrderId_fkey"
+ columns: ["purchaseOrderId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrder"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformancePurchaseOrderLine_purchaseOrderId_fkey"
+ columns: ["purchaseOrderId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderLocations"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformancePurchaseOrderLine_purchaseOrderId_fkey"
+ columns: ["purchaseOrderId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformancePurchaseOrderLine_purchaseOrderLineId_fkey"
+ columns: ["purchaseOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "openPurchaseOrderLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformancePurchaseOrderLine_purchaseOrderLineId_fkey"
+ columns: ["purchaseOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderLine"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformancePurchaseOrderLine_purchaseOrderLineId_fkey"
+ columns: ["purchaseOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformancePurchaseOrderLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformancePurchaseOrderLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformancePurchaseOrderLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformancePurchaseOrderLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformancePurchaseOrderLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ nonConformanceReceiptLine: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ nonConformanceId: string
+ receiptId: string | null
+ receiptLineId: string
+ receiptReadableId: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ nonConformanceId: string
+ receiptId?: string | null
+ receiptLineId: string
+ receiptReadableId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ nonConformanceId?: string
+ receiptId?: string | null
+ receiptLineId?: string
+ receiptReadableId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "nonConformanceReceiptLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceReceiptLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceReceiptLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceReceiptLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceReceiptLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceReceiptLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceReceiptLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceReceiptLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceReceiptLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "nonConformanceReceiptLine_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "issues"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceReceiptLine_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "nonConformance"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceReceiptLine_receiptId_fkey"
+ columns: ["receiptId"]
+ isOneToOne: false
+ referencedRelation: "receipt"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceReceiptLine_receiptId_fkey"
+ columns: ["receiptId"]
+ isOneToOne: false
+ referencedRelation: "receipts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceReceiptLine_receiptLineId_fkey"
+ columns: ["receiptLineId"]
+ isOneToOne: false
+ referencedRelation: "receiptLine"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceReceiptLine_receiptLineId_fkey"
+ columns: ["receiptLineId"]
+ isOneToOne: false
+ referencedRelation: "receiptLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceReceiptLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceReceiptLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceReceiptLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceReceiptLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceReceiptLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ nonConformanceRequiredAction: {
+ Row: {
+ active: boolean
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ name: string
+ systemType:
+ | Database["public"]["Enums"]["nonConformanceSystemActionType"]
+ | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ active?: boolean
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ name: string
+ systemType?:
+ | Database["public"]["Enums"]["nonConformanceSystemActionType"]
+ | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ active?: boolean
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ name?: string
+ systemType?:
+ | Database["public"]["Enums"]["nonConformanceSystemActionType"]
+ | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "nonConformanceRequiredAction_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceRequiredAction_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceRequiredAction_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceRequiredAction_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceRequiredAction_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceRequiredAction_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceRequiredAction_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceRequiredAction_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceRequiredAction_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "nonConformanceRequiredAction_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceRequiredAction_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceRequiredAction_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceRequiredAction_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceRequiredAction_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ nonConformanceReviewer: {
+ Row: {
+ assignee: string | null
+ companyId: string
+ completedDate: string | null
+ createdAt: string
+ createdBy: string
+ id: string
+ nonConformanceId: string
+ notes: Json
+ status: Database["public"]["Enums"]["nonConformanceTaskStatus"]
+ title: string
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ assignee?: string | null
+ companyId: string
+ completedDate?: string | null
+ createdAt?: string
+ createdBy: string
+ id?: string
+ nonConformanceId: string
+ notes?: Json
+ status?: Database["public"]["Enums"]["nonConformanceTaskStatus"]
+ title: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ assignee?: string | null
+ companyId?: string
+ completedDate?: string | null
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ nonConformanceId?: string
+ notes?: Json
+ status?: Database["public"]["Enums"]["nonConformanceTaskStatus"]
+ title?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "nonConformanceReviewer_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceReviewer_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceReviewer_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceReviewer_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceReviewer_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "nonConformanceReviewer_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceReviewer_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceReviewer_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceReviewer_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceReviewer_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceReviewer_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceReviewer_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceReviewer_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceReviewer_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "nonConformanceReviewer_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "issues"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceReviewer_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "nonConformance"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceReviewer_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceReviewer_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceReviewer_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceReviewer_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceReviewer_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ nonConformanceSalesOrderLine: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ nonConformanceId: string
+ salesOrderId: string | null
+ salesOrderLineId: string
+ salesOrderReadableId: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ nonConformanceId: string
+ salesOrderId?: string | null
+ salesOrderLineId: string
+ salesOrderReadableId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ nonConformanceId?: string
+ salesOrderId?: string | null
+ salesOrderLineId?: string
+ salesOrderReadableId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "nonConformanceSalesOrderLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSalesOrderLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSalesOrderLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceSalesOrderLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceSalesOrderLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSalesOrderLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSalesOrderLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSalesOrderLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSalesOrderLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "nonConformanceSalesOrderLine_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "issues"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSalesOrderLine_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "nonConformance"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSalesOrderLine_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrder"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSalesOrderLine_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderLocations"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSalesOrderLine_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSalesOrderLine_salesOrderLineId_fkey"
+ columns: ["salesOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "openSalesOrderLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSalesOrderLine_salesOrderLineId_fkey"
+ columns: ["salesOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderLine"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSalesOrderLine_salesOrderLineId_fkey"
+ columns: ["salesOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSalesOrderLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSalesOrderLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSalesOrderLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSalesOrderLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSalesOrderLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ nonConformanceShipmentLine: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ nonConformanceId: string
+ shipmentId: string | null
+ shipmentLineId: string
+ shipmentReadableId: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ nonConformanceId: string
+ shipmentId?: string | null
+ shipmentLineId: string
+ shipmentReadableId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ nonConformanceId?: string
+ shipmentId?: string | null
+ shipmentLineId?: string
+ shipmentReadableId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "nonConformanceShipmentLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceShipmentLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceShipmentLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceShipmentLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceShipmentLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceShipmentLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceShipmentLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceShipmentLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceShipmentLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "nonConformanceShipmentLine_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "issues"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceShipmentLine_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "nonConformance"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceShipmentLine_shipmentId_fkey"
+ columns: ["shipmentId"]
+ isOneToOne: false
+ referencedRelation: "shipment"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceShipmentLine_shipmentLineId_fkey"
+ columns: ["shipmentLineId"]
+ isOneToOne: false
+ referencedRelation: "shipmentLine"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceShipmentLine_shipmentLineId_fkey"
+ columns: ["shipmentLineId"]
+ isOneToOne: false
+ referencedRelation: "shipmentLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceShipmentLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceShipmentLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceShipmentLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceShipmentLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceShipmentLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ nonConformanceSupplier: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ externalLinkId: string | null
+ id: string
+ nonConformanceId: string
+ supplierId: string
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ externalLinkId?: string | null
+ id?: string
+ nonConformanceId: string
+ supplierId: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ externalLinkId?: string | null
+ id?: string
+ nonConformanceId?: string
+ supplierId?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "nonConformanceSupplier_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSupplier_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSupplier_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceSupplier_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceSupplier_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSupplier_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSupplier_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSupplier_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSupplier_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "nonConformanceSupplier_externalLinkId_fkey"
+ columns: ["externalLinkId"]
+ isOneToOne: false
+ referencedRelation: "externalLink"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSupplier_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "issues"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSupplier_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "nonConformance"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSupplier_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "nonConformanceSupplier_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "nonConformanceSupplier_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSupplier_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSupplier_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSupplier_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSupplier_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSupplier_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSupplier_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceSupplier_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ nonConformanceTrackedEntity: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ nonConformanceId: string
+ trackedEntityId: string
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ nonConformanceId: string
+ trackedEntityId: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ nonConformanceId?: string
+ trackedEntityId?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "nonConformanceTrackedEntity_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceTrackedEntity_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceTrackedEntity_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceTrackedEntity_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceTrackedEntity_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceTrackedEntity_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceTrackedEntity_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceTrackedEntity_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceTrackedEntity_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "nonConformanceTrackedEntity_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "issues"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceTrackedEntity_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "nonConformance"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceTrackedEntity_trackedEntityId_fkey"
+ columns: ["trackedEntityId"]
+ isOneToOne: false
+ referencedRelation: "trackedEntity"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceTrackedEntity_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceTrackedEntity_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceTrackedEntity_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceTrackedEntity_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceTrackedEntity_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ nonConformanceType: {
+ Row: {
+ companyId: string | null
+ createdAt: string
+ createdBy: string
+ customFields: Json
+ id: string
+ name: string
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId?: string | null
+ createdAt?: string
+ createdBy: string
+ customFields?: Json
+ id?: string
+ name: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string | null
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json
+ id?: string
+ name?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "nonConformanceType_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceType_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceType_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceType_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceType_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceType_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceType_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceType_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceType_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "nonConformanceType_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceType_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceType_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceType_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceType_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ nonConformanceWorkflow: {
+ Row: {
+ active: boolean
+ approvalRequirements:
+ | Database["public"]["Enums"]["nonConformanceApproval"][]
+ | null
+ companyId: string
+ content: Json
+ createdAt: string
+ createdBy: string
+ description: string | null
+ id: string
+ name: string
+ priority: Database["public"]["Enums"]["nonConformancePriority"]
+ requiredActionIds: string[] | null
+ source: Database["public"]["Enums"]["nonConformanceSource"]
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ active?: boolean
+ approvalRequirements?:
+ | Database["public"]["Enums"]["nonConformanceApproval"][]
+ | null
+ companyId: string
+ content?: Json
+ createdAt?: string
+ createdBy: string
+ description?: string | null
+ id?: string
+ name: string
+ priority?: Database["public"]["Enums"]["nonConformancePriority"]
+ requiredActionIds?: string[] | null
+ source?: Database["public"]["Enums"]["nonConformanceSource"]
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ active?: boolean
+ approvalRequirements?:
+ | Database["public"]["Enums"]["nonConformanceApproval"][]
+ | null
+ companyId?: string
+ content?: Json
+ createdAt?: string
+ createdBy?: string
+ description?: string | null
+ id?: string
+ name?: string
+ priority?: Database["public"]["Enums"]["nonConformancePriority"]
+ requiredActionIds?: string[] | null
+ source?: Database["public"]["Enums"]["nonConformanceSource"]
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "nonConformanceWorkflow_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceWorkflow_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceWorkflow_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceWorkflow_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceWorkflow_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceWorkflow_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceWorkflow_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceWorkflow_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceWorkflow_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "nonConformanceWorkflow_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceWorkflow_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceWorkflow_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceWorkflow_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceWorkflow_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ noQuoteReason: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ id: string
+ name: string
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ id?: string
+ name: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ id?: string
+ name?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "noQuoteReason_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "noQuoteReason_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "noQuoteReason_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "noQuoteReason_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "noQuoteReason_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "noQuoteReason_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "noQuoteReason_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "noQuoteReason_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "noQuoteReason_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "noQuoteReason_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "noQuoteReason_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "noQuoteReason_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "noQuoteReason_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "noQuoteReason_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ note: {
+ Row: {
+ active: boolean
+ companyId: string
+ createdAt: string
+ createdBy: string
+ documentId: string
+ id: string
+ note: string
+ noteRichText: Json
+ updatedAt: string | null
+ }
+ Insert: {
+ active?: boolean
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ documentId: string
+ id?: string
+ note: string
+ noteRichText?: Json
+ updatedAt?: string | null
+ }
+ Update: {
+ active?: boolean
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ documentId?: string
+ id?: string
+ note?: string
+ noteRichText?: Json
+ updatedAt?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "notes_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "notes_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "notes_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "notes_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "notes_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "notes_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "notes_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "notes_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "notes_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ notification: {
+ Row: {
+ companyId: string
+ createdAt: string
+ description: string | null
+ digestedInto: string | null
+ documentId: string | null
+ documentType: string | null
+ event: string
+ from: string | null
+ id: string
+ payload: Json
+ readAt: string | null
+ seenAt: string | null
+ title: string
+ topic: string
+ userId: string
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ description?: string | null
+ digestedInto?: string | null
+ documentId?: string | null
+ documentType?: string | null
+ event: string
+ from?: string | null
+ id?: string
+ payload?: Json
+ readAt?: string | null
+ seenAt?: string | null
+ title: string
+ topic: string
+ userId: string
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ description?: string | null
+ digestedInto?: string | null
+ documentId?: string | null
+ documentType?: string | null
+ event?: string
+ from?: string | null
+ id?: string
+ payload?: Json
+ readAt?: string | null
+ seenAt?: string | null
+ title?: string
+ topic?: string
+ userId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "notification_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "notification_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "notification_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "notification_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "notification_digestedInto_fkey"
+ columns: ["digestedInto"]
+ isOneToOne: false
+ referencedRelation: "notification"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "notification_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "notification_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "notification_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "notification_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "notification_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ oauthClient: {
+ Row: {
+ clientId: string
+ clientSecret: string
+ companyId: string
+ createdAt: string | null
+ id: string
+ name: string
+ redirectUris: string[]
+ updatedAt: string | null
+ }
+ Insert: {
+ clientId: string
+ clientSecret: string
+ companyId: string
+ createdAt?: string | null
+ id?: string
+ name: string
+ redirectUris?: string[]
+ updatedAt?: string | null
+ }
+ Update: {
+ clientId?: string
+ clientSecret?: string
+ companyId?: string
+ createdAt?: string | null
+ id?: string
+ name?: string
+ redirectUris?: string[]
+ updatedAt?: string | null
+ }
+ Relationships: []
+ }
+ oauthCode: {
+ Row: {
+ clientId: string
+ code: string
+ companyId: string
+ createdAt: string | null
+ expiresAt: string
+ id: string
+ redirectUri: string
+ userId: string
+ }
+ Insert: {
+ clientId: string
+ code: string
+ companyId: string
+ createdAt?: string | null
+ expiresAt: string
+ id?: string
+ redirectUri: string
+ userId: string
+ }
+ Update: {
+ clientId?: string
+ code?: string
+ companyId?: string
+ createdAt?: string | null
+ expiresAt?: string
+ id?: string
+ redirectUri?: string
+ userId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "oauthCode_clientId_fkey"
+ columns: ["clientId"]
+ isOneToOne: false
+ referencedRelation: "oauthClient"
+ referencedColumns: ["clientId"]
+ },
+ {
+ foreignKeyName: "oauthCode_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "oauthCode_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "oauthCode_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "oauthCode_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "oauthCode_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "oauthCode_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "oauthCode_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "oauthCode_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "oauthCode_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ oauthToken: {
+ Row: {
+ accessToken: string
+ clientId: string
+ companyId: string
+ createdAt: string | null
+ expiresAt: string
+ id: string
+ refreshToken: string
+ userId: string
+ }
+ Insert: {
+ accessToken: string
+ clientId: string
+ companyId: string
+ createdAt?: string | null
+ expiresAt: string
+ id?: string
+ refreshToken: string
+ userId: string
+ }
+ Update: {
+ accessToken?: string
+ clientId?: string
+ companyId?: string
+ createdAt?: string | null
+ expiresAt?: string
+ id?: string
+ refreshToken?: string
+ userId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "oauthToken_clientId_fkey"
+ columns: ["clientId"]
+ isOneToOne: false
+ referencedRelation: "oauthClient"
+ referencedColumns: ["clientId"]
+ },
+ {
+ foreignKeyName: "oauthToken_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "oauthToken_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "oauthToken_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "oauthToken_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "oauthToken_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "oauthToken_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "oauthToken_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "oauthToken_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "oauthToken_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ opportunity: {
+ Row: {
+ companyId: string
+ customerId: string | null
+ id: string
+ purchaseOrderDocumentPath: string | null
+ requestForQuoteDocumentPath: string | null
+ }
+ Insert: {
+ companyId: string
+ customerId?: string | null
+ id?: string
+ purchaseOrderDocumentPath?: string | null
+ requestForQuoteDocumentPath?: string | null
+ }
+ Update: {
+ companyId?: string
+ customerId?: string | null
+ id?: string
+ purchaseOrderDocumentPath?: string | null
+ requestForQuoteDocumentPath?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "opportunity_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "opportunity_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "opportunity_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "opportunity_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "opportunity_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "opportunity_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "opportunity_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ part: {
+ Row: {
+ approved: boolean
+ approvedBy: string | null
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ fromDate: string | null
+ id: string
+ tags: string[] | null
+ toDate: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ approved?: boolean
+ approvedBy?: string | null
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ fromDate?: string | null
+ id?: string
+ tags?: string[] | null
+ toDate?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ approved?: boolean
+ approvedBy?: string | null
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ fromDate?: string | null
+ id?: string
+ tags?: string[] | null
+ toDate?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "part_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "part_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "part_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "part_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "part_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "part_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "part_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "part_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "part_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "part_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "part_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "part_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "part_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "part_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "part_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "part_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "part_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "part_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "part_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ partner: {
+ Row: {
+ abilityId: string
+ active: boolean
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ hoursPerWeek: number
+ id: string
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ abilityId: string
+ active?: boolean
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ hoursPerWeek?: number
+ id: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ abilityId?: string
+ active?: boolean
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ hoursPerWeek?: number
+ id?: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "partner_abilityId_fkey"
+ columns: ["abilityId"]
+ isOneToOne: false
+ referencedRelation: "ability"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "partner_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "partner_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "partner_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "partner_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "partner_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "partner_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "partner_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "partner_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "partner_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "partner_id_fkey"
+ columns: ["id"]
+ isOneToOne: false
+ referencedRelation: "supplierLocation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "partner_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "partner_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "partner_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "partner_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "partner_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ passkeyCredential: {
+ Row: {
+ aaguid: string
+ backedUp: boolean
+ counter: number
+ createdAt: string
+ credentialName: string
+ deviceType: string
+ id: string
+ lastUsedAt: string | null
+ publicKey: string
+ rpId: string
+ transports: string[] | null
+ userHandle: string | null
+ userId: string
+ }
+ Insert: {
+ aaguid?: string
+ backedUp?: boolean
+ counter?: number
+ createdAt?: string
+ credentialName?: string
+ deviceType: string
+ id: string
+ lastUsedAt?: string | null
+ publicKey: string
+ rpId: string
+ transports?: string[] | null
+ userHandle?: string | null
+ userId: string
+ }
+ Update: {
+ aaguid?: string
+ backedUp?: boolean
+ counter?: number
+ createdAt?: string
+ credentialName?: string
+ deviceType?: string
+ id?: string
+ lastUsedAt?: string | null
+ publicKey?: string
+ rpId?: string
+ transports?: string[] | null
+ userHandle?: string | null
+ userId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "passkeyCredential_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "passkeyCredential_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "passkeyCredential_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "passkeyCredential_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "passkeyCredential_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ paymentTerm: {
+ Row: {
+ active: boolean
+ calculationMethod: Database["public"]["Enums"]["paymentTermCalculationMethod"]
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ daysDiscount: number
+ daysDue: number
+ discountPercentage: number
+ id: string
+ name: string
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ active?: boolean
+ calculationMethod?: Database["public"]["Enums"]["paymentTermCalculationMethod"]
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ daysDiscount?: number
+ daysDue?: number
+ discountPercentage?: number
+ id?: string
+ name: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ active?: boolean
+ calculationMethod?: Database["public"]["Enums"]["paymentTermCalculationMethod"]
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ daysDiscount?: number
+ daysDue?: number
+ discountPercentage?: number
+ id?: string
+ name?: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "paymentTerm_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "paymentTerm_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "paymentTerm_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "paymentTerm_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "paymentTerm_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "paymentTerm_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "paymentTerm_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "paymentTerm_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "paymentTerm_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "paymentTerm_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "paymentTerm_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "paymentTerm_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "paymentTerm_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "paymentTerm_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ period: {
+ Row: {
+ createdAt: string
+ endDate: string
+ id: string
+ periodType: Database["public"]["Enums"]["periodType"]
+ startDate: string
+ }
+ Insert: {
+ createdAt?: string
+ endDate: string
+ id?: string
+ periodType: Database["public"]["Enums"]["periodType"]
+ startDate: string
+ }
+ Update: {
+ createdAt?: string
+ endDate?: string
+ id?: string
+ periodType?: Database["public"]["Enums"]["periodType"]
+ startDate?: string
+ }
+ Relationships: []
+ }
+ pickMethod: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ defaultStorageUnitId: string | null
+ itemId: string
+ locationId: string
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ defaultStorageUnitId?: string | null
+ itemId: string
+ locationId: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ defaultStorageUnitId?: string | null
+ itemId?: string
+ locationId?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "pickMethod_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "pickMethod_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "pickMethod_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "pickMethod_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "pickMethod_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "pickMethod_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "pickMethod_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "pickMethod_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "pickMethod_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "pickMethod_defaultStorageUnitId_fkey"
+ columns: ["defaultStorageUnitId"]
+ isOneToOne: false
+ referencedRelation: "storageUnit"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "pickMethod_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "pickMethod_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "pickMethod_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "pickMethod_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "pickMethod_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "pickMethod_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "pickMethod_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "pickMethod_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "pickMethod_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "pickMethod_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "pickMethod_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "pickMethod_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ plan: {
+ Row: {
+ aiTokensLimit: number
+ createdAt: string
+ id: string
+ name: string
+ public: boolean
+ stripePriceId: string
+ stripeTrialPeriodDays: number
+ tasksLimit: number
+ updatedAt: string
+ userBasedPricing: boolean
+ }
+ Insert: {
+ aiTokensLimit?: number
+ createdAt?: string
+ id?: string
+ name: string
+ public?: boolean
+ stripePriceId: string
+ stripeTrialPeriodDays?: number
+ tasksLimit?: number
+ updatedAt?: string
+ userBasedPricing?: boolean
+ }
+ Update: {
+ aiTokensLimit?: number
+ createdAt?: string
+ id?: string
+ name?: string
+ public?: boolean
+ stripePriceId?: string
+ stripeTrialPeriodDays?: number
+ tasksLimit?: number
+ updatedAt?: string
+ userBasedPricing?: boolean
+ }
+ Relationships: []
+ }
+ pricingRule: {
+ Row: {
+ active: boolean
+ amount: number
+ amountType: Database["public"]["Enums"]["pricingRuleAmountType"]
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customerIds: string[] | null
+ customerTypeIds: string[] | null
+ id: string
+ itemIds: string[] | null
+ itemPostingGroupId: string | null
+ maxQuantity: number | null
+ minQuantity: number | null
+ name: string
+ priority: number
+ ruleType: Database["public"]["Enums"]["pricingRuleType"]
+ updatedAt: string | null
+ updatedBy: string | null
+ validFrom: string | null
+ validTo: string | null
+ }
+ Insert: {
+ active?: boolean
+ amount: number
+ amountType?: Database["public"]["Enums"]["pricingRuleAmountType"]
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customerIds?: string[] | null
+ customerTypeIds?: string[] | null
+ id?: string
+ itemIds?: string[] | null
+ itemPostingGroupId?: string | null
+ maxQuantity?: number | null
+ minQuantity?: number | null
+ name: string
+ priority?: number
+ ruleType: Database["public"]["Enums"]["pricingRuleType"]
+ updatedAt?: string | null
+ updatedBy?: string | null
+ validFrom?: string | null
+ validTo?: string | null
+ }
+ Update: {
+ active?: boolean
+ amount?: number
+ amountType?: Database["public"]["Enums"]["pricingRuleAmountType"]
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customerIds?: string[] | null
+ customerTypeIds?: string[] | null
+ id?: string
+ itemIds?: string[] | null
+ itemPostingGroupId?: string | null
+ maxQuantity?: number | null
+ minQuantity?: number | null
+ name?: string
+ priority?: number
+ ruleType?: Database["public"]["Enums"]["pricingRuleType"]
+ updatedAt?: string | null
+ updatedBy?: string | null
+ validFrom?: string | null
+ validTo?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "pricingRule_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "pricingRule_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "pricingRule_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "pricingRule_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "pricingRule_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "pricingRule_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "pricingRule_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "pricingRule_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "pricingRule_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "pricingRule_itemPostingGroupId_fkey"
+ columns: ["itemPostingGroupId"]
+ isOneToOne: false
+ referencedRelation: "itemPostingGroup"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "pricingRule_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "pricingRule_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "pricingRule_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "pricingRule_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "pricingRule_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ procedure: {
+ Row: {
+ assignee: string | null
+ companyId: string | null
+ content: Json
+ createdAt: string
+ createdBy: string
+ description: string | null
+ id: string
+ name: string
+ processId: string | null
+ status: Database["public"]["Enums"]["procedureStatus"]
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ version: number
+ }
+ Insert: {
+ assignee?: string | null
+ companyId?: string | null
+ content?: Json
+ createdAt?: string
+ createdBy: string
+ description?: string | null
+ id?: string
+ name: string
+ processId?: string | null
+ status?: Database["public"]["Enums"]["procedureStatus"]
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ version?: number
+ }
+ Update: {
+ assignee?: string | null
+ companyId?: string | null
+ content?: Json
+ createdAt?: string
+ createdBy?: string
+ description?: string | null
+ id?: string
+ name?: string
+ processId?: string | null
+ status?: Database["public"]["Enums"]["procedureStatus"]
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ version?: number
+ }
+ Relationships: [
+ {
+ foreignKeyName: "procedure_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedure_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedure_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedure_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedure_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "procedure_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedure_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedure_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "procedure_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "procedure_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedure_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedure_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedure_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedure_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "procedure_processId_fkey"
+ columns: ["processId"]
+ isOneToOne: false
+ referencedRelation: "process"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedure_processId_fkey"
+ columns: ["processId"]
+ isOneToOne: false
+ referencedRelation: "processes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedure_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedure_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedure_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedure_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedure_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ procedureParameter: {
+ Row: {
+ companyId: string | null
+ createdAt: string
+ createdBy: string
+ id: string
+ key: string
+ procedureId: string
+ updatedAt: string | null
+ updatedBy: string | null
+ value: string
+ }
+ Insert: {
+ companyId?: string | null
+ createdAt?: string
+ createdBy: string
+ id?: string
+ key: string
+ procedureId: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ value: string
+ }
+ Update: {
+ companyId?: string | null
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ key?: string
+ procedureId?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ value?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "procedureParameter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedureParameter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedureParameter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "procedureParameter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "procedureParameter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedureParameter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedureParameter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedureParameter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedureParameter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "procedureParameter_procedureId_fkey"
+ columns: ["procedureId"]
+ isOneToOne: false
+ referencedRelation: "procedure"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedureParameter_procedureId_fkey"
+ columns: ["procedureId"]
+ isOneToOne: false
+ referencedRelation: "procedures"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedureParameter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedureParameter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedureParameter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedureParameter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedureParameter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ procedureStep: {
+ Row: {
+ companyId: string | null
+ createdAt: string
+ createdBy: string
+ description: Json | null
+ fileTypes: string[] | null
+ id: string
+ listValues: string[] | null
+ maxValue: number | null
+ minValue: number | null
+ name: string
+ procedureId: string
+ required: boolean | null
+ sortOrder: number
+ type: Database["public"]["Enums"]["procedureStepType"]
+ unitOfMeasureCode: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId?: string | null
+ createdAt?: string
+ createdBy: string
+ description?: Json | null
+ fileTypes?: string[] | null
+ id?: string
+ listValues?: string[] | null
+ maxValue?: number | null
+ minValue?: number | null
+ name: string
+ procedureId: string
+ required?: boolean | null
+ sortOrder?: number
+ type: Database["public"]["Enums"]["procedureStepType"]
+ unitOfMeasureCode?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string | null
+ createdAt?: string
+ createdBy?: string
+ description?: Json | null
+ fileTypes?: string[] | null
+ id?: string
+ listValues?: string[] | null
+ maxValue?: number | null
+ minValue?: number | null
+ name?: string
+ procedureId?: string
+ required?: boolean | null
+ sortOrder?: number
+ type?: Database["public"]["Enums"]["procedureStepType"]
+ unitOfMeasureCode?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "procedureStep_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedureStep_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedureStep_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "procedureStep_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "procedureStep_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedureStep_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedureStep_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedureStep_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedureStep_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "procedureStep_procedureId_fkey"
+ columns: ["procedureId"]
+ isOneToOne: false
+ referencedRelation: "procedure"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedureStep_procedureId_fkey"
+ columns: ["procedureId"]
+ isOneToOne: false
+ referencedRelation: "procedures"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedureStep_unitOfMeasureCode_fkey"
+ columns: ["unitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "procedureStep_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedureStep_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedureStep_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedureStep_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedureStep_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ process: {
+ Row: {
+ active: boolean
+ companyId: string
+ completeAllOnScan: boolean
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ defaultStandardFactor: Database["public"]["Enums"]["factor"]
+ id: string
+ name: string
+ processType: Database["public"]["Enums"]["processType"]
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ active?: boolean
+ companyId: string
+ completeAllOnScan?: boolean
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ defaultStandardFactor: Database["public"]["Enums"]["factor"]
+ id?: string
+ name: string
+ processType?: Database["public"]["Enums"]["processType"]
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ active?: boolean
+ companyId?: string
+ completeAllOnScan?: boolean
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ defaultStandardFactor?: Database["public"]["Enums"]["factor"]
+ id?: string
+ name?: string
+ processType?: Database["public"]["Enums"]["processType"]
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "process_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "process_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "process_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "process_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "process_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "process_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "process_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "process_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "process_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "process_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "process_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "process_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "process_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "process_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ productionEvent: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ duration: number | null
+ employeeId: string | null
+ endTime: string | null
+ id: string
+ jobOperationId: string
+ notes: string | null
+ postedToGL: boolean
+ startTime: string
+ type: Database["public"]["Enums"]["productionEventType"] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ workCenterId: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ duration?: number | null
+ employeeId?: string | null
+ endTime?: string | null
+ id?: string
+ jobOperationId: string
+ notes?: string | null
+ postedToGL?: boolean
+ startTime?: string
+ type?: Database["public"]["Enums"]["productionEventType"] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ workCenterId?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ duration?: number | null
+ employeeId?: string | null
+ endTime?: string | null
+ id?: string
+ jobOperationId?: string
+ notes?: string | null
+ postedToGL?: boolean
+ startTime?: string
+ type?: Database["public"]["Enums"]["productionEventType"] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ workCenterId?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "productionEvent_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "productionEvent_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "productionEvent_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "productionEvent_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "productionEvent_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "productionEvent_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "productionEvent_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "productionEvent_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "productionEvent_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "productionEvent_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "productionEvent_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "productionEvent_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "productionEvent_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "productionEvent_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "productionEvent_jobOperationId_fkey"
+ columns: ["jobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "productionEvent_jobOperationId_fkey"
+ columns: ["jobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithDependencies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "productionEvent_jobOperationId_fkey"
+ columns: ["jobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithMakeMethods"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "productionEvent_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "productionEvent_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "productionEvent_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "productionEvent_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "productionEvent_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "productionEvent_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "riskRegisters"
+ referencedColumns: ["workCenterId"]
+ },
+ {
+ foreignKeyName: "productionEvent_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenter"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "productionEvent_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenters"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "productionEvent_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ productionQuantity: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ jobOperationId: string
+ laborProductionEventId: string | null
+ machineProductionEventId: string | null
+ notes: string | null
+ quantity: number
+ scrapReasonId: string | null
+ setupProductionEventId: string | null
+ type: Database["public"]["Enums"]["productionQuantityType"]
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ jobOperationId: string
+ laborProductionEventId?: string | null
+ machineProductionEventId?: string | null
+ notes?: string | null
+ quantity: number
+ scrapReasonId?: string | null
+ setupProductionEventId?: string | null
+ type?: Database["public"]["Enums"]["productionQuantityType"]
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ jobOperationId?: string
+ laborProductionEventId?: string | null
+ machineProductionEventId?: string | null
+ notes?: string | null
+ quantity?: number
+ scrapReasonId?: string | null
+ setupProductionEventId?: string | null
+ type?: Database["public"]["Enums"]["productionQuantityType"]
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "productionQuantity_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "productionQuantity_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "productionQuantity_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "productionQuantity_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "productionQuantity_jobOperationId_fkey"
+ columns: ["jobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "productionQuantity_jobOperationId_fkey"
+ columns: ["jobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithDependencies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "productionQuantity_jobOperationId_fkey"
+ columns: ["jobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithMakeMethods"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "productionQuantity_laborProductionEventId_fkey"
+ columns: ["laborProductionEventId"]
+ isOneToOne: false
+ referencedRelation: "productionEvent"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "productionQuantity_machineProductionEventId_fkey"
+ columns: ["machineProductionEventId"]
+ isOneToOne: false
+ referencedRelation: "productionEvent"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "productionQuantity_scrapReasonId_fkey"
+ columns: ["scrapReasonId"]
+ isOneToOne: false
+ referencedRelation: "scrapReason"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "productionQuantity_setupProductionEventId_fkey"
+ columns: ["setupProductionEventId"]
+ isOneToOne: false
+ referencedRelation: "productionEvent"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ purchaseInvoice: {
+ Row: {
+ assignee: string | null
+ balance: number
+ companyId: string
+ createdAt: string
+ createdBy: string
+ currencyCode: string
+ customFields: Json | null
+ dateDue: string | null
+ dateIssued: string | null
+ datePaid: string | null
+ exchangeRate: number
+ exchangeRateUpdatedAt: string | null
+ id: string
+ internalNotes: Json | null
+ invoiceId: string
+ invoiceSupplierContactId: string | null
+ invoiceSupplierId: string | null
+ invoiceSupplierLocationId: string | null
+ locationId: string | null
+ paymentTermId: string | null
+ postingDate: string | null
+ status: Database["public"]["Enums"]["purchaseInvoiceStatus"]
+ subtotal: number
+ supplierId: string | null
+ supplierInteractionId: string
+ supplierReference: string | null
+ tags: string[] | null
+ totalAmount: number
+ totalDiscount: number
+ totalTax: number
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ assignee?: string | null
+ balance?: number
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ currencyCode: string
+ customFields?: Json | null
+ dateDue?: string | null
+ dateIssued?: string | null
+ datePaid?: string | null
+ exchangeRate?: number
+ exchangeRateUpdatedAt?: string | null
+ id?: string
+ internalNotes?: Json | null
+ invoiceId: string
+ invoiceSupplierContactId?: string | null
+ invoiceSupplierId?: string | null
+ invoiceSupplierLocationId?: string | null
+ locationId?: string | null
+ paymentTermId?: string | null
+ postingDate?: string | null
+ status?: Database["public"]["Enums"]["purchaseInvoiceStatus"]
+ subtotal?: number
+ supplierId?: string | null
+ supplierInteractionId: string
+ supplierReference?: string | null
+ tags?: string[] | null
+ totalAmount?: number
+ totalDiscount?: number
+ totalTax?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ assignee?: string | null
+ balance?: number
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ currencyCode?: string
+ customFields?: Json | null
+ dateDue?: string | null
+ dateIssued?: string | null
+ datePaid?: string | null
+ exchangeRate?: number
+ exchangeRateUpdatedAt?: string | null
+ id?: string
+ internalNotes?: Json | null
+ invoiceId?: string
+ invoiceSupplierContactId?: string | null
+ invoiceSupplierId?: string | null
+ invoiceSupplierLocationId?: string | null
+ locationId?: string | null
+ paymentTermId?: string | null
+ postingDate?: string | null
+ status?: Database["public"]["Enums"]["purchaseInvoiceStatus"]
+ subtotal?: number
+ supplierId?: string | null
+ supplierInteractionId?: string
+ supplierReference?: string | null
+ tags?: string[] | null
+ totalAmount?: number
+ totalDiscount?: number
+ totalTax?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "purchaseInvoice_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_currencyCode_fkey"
+ columns: ["currencyCode"]
+ isOneToOne: false
+ referencedRelation: "currencyCode"
+ referencedColumns: ["code"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_invoiceSupplierContactId_fkey"
+ columns: ["invoiceSupplierContactId"]
+ isOneToOne: false
+ referencedRelation: "supplierContact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_invoiceSupplierId_fkey"
+ columns: ["invoiceSupplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_invoiceSupplierId_fkey"
+ columns: ["invoiceSupplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_invoiceSupplierId_fkey"
+ columns: ["invoiceSupplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_invoiceSupplierId_fkey"
+ columns: ["invoiceSupplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_invoiceSupplierId_fkey"
+ columns: ["invoiceSupplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_invoiceSupplierLocationId_fkey"
+ columns: ["invoiceSupplierLocationId"]
+ isOneToOne: false
+ referencedRelation: "supplierLocation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_paymentTermId_fkey"
+ columns: ["paymentTermId"]
+ isOneToOne: false
+ referencedRelation: "paymentTerm"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_supplierInteractionId_fkey"
+ columns: ["supplierInteractionId"]
+ isOneToOne: false
+ referencedRelation: "supplierInteraction"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ purchaseInvoiceDelivery: {
+ Row: {
+ companyId: string
+ customFields: Json | null
+ id: string
+ incoterm: Database["public"]["Enums"]["incoterm"] | null
+ incotermLocation: string | null
+ locationId: string | null
+ shippingMethodId: string | null
+ shippingTermId: string | null
+ supplierShippingCost: number
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ customFields?: Json | null
+ id: string
+ incoterm?: Database["public"]["Enums"]["incoterm"] | null
+ incotermLocation?: string | null
+ locationId?: string | null
+ shippingMethodId?: string | null
+ shippingTermId?: string | null
+ supplierShippingCost?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ customFields?: Json | null
+ id?: string
+ incoterm?: Database["public"]["Enums"]["incoterm"] | null
+ incotermLocation?: string | null
+ locationId?: string | null
+ shippingMethodId?: string | null
+ shippingTermId?: string | null
+ supplierShippingCost?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "purchaseInvoiceDelivery_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "purchaseInvoice"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceDelivery_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "purchaseInvoices"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceDelivery_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceDelivery_shippingMethodId_fkey"
+ columns: ["shippingMethodId"]
+ isOneToOne: false
+ referencedRelation: "shippingMethod"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceDelivery_shippingTermId_fkey"
+ columns: ["shippingTermId"]
+ isOneToOne: false
+ referencedRelation: "shippingTerm"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceDelivery_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceDelivery_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceDelivery_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceDelivery_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceDelivery_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ purchaseInvoiceLine: {
+ Row: {
+ accountId: string | null
+ assetId: string | null
+ companyId: string
+ conversionFactor: number | null
+ costCenterId: string | null
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ description: string | null
+ exchangeRate: number
+ extendedPrice: number | null
+ id: string
+ internalNotes: Json | null
+ inventoryUnitOfMeasureCode: string | null
+ invoiceId: string
+ invoiceLineType: Database["public"]["Enums"]["payableLineType"]
+ itemId: string | null
+ jobOperationId: string | null
+ locationId: string | null
+ modelUploadId: string | null
+ ownerId: string | null
+ purchaseOrderId: string | null
+ purchaseOrderLineId: string | null
+ purchaseUnitOfMeasureCode: string | null
+ quantity: number
+ requiredDate: string | null
+ serviceId: string | null
+ shippingCost: number | null
+ sortOrder: number
+ storageUnitId: string | null
+ supplierExtendedPrice: number | null
+ supplierShippingCost: number
+ supplierTaxAmount: number
+ supplierUnitPrice: number
+ tags: string[] | null
+ taxAmount: number | null
+ taxPercent: number | null
+ totalAmount: number | null
+ unitPrice: number | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ accountId?: string | null
+ assetId?: string | null
+ companyId: string
+ conversionFactor?: number | null
+ costCenterId?: string | null
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ description?: string | null
+ exchangeRate?: number
+ extendedPrice?: number | null
+ id?: string
+ internalNotes?: Json | null
+ inventoryUnitOfMeasureCode?: string | null
+ invoiceId: string
+ invoiceLineType: Database["public"]["Enums"]["payableLineType"]
+ itemId?: string | null
+ jobOperationId?: string | null
+ locationId?: string | null
+ modelUploadId?: string | null
+ ownerId?: string | null
+ purchaseOrderId?: string | null
+ purchaseOrderLineId?: string | null
+ purchaseUnitOfMeasureCode?: string | null
+ quantity?: number
+ requiredDate?: string | null
+ serviceId?: string | null
+ shippingCost?: number | null
+ sortOrder?: number
+ storageUnitId?: string | null
+ supplierExtendedPrice?: number | null
+ supplierShippingCost?: number
+ supplierTaxAmount?: number
+ supplierUnitPrice?: number
+ tags?: string[] | null
+ taxAmount?: number | null
+ taxPercent?: number | null
+ totalAmount?: number | null
+ unitPrice?: number | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ accountId?: string | null
+ assetId?: string | null
+ companyId?: string
+ conversionFactor?: number | null
+ costCenterId?: string | null
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ description?: string | null
+ exchangeRate?: number
+ extendedPrice?: number | null
+ id?: string
+ internalNotes?: Json | null
+ inventoryUnitOfMeasureCode?: string | null
+ invoiceId?: string
+ invoiceLineType?: Database["public"]["Enums"]["payableLineType"]
+ itemId?: string | null
+ jobOperationId?: string | null
+ locationId?: string | null
+ modelUploadId?: string | null
+ ownerId?: string | null
+ purchaseOrderId?: string | null
+ purchaseOrderLineId?: string | null
+ purchaseUnitOfMeasureCode?: string | null
+ quantity?: number
+ requiredDate?: string | null
+ serviceId?: string | null
+ shippingCost?: number | null
+ sortOrder?: number
+ storageUnitId?: string | null
+ supplierExtendedPrice?: number | null
+ supplierShippingCost?: number
+ supplierTaxAmount?: number
+ supplierUnitPrice?: number
+ tags?: string[] | null
+ taxAmount?: number | null
+ taxPercent?: number | null
+ totalAmount?: number | null
+ unitPrice?: number | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "purchaseInvoiceLine_accountId_fkey"
+ columns: ["accountId"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLine_accountId_fkey"
+ columns: ["accountId"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLine_costCenterId_fkey"
+ columns: ["costCenterId"]
+ isOneToOne: false
+ referencedRelation: "costCenter"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLine_jobOperationId_fkey"
+ columns: ["jobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLine_jobOperationId_fkey"
+ columns: ["jobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithDependencies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLine_jobOperationId_fkey"
+ columns: ["jobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithMakeMethods"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "modelUpload"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "salesRfqLines"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLine_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLine_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLine_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLine_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLine_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLine_storageUnitId_fkey"
+ columns: ["storageUnitId"]
+ isOneToOne: false
+ referencedRelation: "storageUnit"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_inventoryUnitOfMeasureCode_fkey"
+ columns: ["inventoryUnitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_invoiceId_fkey"
+ columns: ["invoiceId"]
+ isOneToOne: false
+ referencedRelation: "purchaseInvoice"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_invoiceId_fkey"
+ columns: ["invoiceId"]
+ isOneToOne: false
+ referencedRelation: "purchaseInvoices"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_purchaseOrderId_fkey"
+ columns: ["purchaseOrderId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrder"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_purchaseOrderId_fkey"
+ columns: ["purchaseOrderId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderLocations"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_purchaseOrderId_fkey"
+ columns: ["purchaseOrderId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_purchaseOrderLineId_fkey"
+ columns: ["purchaseOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "openPurchaseOrderLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_purchaseOrderLineId_fkey"
+ columns: ["purchaseOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderLine"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_purchaseOrderLineId_fkey"
+ columns: ["purchaseOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_purchaseUnitOfMeasureCode_fkey"
+ columns: ["purchaseUnitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ purchaseInvoicePaymentRelation: {
+ Row: {
+ id: string
+ invoiceId: string
+ paymentId: string
+ }
+ Insert: {
+ id?: string
+ invoiceId: string
+ paymentId: string
+ }
+ Update: {
+ id?: string
+ invoiceId?: string
+ paymentId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "purchasePayments_invoiceId_fkey"
+ columns: ["invoiceId"]
+ isOneToOne: false
+ referencedRelation: "purchaseInvoice"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasePayments_invoiceId_fkey"
+ columns: ["invoiceId"]
+ isOneToOne: false
+ referencedRelation: "purchaseInvoices"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasePayments_paymentId_fkey"
+ columns: ["paymentId"]
+ isOneToOne: false
+ referencedRelation: "purchasePayment"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ purchaseInvoicePriceChange: {
+ Row: {
+ id: string
+ invoiceId: string
+ invoiceLineId: string
+ newPrice: number
+ newQuantity: number
+ previousPrice: number
+ previousQuantity: number
+ updatedBy: string
+ }
+ Insert: {
+ id?: string
+ invoiceId: string
+ invoiceLineId: string
+ newPrice?: number
+ newQuantity?: number
+ previousPrice?: number
+ previousQuantity?: number
+ updatedBy: string
+ }
+ Update: {
+ id?: string
+ invoiceId?: string
+ invoiceLineId?: string
+ newPrice?: number
+ newQuantity?: number
+ previousPrice?: number
+ previousQuantity?: number
+ updatedBy?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "purchaseInvoicePriceChange_invoiceId_fkey"
+ columns: ["invoiceId"]
+ isOneToOne: false
+ referencedRelation: "purchaseInvoice"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoicePriceChange_invoiceId_fkey"
+ columns: ["invoiceId"]
+ isOneToOne: false
+ referencedRelation: "purchaseInvoices"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoicePriceChange_invoiceLineId_fkey"
+ columns: ["invoiceLineId"]
+ isOneToOne: false
+ referencedRelation: "purchaseInvoiceLine"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoicePriceChange_invoiceLineId_fkey"
+ columns: ["invoiceLineId"]
+ isOneToOne: false
+ referencedRelation: "purchaseInvoiceLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoicePriceChange_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoicePriceChange_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoicePriceChange_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoicePriceChange_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoicePriceChange_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ purchaseInvoiceStatusHistory: {
+ Row: {
+ createdAt: string
+ id: string
+ invoiceId: string
+ status: Database["public"]["Enums"]["purchaseInvoiceStatus"]
+ }
+ Insert: {
+ createdAt?: string
+ id?: string
+ invoiceId: string
+ status: Database["public"]["Enums"]["purchaseInvoiceStatus"]
+ }
+ Update: {
+ createdAt?: string
+ id?: string
+ invoiceId?: string
+ status?: Database["public"]["Enums"]["purchaseInvoiceStatus"]
+ }
+ Relationships: [
+ {
+ foreignKeyName: "purchaseInvoiceStatusHistory_invoiceId_fkey"
+ columns: ["invoiceId"]
+ isOneToOne: false
+ referencedRelation: "purchaseInvoice"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceStatusHistory_invoiceId_fkey"
+ columns: ["invoiceId"]
+ isOneToOne: false
+ referencedRelation: "purchaseInvoices"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ purchaseOrder: {
+ Row: {
+ assignee: string | null
+ closedAt: string | null
+ closedBy: string | null
+ companyId: string
+ createdAt: string
+ createdBy: string
+ currencyCode: string | null
+ customFields: Json | null
+ exchangeRate: number | null
+ exchangeRateUpdatedAt: string | null
+ externalNotes: Json | null
+ id: string
+ internalNotes: Json | null
+ jobId: string | null
+ jobReadableId: string | null
+ orderDate: string | null
+ purchaseOrderId: string
+ purchaseOrderType: Database["public"]["Enums"]["purchaseOrderType"]
+ revisionId: number
+ status: Database["public"]["Enums"]["purchaseOrderStatus"]
+ supplierContactId: string | null
+ supplierId: string
+ supplierInteractionId: string
+ supplierLocationId: string | null
+ supplierReference: string | null
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ assignee?: string | null
+ closedAt?: string | null
+ closedBy?: string | null
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ currencyCode?: string | null
+ customFields?: Json | null
+ exchangeRate?: number | null
+ exchangeRateUpdatedAt?: string | null
+ externalNotes?: Json | null
+ id?: string
+ internalNotes?: Json | null
+ jobId?: string | null
+ jobReadableId?: string | null
+ orderDate?: string | null
+ purchaseOrderId: string
+ purchaseOrderType?: Database["public"]["Enums"]["purchaseOrderType"]
+ revisionId?: number
+ status?: Database["public"]["Enums"]["purchaseOrderStatus"]
+ supplierContactId?: string | null
+ supplierId: string
+ supplierInteractionId: string
+ supplierLocationId?: string | null
+ supplierReference?: string | null
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ assignee?: string | null
+ closedAt?: string | null
+ closedBy?: string | null
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ currencyCode?: string | null
+ customFields?: Json | null
+ exchangeRate?: number | null
+ exchangeRateUpdatedAt?: string | null
+ externalNotes?: Json | null
+ id?: string
+ internalNotes?: Json | null
+ jobId?: string | null
+ jobReadableId?: string | null
+ orderDate?: string | null
+ purchaseOrderId?: string
+ purchaseOrderType?: Database["public"]["Enums"]["purchaseOrderType"]
+ revisionId?: number
+ status?: Database["public"]["Enums"]["purchaseOrderStatus"]
+ supplierContactId?: string | null
+ supplierId?: string
+ supplierInteractionId?: string
+ supplierLocationId?: string | null
+ supplierReference?: string | null
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "purchaseOrder_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_closedBy_fkey"
+ columns: ["closedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_closedBy_fkey"
+ columns: ["closedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_closedBy_fkey"
+ columns: ["closedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_closedBy_fkey"
+ columns: ["closedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_closedBy_fkey"
+ columns: ["closedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_currencyCode_fkey"
+ columns: ["currencyCode"]
+ isOneToOne: false
+ referencedRelation: "currencyCode"
+ referencedColumns: ["code"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "job"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "openProductionOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_supplierContactId_fkey"
+ columns: ["supplierContactId"]
+ isOneToOne: false
+ referencedRelation: "supplierContact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_supplierInteractionId_fkey"
+ columns: ["supplierInteractionId"]
+ isOneToOne: false
+ referencedRelation: "supplierInteraction"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_supplierLocationId_fkey"
+ columns: ["supplierLocationId"]
+ isOneToOne: false
+ referencedRelation: "supplierLocation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ purchaseOrderDelivery: {
+ Row: {
+ companyId: string
+ customerId: string | null
+ customerLocationId: string | null
+ customFields: Json | null
+ deliveryDate: string | null
+ dropShipment: boolean
+ id: string
+ incoterm: Database["public"]["Enums"]["incoterm"] | null
+ incotermLocation: string | null
+ locationId: string | null
+ notes: string | null
+ receiptPromisedDate: string | null
+ receiptRequestedDate: string | null
+ shippingMethodId: string | null
+ shippingTermId: string | null
+ supplierShippingCost: number
+ tags: string[] | null
+ trackingNumber: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ customerId?: string | null
+ customerLocationId?: string | null
+ customFields?: Json | null
+ deliveryDate?: string | null
+ dropShipment?: boolean
+ id: string
+ incoterm?: Database["public"]["Enums"]["incoterm"] | null
+ incotermLocation?: string | null
+ locationId?: string | null
+ notes?: string | null
+ receiptPromisedDate?: string | null
+ receiptRequestedDate?: string | null
+ shippingMethodId?: string | null
+ shippingTermId?: string | null
+ supplierShippingCost?: number
+ tags?: string[] | null
+ trackingNumber?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ customerId?: string | null
+ customerLocationId?: string | null
+ customFields?: Json | null
+ deliveryDate?: string | null
+ dropShipment?: boolean
+ id?: string
+ incoterm?: Database["public"]["Enums"]["incoterm"] | null
+ incotermLocation?: string | null
+ locationId?: string | null
+ notes?: string | null
+ receiptPromisedDate?: string | null
+ receiptRequestedDate?: string | null
+ shippingMethodId?: string | null
+ shippingTermId?: string | null
+ supplierShippingCost?: number
+ tags?: string[] | null
+ trackingNumber?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "purchaseOrderDelivery_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderDelivery_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderDelivery_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderDelivery_customerLocationId_fkey"
+ columns: ["customerLocationId"]
+ isOneToOne: false
+ referencedRelation: "customerLocation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderDelivery_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "purchaseOrder"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderDelivery_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "purchaseOrderLocations"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderDelivery_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "purchaseOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderDelivery_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderDelivery_shippingMethodId_fkey"
+ columns: ["shippingMethodId"]
+ isOneToOne: false
+ referencedRelation: "shippingMethod"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderDelivery_shippingTermId_fkey"
+ columns: ["shippingTermId"]
+ isOneToOne: false
+ referencedRelation: "shippingTerm"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderDelivery_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderDelivery_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderDelivery_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderDelivery_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderDelivery_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ purchaseOrderFavorite: {
+ Row: {
+ purchaseOrderId: string
+ userId: string
+ }
+ Insert: {
+ purchaseOrderId: string
+ userId: string
+ }
+ Update: {
+ purchaseOrderId?: string
+ userId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "purchaseOrderFavorites_purchaseOrderId_fkey"
+ columns: ["purchaseOrderId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrder"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderFavorites_purchaseOrderId_fkey"
+ columns: ["purchaseOrderId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderLocations"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderFavorites_purchaseOrderId_fkey"
+ columns: ["purchaseOrderId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ purchaseOrderLine: {
+ Row: {
+ accountId: string | null
+ assetId: string | null
+ companyId: string
+ conversionFactor: number | null
+ costCenterId: string | null
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ description: string | null
+ exchangeRate: number
+ extendedPrice: number | null
+ externalNotes: Json | null
+ id: string
+ internalNotes: Json | null
+ inventoryUnitOfMeasureCode: string | null
+ invoicedComplete: boolean
+ itemId: string | null
+ jobId: string | null
+ jobOperationId: string | null
+ locationId: string | null
+ modelUploadId: string | null
+ ownerId: string | null
+ promisedDate: string | null
+ purchaseOrderId: string
+ purchaseOrderLineType: Database["public"]["Enums"]["purchaseOrderLineType"]
+ purchaseQuantity: number | null
+ purchaseUnitOfMeasureCode: string | null
+ quantityInvoiced: number | null
+ quantityReceived: number | null
+ quantityShipped: number | null
+ quantityToInvoice: number | null
+ quantityToReceive: number | null
+ receivedComplete: boolean
+ receivedDate: string | null
+ requiredDate: string | null
+ requiresInspection: boolean
+ setupPrice: number | null
+ shippingCost: number | null
+ sortOrder: number
+ storageUnitId: string | null
+ supplierExtendedPrice: number | null
+ supplierPartId: string | null
+ supplierShippingCost: number
+ supplierTaxAmount: number
+ supplierUnitPrice: number | null
+ tags: string[] | null
+ taxAmount: number | null
+ taxPercent: number | null
+ unitPrice: number | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ accountId?: string | null
+ assetId?: string | null
+ companyId: string
+ conversionFactor?: number | null
+ costCenterId?: string | null
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ description?: string | null
+ exchangeRate?: number
+ extendedPrice?: number | null
+ externalNotes?: Json | null
+ id?: string
+ internalNotes?: Json | null
+ inventoryUnitOfMeasureCode?: string | null
+ invoicedComplete?: boolean
+ itemId?: string | null
+ jobId?: string | null
+ jobOperationId?: string | null
+ locationId?: string | null
+ modelUploadId?: string | null
+ ownerId?: string | null
+ promisedDate?: string | null
+ purchaseOrderId: string
+ purchaseOrderLineType: Database["public"]["Enums"]["purchaseOrderLineType"]
+ purchaseQuantity?: number | null
+ purchaseUnitOfMeasureCode?: string | null
+ quantityInvoiced?: number | null
+ quantityReceived?: number | null
+ quantityShipped?: number | null
+ quantityToInvoice?: number | null
+ quantityToReceive?: number | null
+ receivedComplete?: boolean
+ receivedDate?: string | null
+ requiredDate?: string | null
+ requiresInspection?: boolean
+ setupPrice?: number | null
+ shippingCost?: number | null
+ sortOrder?: number
+ storageUnitId?: string | null
+ supplierExtendedPrice?: number | null
+ supplierPartId?: string | null
+ supplierShippingCost?: number
+ supplierTaxAmount?: number
+ supplierUnitPrice?: number | null
+ tags?: string[] | null
+ taxAmount?: number | null
+ taxPercent?: number | null
+ unitPrice?: number | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ accountId?: string | null
+ assetId?: string | null
+ companyId?: string
+ conversionFactor?: number | null
+ costCenterId?: string | null
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ description?: string | null
+ exchangeRate?: number
+ extendedPrice?: number | null
+ externalNotes?: Json | null
+ id?: string
+ internalNotes?: Json | null
+ inventoryUnitOfMeasureCode?: string | null
+ invoicedComplete?: boolean
+ itemId?: string | null
+ jobId?: string | null
+ jobOperationId?: string | null
+ locationId?: string | null
+ modelUploadId?: string | null
+ ownerId?: string | null
+ promisedDate?: string | null
+ purchaseOrderId?: string
+ purchaseOrderLineType?: Database["public"]["Enums"]["purchaseOrderLineType"]
+ purchaseQuantity?: number | null
+ purchaseUnitOfMeasureCode?: string | null
+ quantityInvoiced?: number | null
+ quantityReceived?: number | null
+ quantityShipped?: number | null
+ quantityToInvoice?: number | null
+ quantityToReceive?: number | null
+ receivedComplete?: boolean
+ receivedDate?: string | null
+ requiredDate?: string | null
+ requiresInspection?: boolean
+ setupPrice?: number | null
+ shippingCost?: number | null
+ sortOrder?: number
+ storageUnitId?: string | null
+ supplierExtendedPrice?: number | null
+ supplierPartId?: string | null
+ supplierShippingCost?: number
+ supplierTaxAmount?: number
+ supplierUnitPrice?: number | null
+ tags?: string[] | null
+ taxAmount?: number | null
+ taxPercent?: number | null
+ unitPrice?: number | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "purchaseOrderLine_accountId_fkey"
+ columns: ["accountId"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_accountId_fkey"
+ columns: ["accountId"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_assetId_fkey"
+ columns: ["assetId"]
+ isOneToOne: false
+ referencedRelation: "fixedAsset"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_costCenterId_fkey"
+ columns: ["costCenterId"]
+ isOneToOne: false
+ referencedRelation: "costCenter"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_inventoryUnitOfMeasureCode_fkey"
+ columns: ["inventoryUnitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "job"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "openProductionOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_jobOperationId_fkey"
+ columns: ["jobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_jobOperationId_fkey"
+ columns: ["jobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithDependencies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_jobOperationId_fkey"
+ columns: ["jobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithMakeMethods"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "modelUpload"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "salesRfqLines"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_purchaseOrderId_fkey"
+ columns: ["purchaseOrderId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrder"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_purchaseOrderId_fkey"
+ columns: ["purchaseOrderId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderLocations"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_purchaseOrderId_fkey"
+ columns: ["purchaseOrderId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_purchaseUnitOfMeasureCode_fkey"
+ columns: ["purchaseUnitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_storageUnitId_fkey"
+ columns: ["storageUnitId"]
+ isOneToOne: false
+ referencedRelation: "storageUnit"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ purchaseOrderPayment: {
+ Row: {
+ companyId: string
+ customFields: Json | null
+ id: string
+ invoiceSupplierContactId: string | null
+ invoiceSupplierId: string | null
+ invoiceSupplierLocationId: string | null
+ paymentComplete: boolean
+ paymentTermId: string | null
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ customFields?: Json | null
+ id: string
+ invoiceSupplierContactId?: string | null
+ invoiceSupplierId?: string | null
+ invoiceSupplierLocationId?: string | null
+ paymentComplete?: boolean
+ paymentTermId?: string | null
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ customFields?: Json | null
+ id?: string
+ invoiceSupplierContactId?: string | null
+ invoiceSupplierId?: string | null
+ invoiceSupplierLocationId?: string | null
+ paymentComplete?: boolean
+ paymentTermId?: string | null
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "purchaseOrderPayment_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "purchaseOrder"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderPayment_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "purchaseOrderLocations"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderPayment_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "purchaseOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderPayment_invoiceSupplierContactId_fkey"
+ columns: ["invoiceSupplierContactId"]
+ isOneToOne: false
+ referencedRelation: "supplierContact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderPayment_invoiceSupplierId_fkey"
+ columns: ["invoiceSupplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "purchaseOrderPayment_invoiceSupplierId_fkey"
+ columns: ["invoiceSupplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "purchaseOrderPayment_invoiceSupplierId_fkey"
+ columns: ["invoiceSupplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderPayment_invoiceSupplierId_fkey"
+ columns: ["invoiceSupplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderPayment_invoiceSupplierId_fkey"
+ columns: ["invoiceSupplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderPayment_invoiceSupplierLocationId_fkey"
+ columns: ["invoiceSupplierLocationId"]
+ isOneToOne: false
+ referencedRelation: "supplierLocation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderPayment_paymentTermId_fkey"
+ columns: ["paymentTermId"]
+ isOneToOne: false
+ referencedRelation: "paymentTerm"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ purchaseOrderStatusHistory: {
+ Row: {
+ createdAt: string
+ createdBy: string
+ id: string
+ purchaseOrderId: string
+ status: Database["public"]["Enums"]["purchaseOrderStatus"]
+ }
+ Insert: {
+ createdAt?: string
+ createdBy: string
+ id?: string
+ purchaseOrderId: string
+ status: Database["public"]["Enums"]["purchaseOrderStatus"]
+ }
+ Update: {
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ purchaseOrderId?: string
+ status?: Database["public"]["Enums"]["purchaseOrderStatus"]
+ }
+ Relationships: [
+ {
+ foreignKeyName: "purchaseOrderStatusHistory_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderStatusHistory_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderStatusHistory_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderStatusHistory_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderStatusHistory_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "purchaseOrderStatusHistory_purchaseOrderId_fkey"
+ columns: ["purchaseOrderId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrder"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderStatusHistory_purchaseOrderId_fkey"
+ columns: ["purchaseOrderId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderLocations"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderStatusHistory_purchaseOrderId_fkey"
+ columns: ["purchaseOrderId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrders"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ purchaseOrderTransaction: {
+ Row: {
+ createdAt: string
+ id: string
+ purchaseOrderId: string
+ type: Database["public"]["Enums"]["purchaseOrderTransactionType"]
+ userId: string
+ }
+ Insert: {
+ createdAt?: string
+ id?: string
+ purchaseOrderId: string
+ type: Database["public"]["Enums"]["purchaseOrderTransactionType"]
+ userId: string
+ }
+ Update: {
+ createdAt?: string
+ id?: string
+ purchaseOrderId?: string
+ type?: Database["public"]["Enums"]["purchaseOrderTransactionType"]
+ userId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "purchaseOrderTransaction_purchaseOrderId_fkey"
+ columns: ["purchaseOrderId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrder"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderTransaction_purchaseOrderId_fkey"
+ columns: ["purchaseOrderId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderLocations"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderTransaction_purchaseOrderId_fkey"
+ columns: ["purchaseOrderId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderTransaction_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderTransaction_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderTransaction_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderTransaction_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderTransaction_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ purchasePayment: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ currencyCode: string
+ customFields: Json | null
+ exchangeRate: number
+ id: string
+ paymentDate: string | null
+ paymentId: string
+ supplierId: string
+ totalAmount: number
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ currencyCode: string
+ customFields?: Json | null
+ exchangeRate?: number
+ id?: string
+ paymentDate?: string | null
+ paymentId: string
+ supplierId: string
+ totalAmount?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ currencyCode?: string
+ customFields?: Json | null
+ exchangeRate?: number
+ id?: string
+ paymentDate?: string | null
+ paymentId?: string
+ supplierId?: string
+ totalAmount?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "purchasePayment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasePayment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasePayment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "purchasePayment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "purchasePayment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasePayment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasePayment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasePayment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasePayment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "purchasePayment_currencyCode_fkey"
+ columns: ["currencyCode"]
+ isOneToOne: false
+ referencedRelation: "currencyCode"
+ referencedColumns: ["code"]
+ },
+ {
+ foreignKeyName: "purchasePayment_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "purchasePayment_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "purchasePayment_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasePayment_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasePayment_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasePayment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasePayment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasePayment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasePayment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasePayment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ purchasingRfq: {
+ Row: {
+ assignee: string | null
+ companyId: string
+ createdAt: string | null
+ createdBy: string | null
+ customFields: Json | null
+ employeeId: string | null
+ expirationDate: string | null
+ id: string
+ internalNotes: string | null
+ locationId: string | null
+ notes: Json | null
+ revisionId: number
+ rfqDate: string
+ rfqId: string
+ status: Database["public"]["Enums"]["purchasingRfqStatus"]
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ assignee?: string | null
+ companyId: string
+ createdAt?: string | null
+ createdBy?: string | null
+ customFields?: Json | null
+ employeeId?: string | null
+ expirationDate?: string | null
+ id?: string
+ internalNotes?: string | null
+ locationId?: string | null
+ notes?: Json | null
+ revisionId?: number
+ rfqDate: string
+ rfqId: string
+ status?: Database["public"]["Enums"]["purchasingRfqStatus"]
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ assignee?: string | null
+ companyId?: string
+ createdAt?: string | null
+ createdBy?: string | null
+ customFields?: Json | null
+ employeeId?: string | null
+ expirationDate?: string | null
+ id?: string
+ internalNotes?: string | null
+ locationId?: string | null
+ notes?: Json | null
+ revisionId?: number
+ rfqDate?: string
+ rfqId?: string
+ status?: Database["public"]["Enums"]["purchasingRfqStatus"]
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "purchasingRfq_assigneeId_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_assigneeId_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_assigneeId_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_assigneeId_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_assigneeId_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ purchasingRfqFavorite: {
+ Row: {
+ rfqId: string
+ userId: string
+ }
+ Insert: {
+ rfqId: string
+ userId: string
+ }
+ Update: {
+ rfqId?: string
+ userId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "purchasingRfqFavorites_purchasingRfqId_fkey"
+ columns: ["rfqId"]
+ isOneToOne: false
+ referencedRelation: "purchasingRfq"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqFavorites_purchasingRfqId_fkey"
+ columns: ["rfqId"]
+ isOneToOne: false
+ referencedRelation: "purchasingRfqs"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ purchasingRfqLine: {
+ Row: {
+ companyId: string
+ conversionFactor: number | null
+ createdAt: string | null
+ createdBy: string
+ customFields: Json | null
+ description: string | null
+ externalNotes: Json | null
+ id: string
+ internalNotes: Json | null
+ inventoryUnitOfMeasureCode: string
+ itemId: string
+ order: number
+ purchaseUnitOfMeasureCode: string
+ purchasingRfqId: string
+ quantity: number[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ conversionFactor?: number | null
+ createdAt?: string | null
+ createdBy: string
+ customFields?: Json | null
+ description?: string | null
+ externalNotes?: Json | null
+ id?: string
+ internalNotes?: Json | null
+ inventoryUnitOfMeasureCode: string
+ itemId: string
+ order?: number
+ purchaseUnitOfMeasureCode: string
+ purchasingRfqId: string
+ quantity?: number[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ conversionFactor?: number | null
+ createdAt?: string | null
+ createdBy?: string
+ customFields?: Json | null
+ description?: string | null
+ externalNotes?: Json | null
+ id?: string
+ internalNotes?: Json | null
+ inventoryUnitOfMeasureCode?: string
+ itemId?: string
+ order?: number
+ purchaseUnitOfMeasureCode?: string
+ purchasingRfqId?: string
+ quantity?: number[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "purchasingRfqLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_inventoryUnitOfMeasureCode_fkey"
+ columns: ["inventoryUnitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_purchaseUnitOfMeasureCode_fkey"
+ columns: ["purchaseUnitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_purchasingRfqId_fkey"
+ columns: ["purchasingRfqId"]
+ isOneToOne: false
+ referencedRelation: "purchasingRfq"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_purchasingRfqId_fkey"
+ columns: ["purchasingRfqId"]
+ isOneToOne: false
+ referencedRelation: "purchasingRfqs"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ purchasingRfqSupplier: {
+ Row: {
+ companyId: string
+ createdAt: string | null
+ createdBy: string | null
+ id: string
+ purchasingRfqId: string
+ supplierId: string
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string | null
+ createdBy?: string | null
+ id?: string
+ purchasingRfqId: string
+ supplierId: string
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string | null
+ createdBy?: string | null
+ id?: string
+ purchasingRfqId?: string
+ supplierId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "purchasingRfqSupplier_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqSupplier_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqSupplier_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "purchasingRfqSupplier_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "purchasingRfqSupplier_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqSupplier_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqSupplier_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqSupplier_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqSupplier_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "purchasingRfqSupplier_purchasingRfqId_fkey"
+ columns: ["purchasingRfqId"]
+ isOneToOne: false
+ referencedRelation: "purchasingRfq"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqSupplier_purchasingRfqId_fkey"
+ columns: ["purchasingRfqId"]
+ isOneToOne: false
+ referencedRelation: "purchasingRfqs"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqSupplier_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "purchasingRfqSupplier_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "purchasingRfqSupplier_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqSupplier_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqSupplier_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ purchasingRfqToPurchaseOrder: {
+ Row: {
+ companyId: string
+ purchaseOrderId: string
+ purchasingRfqId: string
+ }
+ Insert: {
+ companyId: string
+ purchaseOrderId: string
+ purchasingRfqId: string
+ }
+ Update: {
+ companyId?: string
+ purchaseOrderId?: string
+ purchasingRfqId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "purchasingRfqToPurchaseOrder_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqToPurchaseOrder_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqToPurchaseOrder_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "purchasingRfqToPurchaseOrder_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "purchasingRfqToPurchaseOrder_purchaseOrderId_fkey"
+ columns: ["purchaseOrderId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrder"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqToPurchaseOrder_purchaseOrderId_fkey"
+ columns: ["purchaseOrderId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderLocations"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqToPurchaseOrder_purchaseOrderId_fkey"
+ columns: ["purchaseOrderId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqToPurchaseOrder_purchasingRfqId_fkey"
+ columns: ["purchasingRfqId"]
+ isOneToOne: false
+ referencedRelation: "purchasingRfq"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqToPurchaseOrder_purchasingRfqId_fkey"
+ columns: ["purchasingRfqId"]
+ isOneToOne: false
+ referencedRelation: "purchasingRfqs"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ purchasingRfqToSupplierQuote: {
+ Row: {
+ companyId: string
+ purchasingRfqId: string
+ supplierQuoteId: string
+ }
+ Insert: {
+ companyId: string
+ purchasingRfqId: string
+ supplierQuoteId: string
+ }
+ Update: {
+ companyId?: string
+ purchasingRfqId?: string
+ supplierQuoteId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "purchasingRfqToSupplierQuote_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqToSupplierQuote_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqToSupplierQuote_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "purchasingRfqToSupplierQuote_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "purchasingRfqToSupplierQuote_purchasingRfqId_fkey"
+ columns: ["purchasingRfqId"]
+ isOneToOne: false
+ referencedRelation: "purchasingRfq"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqToSupplierQuote_purchasingRfqId_fkey"
+ columns: ["purchasingRfqId"]
+ isOneToOne: false
+ referencedRelation: "purchasingRfqs"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqToSupplierQuote_supplierQuoteId_fkey"
+ columns: ["supplierQuoteId"]
+ isOneToOne: false
+ referencedRelation: "supplierQuote"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqToSupplierQuote_supplierQuoteId_fkey"
+ columns: ["supplierQuoteId"]
+ isOneToOne: false
+ referencedRelation: "supplierQuotes"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ qualityDocument: {
+ Row: {
+ assignee: string | null
+ companyId: string | null
+ content: Json | null
+ createdAt: string
+ createdBy: string
+ description: string | null
+ id: string
+ name: string
+ status: Database["public"]["Enums"]["qualityDocumentStatus"]
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ version: number
+ }
+ Insert: {
+ assignee?: string | null
+ companyId?: string | null
+ content?: Json | null
+ createdAt?: string
+ createdBy: string
+ description?: string | null
+ id?: string
+ name: string
+ status?: Database["public"]["Enums"]["qualityDocumentStatus"]
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ version?: number
+ }
+ Update: {
+ assignee?: string | null
+ companyId?: string | null
+ content?: Json | null
+ createdAt?: string
+ createdBy?: string
+ description?: string | null
+ id?: string
+ name?: string
+ status?: Database["public"]["Enums"]["qualityDocumentStatus"]
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ version?: number
+ }
+ Relationships: [
+ {
+ foreignKeyName: "qualityDocument_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "qualityDocument_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "qualityDocument_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "qualityDocument_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "qualityDocument_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "qualityDocument_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "qualityDocument_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "qualityDocument_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "qualityDocument_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "qualityDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "qualityDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "qualityDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "qualityDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "qualityDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "qualityDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "qualityDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "qualityDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "qualityDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "qualityDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ qualityDocumentStep: {
+ Row: {
+ companyId: string | null
+ createdAt: string
+ createdBy: string
+ description: string | null
+ fileTypes: string[] | null
+ id: string
+ listValues: string[] | null
+ maxValue: number | null
+ minValue: number | null
+ name: string
+ qualityDocumentId: string
+ required: boolean | null
+ sortOrder: number
+ type: Database["public"]["Enums"]["procedureStepType"]
+ unitOfMeasureCode: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId?: string | null
+ createdAt?: string
+ createdBy: string
+ description?: string | null
+ fileTypes?: string[] | null
+ id?: string
+ listValues?: string[] | null
+ maxValue?: number | null
+ minValue?: number | null
+ name: string
+ qualityDocumentId: string
+ required?: boolean | null
+ sortOrder?: number
+ type: Database["public"]["Enums"]["procedureStepType"]
+ unitOfMeasureCode?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string | null
+ createdAt?: string
+ createdBy?: string
+ description?: string | null
+ fileTypes?: string[] | null
+ id?: string
+ listValues?: string[] | null
+ maxValue?: number | null
+ minValue?: number | null
+ name?: string
+ qualityDocumentId?: string
+ required?: boolean | null
+ sortOrder?: number
+ type?: Database["public"]["Enums"]["procedureStepType"]
+ unitOfMeasureCode?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "qualityDocumentStep_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "qualityDocumentStep_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "qualityDocumentStep_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "qualityDocumentStep_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "qualityDocumentStep_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "qualityDocumentStep_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "qualityDocumentStep_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "qualityDocumentStep_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "qualityDocumentStep_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "qualityDocumentStep_qualityDocumentId_fkey"
+ columns: ["qualityDocumentId"]
+ isOneToOne: false
+ referencedRelation: "qualityDocument"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "qualityDocumentStep_qualityDocumentId_fkey"
+ columns: ["qualityDocumentId"]
+ isOneToOne: false
+ referencedRelation: "qualityDocuments"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "qualityDocumentStep_unitOfMeasureCode_fkey"
+ columns: ["unitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "qualityDocumentStep_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "qualityDocumentStep_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "qualityDocumentStep_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "qualityDocumentStep_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "qualityDocumentStep_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ quote: {
+ Row: {
+ assignee: string | null
+ companyId: string
+ completedDate: string | null
+ createdAt: string
+ createdBy: string
+ currencyCode: string | null
+ customerContactId: string | null
+ customerEngineeringContactId: string | null
+ customerId: string
+ customerLocationId: string | null
+ customerReference: string | null
+ customFields: Json | null
+ digitalQuoteAcceptedBy: string | null
+ digitalQuoteAcceptedByEmail: string | null
+ digitalQuoteRejectedBy: string | null
+ digitalQuoteRejectedByEmail: string | null
+ dueDate: string | null
+ estimatorId: string | null
+ exchangeRate: number | null
+ exchangeRateUpdatedAt: string | null
+ expirationDate: string | null
+ externalLinkId: string | null
+ externalNotes: Json | null
+ id: string
+ internalNotes: Json | null
+ locationId: string | null
+ opportunityId: string | null
+ quoteId: string
+ revisionId: number
+ salesPersonId: string | null
+ status: Database["public"]["Enums"]["quoteStatus"]
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ assignee?: string | null
+ companyId: string
+ completedDate?: string | null
+ createdAt?: string
+ createdBy: string
+ currencyCode?: string | null
+ customerContactId?: string | null
+ customerEngineeringContactId?: string | null
+ customerId: string
+ customerLocationId?: string | null
+ customerReference?: string | null
+ customFields?: Json | null
+ digitalQuoteAcceptedBy?: string | null
+ digitalQuoteAcceptedByEmail?: string | null
+ digitalQuoteRejectedBy?: string | null
+ digitalQuoteRejectedByEmail?: string | null
+ dueDate?: string | null
+ estimatorId?: string | null
+ exchangeRate?: number | null
+ exchangeRateUpdatedAt?: string | null
+ expirationDate?: string | null
+ externalLinkId?: string | null
+ externalNotes?: Json | null
+ id?: string
+ internalNotes?: Json | null
+ locationId?: string | null
+ opportunityId?: string | null
+ quoteId: string
+ revisionId?: number
+ salesPersonId?: string | null
+ status?: Database["public"]["Enums"]["quoteStatus"]
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ assignee?: string | null
+ companyId?: string
+ completedDate?: string | null
+ createdAt?: string
+ createdBy?: string
+ currencyCode?: string | null
+ customerContactId?: string | null
+ customerEngineeringContactId?: string | null
+ customerId?: string
+ customerLocationId?: string | null
+ customerReference?: string | null
+ customFields?: Json | null
+ digitalQuoteAcceptedBy?: string | null
+ digitalQuoteAcceptedByEmail?: string | null
+ digitalQuoteRejectedBy?: string | null
+ digitalQuoteRejectedByEmail?: string | null
+ dueDate?: string | null
+ estimatorId?: string | null
+ exchangeRate?: number | null
+ exchangeRateUpdatedAt?: string | null
+ expirationDate?: string | null
+ externalLinkId?: string | null
+ externalNotes?: Json | null
+ id?: string
+ internalNotes?: Json | null
+ locationId?: string | null
+ opportunityId?: string | null
+ quoteId?: string
+ revisionId?: number
+ salesPersonId?: string | null
+ status?: Database["public"]["Enums"]["quoteStatus"]
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "quote_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "quote_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "quote_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "quote_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "quote_currencyCode_fkey"
+ columns: ["currencyCode"]
+ isOneToOne: false
+ referencedRelation: "currencyCode"
+ referencedColumns: ["code"]
+ },
+ {
+ foreignKeyName: "quote_customerContactId_fkey"
+ columns: ["customerContactId"]
+ isOneToOne: false
+ referencedRelation: "customerContact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_customerEngineeringContactId_fkey"
+ columns: ["customerEngineeringContactId"]
+ isOneToOne: false
+ referencedRelation: "customerContact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_customerLocationId_fkey"
+ columns: ["customerLocationId"]
+ isOneToOne: false
+ referencedRelation: "customerLocation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "quote_externalLinkId_fkey"
+ columns: ["externalLinkId"]
+ isOneToOne: false
+ referencedRelation: "externalLink"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_opportunityId_fkey"
+ columns: ["opportunityId"]
+ isOneToOne: false
+ referencedRelation: "opportunity"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_salesPersonId_fkey"
+ columns: ["salesPersonId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_salesPersonId_fkey"
+ columns: ["salesPersonId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_salesPersonId_fkey"
+ columns: ["salesPersonId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_salesPersonId_fkey"
+ columns: ["salesPersonId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_salesPersonId_fkey"
+ columns: ["salesPersonId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "quote_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ quoteFavorite: {
+ Row: {
+ quoteId: string
+ userId: string
+ }
+ Insert: {
+ quoteId: string
+ userId: string
+ }
+ Update: {
+ quoteId?: string
+ userId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "quoteFavorites_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quote"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteFavorites_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quoteCustomerDetails"
+ referencedColumns: ["quoteId"]
+ },
+ {
+ foreignKeyName: "quoteFavorites_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quotes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ quoteLine: {
+ Row: {
+ additionalCharges: Json | null
+ companyId: string
+ configuration: Json | null
+ createdBy: string
+ customerPartId: string | null
+ customerPartRevision: string | null
+ customFields: Json | null
+ description: string
+ estimatorId: string | null
+ externalNotes: Json | null
+ id: string
+ internalNotes: Json | null
+ itemId: string
+ itemType: string
+ locationId: string | null
+ methodType: Database["public"]["Enums"]["methodType"]
+ modelUploadId: string | null
+ noQuoteReason: string | null
+ priceTrace: Json | null
+ pricingRuleId: string | null
+ quantity: number[] | null
+ quoteId: string
+ quoteRevisionId: number
+ sortOrder: number
+ status: Database["public"]["Enums"]["quoteLineStatus"]
+ tags: string[] | null
+ taxPercent: number
+ unitOfMeasureCode: string | null
+ unitPricePrecision: number
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ additionalCharges?: Json | null
+ companyId: string
+ configuration?: Json | null
+ createdBy: string
+ customerPartId?: string | null
+ customerPartRevision?: string | null
+ customFields?: Json | null
+ description: string
+ estimatorId?: string | null
+ externalNotes?: Json | null
+ id?: string
+ internalNotes?: Json | null
+ itemId: string
+ itemType?: string
+ locationId?: string | null
+ methodType?: Database["public"]["Enums"]["methodType"]
+ modelUploadId?: string | null
+ noQuoteReason?: string | null
+ priceTrace?: Json | null
+ pricingRuleId?: string | null
+ quantity?: number[] | null
+ quoteId: string
+ quoteRevisionId?: number
+ sortOrder?: number
+ status?: Database["public"]["Enums"]["quoteLineStatus"]
+ tags?: string[] | null
+ taxPercent?: number
+ unitOfMeasureCode?: string | null
+ unitPricePrecision?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ additionalCharges?: Json | null
+ companyId?: string
+ configuration?: Json | null
+ createdBy?: string
+ customerPartId?: string | null
+ customerPartRevision?: string | null
+ customFields?: Json | null
+ description?: string
+ estimatorId?: string | null
+ externalNotes?: Json | null
+ id?: string
+ internalNotes?: Json | null
+ itemId?: string
+ itemType?: string
+ locationId?: string | null
+ methodType?: Database["public"]["Enums"]["methodType"]
+ modelUploadId?: string | null
+ noQuoteReason?: string | null
+ priceTrace?: Json | null
+ pricingRuleId?: string | null
+ quantity?: number[] | null
+ quoteId?: string
+ quoteRevisionId?: number
+ sortOrder?: number
+ status?: Database["public"]["Enums"]["quoteLineStatus"]
+ tags?: string[] | null
+ taxPercent?: number
+ unitOfMeasureCode?: string | null
+ unitPricePrecision?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "quoteLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "quoteLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "quoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "quoteLine_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "quoteLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "quoteLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "modelUpload"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "salesRfqLines"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "quoteLine_pricingRuleId_fkey"
+ columns: ["pricingRuleId"]
+ isOneToOne: false
+ referencedRelation: "pricingRule"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quote"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quoteCustomerDetails"
+ referencedColumns: ["quoteId"]
+ },
+ {
+ foreignKeyName: "quoteLine_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quotes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_unitOfMeasureCode_fkey"
+ columns: ["unitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "quoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ quoteLinePrice: {
+ Row: {
+ categoryMarkups: Json | null
+ convertedNetExtendedPrice: number | null
+ convertedNetUnitPrice: number | null
+ convertedShippingCost: number | null
+ convertedUnitPrice: number | null
+ createdAt: string
+ createdBy: string
+ discountPercent: number
+ exchangeRate: number | null
+ leadTime: number
+ netExtendedPrice: number | null
+ netUnitPrice: number | null
+ quantity: number
+ quoteId: string
+ quoteLineId: string
+ shippingCost: number
+ unitPrice: number
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ categoryMarkups?: Json | null
+ convertedNetExtendedPrice?: number | null
+ convertedNetUnitPrice?: number | null
+ convertedShippingCost?: number | null
+ convertedUnitPrice?: number | null
+ createdAt?: string
+ createdBy: string
+ discountPercent?: number
+ exchangeRate?: number | null
+ leadTime?: number
+ netExtendedPrice?: number | null
+ netUnitPrice?: number | null
+ quantity?: number
+ quoteId: string
+ quoteLineId: string
+ shippingCost?: number
+ unitPrice?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ categoryMarkups?: Json | null
+ convertedNetExtendedPrice?: number | null
+ convertedNetUnitPrice?: number | null
+ convertedShippingCost?: number | null
+ convertedUnitPrice?: number | null
+ createdAt?: string
+ createdBy?: string
+ discountPercent?: number
+ exchangeRate?: number | null
+ leadTime?: number
+ netExtendedPrice?: number | null
+ netUnitPrice?: number | null
+ quantity?: number
+ quoteId?: string
+ quoteLineId?: string
+ shippingCost?: number
+ unitPrice?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "quoteLinePrice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLinePrice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLinePrice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLinePrice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLinePrice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "quoteLinePrice_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quote"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLinePrice_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quoteCustomerDetails"
+ referencedColumns: ["quoteId"]
+ },
+ {
+ foreignKeyName: "quoteLinePrice_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quotes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLinePrice_quoteLineId_fkey"
+ columns: ["quoteLineId"]
+ isOneToOne: false
+ referencedRelation: "quoteLine"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLinePrice_quoteLineId_fkey"
+ columns: ["quoteLineId"]
+ isOneToOne: false
+ referencedRelation: "quoteLinePrices"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLinePrice_quoteLineId_fkey"
+ columns: ["quoteLineId"]
+ isOneToOne: false
+ referencedRelation: "quoteLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLinePrice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLinePrice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLinePrice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLinePrice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLinePrice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ quoteMakeMethod: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ id: string
+ itemId: string
+ parentMaterialId: string | null
+ quantityPerParent: number
+ quoteId: string
+ quoteLineId: string
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ version: number
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ id?: string
+ itemId: string
+ parentMaterialId?: string | null
+ quantityPerParent?: number
+ quoteId: string
+ quoteLineId: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ version?: number
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ id?: string
+ itemId?: string
+ parentMaterialId?: string | null
+ quantityPerParent?: number
+ quoteId?: string
+ quoteLineId?: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ version?: number
+ }
+ Relationships: [
+ {
+ foreignKeyName: "quoteMakeMethod_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMakeMethod_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMakeMethod_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "quoteMakeMethod_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "quoteMakeMethod_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMakeMethod_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMakeMethod_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMakeMethod_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMakeMethod_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "quoteMakeMethod_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMakeMethod_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMakeMethod_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMakeMethod_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMakeMethod_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMakeMethod_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMakeMethod_parentMaterialId_fkey"
+ columns: ["parentMaterialId"]
+ isOneToOne: false
+ referencedRelation: "quoteMaterial"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMakeMethod_parentMaterialId_fkey"
+ columns: ["parentMaterialId"]
+ isOneToOne: false
+ referencedRelation: "quoteMaterialWithMakeMethodId"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMakeMethod_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quote"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMakeMethod_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quoteCustomerDetails"
+ referencedColumns: ["quoteId"]
+ },
+ {
+ foreignKeyName: "quoteMakeMethod_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quotes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMakeMethod_quoteLineId_fkey"
+ columns: ["quoteLineId"]
+ isOneToOne: false
+ referencedRelation: "quoteLine"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMakeMethod_quoteLineId_fkey"
+ columns: ["quoteLineId"]
+ isOneToOne: false
+ referencedRelation: "quoteLinePrices"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMakeMethod_quoteLineId_fkey"
+ columns: ["quoteLineId"]
+ isOneToOne: false
+ referencedRelation: "quoteLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMakeMethod_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMakeMethod_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMakeMethod_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMakeMethod_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMakeMethod_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ quoteMaterial: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ description: string
+ id: string
+ itemId: string
+ itemType: string
+ kit: boolean
+ methodType: Database["public"]["Enums"]["methodType"]
+ order: number
+ productionQuantity: number | null
+ quantity: number
+ quoteId: string
+ quoteLineId: string
+ quoteMakeMethodId: string
+ quoteOperationId: string | null
+ scrapQuantity: number
+ storageUnitId: string | null
+ tags: string[] | null
+ unitCost: number
+ unitOfMeasureCode: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ description: string
+ id?: string
+ itemId: string
+ itemType?: string
+ kit?: boolean
+ methodType?: Database["public"]["Enums"]["methodType"]
+ order?: number
+ productionQuantity?: number | null
+ quantity?: number
+ quoteId: string
+ quoteLineId: string
+ quoteMakeMethodId: string
+ quoteOperationId?: string | null
+ scrapQuantity?: number
+ storageUnitId?: string | null
+ tags?: string[] | null
+ unitCost?: number
+ unitOfMeasureCode?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ description?: string
+ id?: string
+ itemId?: string
+ itemType?: string
+ kit?: boolean
+ methodType?: Database["public"]["Enums"]["methodType"]
+ order?: number
+ productionQuantity?: number | null
+ quantity?: number
+ quoteId?: string
+ quoteLineId?: string
+ quoteMakeMethodId?: string
+ quoteOperationId?: string | null
+ scrapQuantity?: number
+ storageUnitId?: string | null
+ tags?: string[] | null
+ unitCost?: number
+ unitOfMeasureCode?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "quoteMaterial_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quote"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quoteCustomerDetails"
+ referencedColumns: ["quoteId"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quotes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_quoteLineId_fkey"
+ columns: ["quoteLineId"]
+ isOneToOne: false
+ referencedRelation: "quoteLine"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_quoteLineId_fkey"
+ columns: ["quoteLineId"]
+ isOneToOne: false
+ referencedRelation: "quoteLinePrices"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_quoteLineId_fkey"
+ columns: ["quoteLineId"]
+ isOneToOne: false
+ referencedRelation: "quoteLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_quoteMakeMethodId_fkey"
+ columns: ["quoteMakeMethodId"]
+ isOneToOne: false
+ referencedRelation: "quoteMakeMethod"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_quoteMakeMethodId_fkey"
+ columns: ["quoteMakeMethodId"]
+ isOneToOne: false
+ referencedRelation: "quoteMaterialWithMakeMethodId"
+ referencedColumns: ["quoteMaterialMakeMethodId"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_quoteOperationId_fkey"
+ columns: ["quoteOperationId"]
+ isOneToOne: false
+ referencedRelation: "quoteOperation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_quoteOperationId_fkey"
+ columns: ["quoteOperationId"]
+ isOneToOne: false
+ referencedRelation: "quoteOperationsWithMakeMethods"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_storageUnitId_fkey"
+ columns: ["storageUnitId"]
+ isOneToOne: false
+ referencedRelation: "storageUnit"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_unitOfMeasureCode_fkey"
+ columns: ["unitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ quoteOperation: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ description: string | null
+ id: string
+ laborRate: number
+ laborTime: number
+ laborUnit: Database["public"]["Enums"]["factor"]
+ machineRate: number | null
+ machineTime: number
+ machineUnit: Database["public"]["Enums"]["factor"]
+ operationLeadTime: number
+ operationMinimumCost: number
+ operationOrder: Database["public"]["Enums"]["methodOperationOrder"]
+ operationSupplierProcessId: string | null
+ operationType: Database["public"]["Enums"]["operationType"]
+ operationUnitCost: number
+ order: number
+ overheadRate: number
+ procedureId: string | null
+ processId: string
+ quoteId: string
+ quoteLineId: string
+ quoteMakeMethodId: string | null
+ setupTime: number
+ setupUnit: Database["public"]["Enums"]["factor"]
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ workCenterId: string | null
+ workInstruction: Json
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ description?: string | null
+ id?: string
+ laborRate?: number
+ laborTime?: number
+ laborUnit?: Database["public"]["Enums"]["factor"]
+ machineRate?: number | null
+ machineTime?: number
+ machineUnit?: Database["public"]["Enums"]["factor"]
+ operationLeadTime?: number
+ operationMinimumCost?: number
+ operationOrder?: Database["public"]["Enums"]["methodOperationOrder"]
+ operationSupplierProcessId?: string | null
+ operationType?: Database["public"]["Enums"]["operationType"]
+ operationUnitCost?: number
+ order?: number
+ overheadRate?: number
+ procedureId?: string | null
+ processId: string
+ quoteId: string
+ quoteLineId: string
+ quoteMakeMethodId?: string | null
+ setupTime?: number
+ setupUnit?: Database["public"]["Enums"]["factor"]
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ workCenterId?: string | null
+ workInstruction?: Json
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ description?: string | null
+ id?: string
+ laborRate?: number
+ laborTime?: number
+ laborUnit?: Database["public"]["Enums"]["factor"]
+ machineRate?: number | null
+ machineTime?: number
+ machineUnit?: Database["public"]["Enums"]["factor"]
+ operationLeadTime?: number
+ operationMinimumCost?: number
+ operationOrder?: Database["public"]["Enums"]["methodOperationOrder"]
+ operationSupplierProcessId?: string | null
+ operationType?: Database["public"]["Enums"]["operationType"]
+ operationUnitCost?: number
+ order?: number
+ overheadRate?: number
+ procedureId?: string | null
+ processId?: string
+ quoteId?: string
+ quoteLineId?: string
+ quoteMakeMethodId?: string | null
+ setupTime?: number
+ setupUnit?: Database["public"]["Enums"]["factor"]
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ workCenterId?: string | null
+ workInstruction?: Json
+ }
+ Relationships: [
+ {
+ foreignKeyName: "quoteOperation_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "quoteOperation_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "quoteOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "quoteOperation_operationSupplierProcessId_fkey"
+ columns: ["operationSupplierProcessId"]
+ isOneToOne: false
+ referencedRelation: "supplierProcess"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_operationSupplierProcessId_fkey"
+ columns: ["operationSupplierProcessId"]
+ isOneToOne: false
+ referencedRelation: "supplierProcesses"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_procedureId_fkey"
+ columns: ["procedureId"]
+ isOneToOne: false
+ referencedRelation: "procedure"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_procedureId_fkey"
+ columns: ["procedureId"]
+ isOneToOne: false
+ referencedRelation: "procedures"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_processId_fkey"
+ columns: ["processId"]
+ isOneToOne: false
+ referencedRelation: "process"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_processId_fkey"
+ columns: ["processId"]
+ isOneToOne: false
+ referencedRelation: "processes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quote"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quoteCustomerDetails"
+ referencedColumns: ["quoteId"]
+ },
+ {
+ foreignKeyName: "quoteOperation_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quotes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_quoteLineId_fkey"
+ columns: ["quoteLineId"]
+ isOneToOne: false
+ referencedRelation: "quoteLine"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_quoteLineId_fkey"
+ columns: ["quoteLineId"]
+ isOneToOne: false
+ referencedRelation: "quoteLinePrices"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_quoteLineId_fkey"
+ columns: ["quoteLineId"]
+ isOneToOne: false
+ referencedRelation: "quoteLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_quoteMakeMethodId_fkey"
+ columns: ["quoteMakeMethodId"]
+ isOneToOne: false
+ referencedRelation: "quoteMakeMethod"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_quoteMakeMethodId_fkey"
+ columns: ["quoteMakeMethodId"]
+ isOneToOne: false
+ referencedRelation: "quoteMaterialWithMakeMethodId"
+ referencedColumns: ["quoteMaterialMakeMethodId"]
+ },
+ {
+ foreignKeyName: "quoteOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "quoteOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "riskRegisters"
+ referencedColumns: ["workCenterId"]
+ },
+ {
+ foreignKeyName: "quoteOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenter"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenters"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ quoteOperationParameter: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ key: string
+ operationId: string
+ updatedAt: string | null
+ updatedBy: string | null
+ value: string
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ key: string
+ operationId: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ value: string
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ key?: string
+ operationId?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ value?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "quoteOperationParameter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationParameter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationParameter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationParameter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationParameter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "quoteOperationParameter_operationId_fkey"
+ columns: ["operationId"]
+ isOneToOne: false
+ referencedRelation: "quoteOperation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationParameter_operationId_fkey"
+ columns: ["operationId"]
+ isOneToOne: false
+ referencedRelation: "quoteOperationsWithMakeMethods"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationParameter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationParameter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationParameter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationParameter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationParameter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ quoteOperationStep: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ description: Json | null
+ fileTypes: string[] | null
+ id: string
+ listValues: string[] | null
+ maxValue: number | null
+ minValue: number | null
+ name: string
+ operationId: string
+ required: boolean | null
+ sortOrder: number
+ type: Database["public"]["Enums"]["procedureStepType"]
+ unitOfMeasureCode: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ description?: Json | null
+ fileTypes?: string[] | null
+ id?: string
+ listValues?: string[] | null
+ maxValue?: number | null
+ minValue?: number | null
+ name: string
+ operationId: string
+ required?: boolean | null
+ sortOrder?: number
+ type: Database["public"]["Enums"]["procedureStepType"]
+ unitOfMeasureCode?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ description?: Json | null
+ fileTypes?: string[] | null
+ id?: string
+ listValues?: string[] | null
+ maxValue?: number | null
+ minValue?: number | null
+ name?: string
+ operationId?: string
+ required?: boolean | null
+ sortOrder?: number
+ type?: Database["public"]["Enums"]["procedureStepType"]
+ unitOfMeasureCode?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "quoteOperationAttribute_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationAttribute_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationAttribute_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationAttribute_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationAttribute_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "quoteOperationAttribute_operationId_fkey"
+ columns: ["operationId"]
+ isOneToOne: false
+ referencedRelation: "quoteOperation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationAttribute_operationId_fkey"
+ columns: ["operationId"]
+ isOneToOne: false
+ referencedRelation: "quoteOperationsWithMakeMethods"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationAttribute_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationAttribute_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationAttribute_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationAttribute_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationAttribute_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ quoteOperationTool: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ operationId: string
+ quantity: number
+ toolId: string
+ updatedAt: string
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ operationId: string
+ quantity?: number
+ toolId: string
+ updatedAt?: string
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ operationId?: string
+ quantity?: number
+ toolId?: string
+ updatedAt?: string
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "quoteOperationTool_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationTool_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationTool_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "quoteOperationTool_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "quoteOperationTool_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationTool_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationTool_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationTool_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationTool_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "quoteOperationTool_operationId_fkey"
+ columns: ["operationId"]
+ isOneToOne: false
+ referencedRelation: "quoteOperation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationTool_operationId_fkey"
+ columns: ["operationId"]
+ isOneToOne: false
+ referencedRelation: "quoteOperationsWithMakeMethods"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationTool_toolId_fkey"
+ columns: ["toolId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationTool_toolId_fkey"
+ columns: ["toolId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationTool_toolId_fkey"
+ columns: ["toolId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationTool_toolId_fkey"
+ columns: ["toolId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationTool_toolId_fkey"
+ columns: ["toolId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationTool_toolId_fkey"
+ columns: ["toolId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationTool_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationTool_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationTool_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationTool_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperationTool_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ quotePayment: {
+ Row: {
+ companyId: string
+ customFields: Json | null
+ id: string
+ invoiceCustomerContactId: string | null
+ invoiceCustomerId: string | null
+ invoiceCustomerLocationId: string | null
+ paymentTermId: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ customFields?: Json | null
+ id: string
+ invoiceCustomerContactId?: string | null
+ invoiceCustomerId?: string | null
+ invoiceCustomerLocationId?: string | null
+ paymentTermId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ customFields?: Json | null
+ id?: string
+ invoiceCustomerContactId?: string | null
+ invoiceCustomerId?: string | null
+ invoiceCustomerLocationId?: string | null
+ paymentTermId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "quotePayment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quotePayment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quotePayment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "quotePayment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "quotePayment_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "quote"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quotePayment_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "quoteCustomerDetails"
+ referencedColumns: ["quoteId"]
+ },
+ {
+ foreignKeyName: "quotePayment_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "quotes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quotePayment_invoiceCustomerContactId_fkey"
+ columns: ["invoiceCustomerContactId"]
+ isOneToOne: false
+ referencedRelation: "customerContact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quotePayment_invoiceCustomerId_fkey"
+ columns: ["invoiceCustomerId"]
+ isOneToOne: false
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quotePayment_invoiceCustomerId_fkey"
+ columns: ["invoiceCustomerId"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quotePayment_invoiceCustomerId_fkey"
+ columns: ["invoiceCustomerId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quotePayment_invoiceCustomerLocationId_fkey"
+ columns: ["invoiceCustomerLocationId"]
+ isOneToOne: false
+ referencedRelation: "customerLocation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quotePayment_paymentTermId_fkey"
+ columns: ["paymentTermId"]
+ isOneToOne: false
+ referencedRelation: "paymentTerm"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ quoteShipment: {
+ Row: {
+ companyId: string
+ id: string
+ incoterm: Database["public"]["Enums"]["incoterm"] | null
+ incotermLocation: string | null
+ locationId: string | null
+ receiptRequestedDate: string | null
+ shippingCost: number | null
+ shippingMethodId: string | null
+ shippingTermId: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ id: string
+ incoterm?: Database["public"]["Enums"]["incoterm"] | null
+ incotermLocation?: string | null
+ locationId?: string | null
+ receiptRequestedDate?: string | null
+ shippingCost?: number | null
+ shippingMethodId?: string | null
+ shippingTermId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ id?: string
+ incoterm?: Database["public"]["Enums"]["incoterm"] | null
+ incotermLocation?: string | null
+ locationId?: string | null
+ receiptRequestedDate?: string | null
+ shippingCost?: number | null
+ shippingMethodId?: string | null
+ shippingTermId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "quoteShipment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteShipment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteShipment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "quoteShipment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "quoteShipment_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "quote"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteShipment_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "quoteCustomerDetails"
+ referencedColumns: ["quoteId"]
+ },
+ {
+ foreignKeyName: "quoteShipment_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "quotes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteShipment_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteShipment_shippingMethodId_fkey"
+ columns: ["shippingMethodId"]
+ isOneToOne: false
+ referencedRelation: "shippingMethod"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteShipment_shippingTermId_fkey"
+ columns: ["shippingTermId"]
+ isOneToOne: false
+ referencedRelation: "shippingTerm"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteShipment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteShipment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteShipment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteShipment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteShipment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ receipt: {
+ Row: {
+ assignee: string | null
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ externalDocumentId: string | null
+ id: string
+ internalNotes: Json | null
+ invoiced: boolean | null
+ locationId: string | null
+ postedBy: string | null
+ postingDate: string | null
+ receiptId: string
+ sourceDocument:
+ | Database["public"]["Enums"]["receiptSourceDocument"]
+ | null
+ sourceDocumentId: string | null
+ sourceDocumentReadableId: string | null
+ status: Database["public"]["Enums"]["receiptStatus"]
+ supplierId: string | null
+ supplierInteractionId: string | null
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ assignee?: string | null
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ externalDocumentId?: string | null
+ id?: string
+ internalNotes?: Json | null
+ invoiced?: boolean | null
+ locationId?: string | null
+ postedBy?: string | null
+ postingDate?: string | null
+ receiptId: string
+ sourceDocument?:
+ | Database["public"]["Enums"]["receiptSourceDocument"]
+ | null
+ sourceDocumentId?: string | null
+ sourceDocumentReadableId?: string | null
+ status?: Database["public"]["Enums"]["receiptStatus"]
+ supplierId?: string | null
+ supplierInteractionId?: string | null
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ assignee?: string | null
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ externalDocumentId?: string | null
+ id?: string
+ internalNotes?: Json | null
+ invoiced?: boolean | null
+ locationId?: string | null
+ postedBy?: string | null
+ postingDate?: string | null
+ receiptId?: string
+ sourceDocument?:
+ | Database["public"]["Enums"]["receiptSourceDocument"]
+ | null
+ sourceDocumentId?: string | null
+ sourceDocumentReadableId?: string | null
+ status?: Database["public"]["Enums"]["receiptStatus"]
+ supplierId?: string | null
+ supplierInteractionId?: string | null
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "receipt_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "receipt_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "receipt_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "receipt_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "receipt_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_postedBy_fkey"
+ columns: ["postedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_postedBy_fkey"
+ columns: ["postedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_postedBy_fkey"
+ columns: ["postedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_postedBy_fkey"
+ columns: ["postedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_postedBy_fkey"
+ columns: ["postedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "receipt_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "receipt_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "receipt_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_supplierInteractionId_fkey"
+ columns: ["supplierInteractionId"]
+ isOneToOne: false
+ referencedRelation: "supplierInteraction"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ receiptFixedAssetLine: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ purchaseOrderLineId: string
+ receiptId: string
+ received: boolean
+ serialNumber: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ purchaseOrderLineId: string
+ receiptId: string
+ received?: boolean
+ serialNumber?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ purchaseOrderLineId?: string
+ receiptId?: string
+ received?: boolean
+ serialNumber?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "receiptFixedAssetLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptFixedAssetLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptFixedAssetLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "receiptFixedAssetLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "receiptFixedAssetLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptFixedAssetLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptFixedAssetLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptFixedAssetLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptFixedAssetLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "receiptFixedAssetLine_purchaseOrderLineId_fkey"
+ columns: ["purchaseOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "openPurchaseOrderLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptFixedAssetLine_purchaseOrderLineId_fkey"
+ columns: ["purchaseOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderLine"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptFixedAssetLine_purchaseOrderLineId_fkey"
+ columns: ["purchaseOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptFixedAssetLine_receiptId_fkey"
+ columns: ["receiptId"]
+ isOneToOne: false
+ referencedRelation: "receipt"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptFixedAssetLine_receiptId_fkey"
+ columns: ["receiptId"]
+ isOneToOne: false
+ referencedRelation: "receipts"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ receiptLine: {
+ Row: {
+ companyId: string
+ conversionFactor: number | null
+ createdAt: string
+ createdBy: string
+ id: string
+ itemId: string
+ lineId: string | null
+ locationId: string | null
+ orderQuantity: number
+ outstandingQuantity: number
+ receiptId: string
+ receivedQuantity: number
+ requiresBatchTracking: boolean
+ requiresSerialTracking: boolean
+ storageUnitId: string | null
+ unitOfMeasure: string
+ unitPrice: number
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ conversionFactor?: number | null
+ createdAt?: string
+ createdBy: string
+ id?: string
+ itemId: string
+ lineId?: string | null
+ locationId?: string | null
+ orderQuantity: number
+ outstandingQuantity?: number
+ receiptId: string
+ receivedQuantity?: number
+ requiresBatchTracking?: boolean
+ requiresSerialTracking?: boolean
+ storageUnitId?: string | null
+ unitOfMeasure: string
+ unitPrice: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ conversionFactor?: number | null
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ itemId?: string
+ lineId?: string | null
+ locationId?: string | null
+ orderQuantity?: number
+ outstandingQuantity?: number
+ receiptId?: string
+ receivedQuantity?: number
+ requiresBatchTracking?: boolean
+ requiresSerialTracking?: boolean
+ storageUnitId?: string | null
+ unitOfMeasure?: string
+ unitPrice?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "receiptLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "receiptLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_receiptId_fkey"
+ columns: ["receiptId"]
+ isOneToOne: false
+ referencedRelation: "receipt"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_receiptId_fkey"
+ columns: ["receiptId"]
+ isOneToOne: false
+ referencedRelation: "receipts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_storageUnitId_fkey"
+ columns: ["storageUnitId"]
+ isOneToOne: false
+ referencedRelation: "storageUnit"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ rework: {
+ Row: {
+ companyId: string
+ completedAt: string | null
+ createdAt: string
+ id: string
+ jobId: string
+ quantity: number
+ reason: string
+ requestedById: string
+ targetJobOperationId: string
+ triggeredAtJobOperationId: string
+ updatedAt: string | null
+ }
+ Insert: {
+ companyId: string
+ completedAt?: string | null
+ createdAt?: string
+ id?: string
+ jobId: string
+ quantity: number
+ reason: string
+ requestedById: string
+ targetJobOperationId: string
+ triggeredAtJobOperationId: string
+ updatedAt?: string | null
+ }
+ Update: {
+ companyId?: string
+ completedAt?: string | null
+ createdAt?: string
+ id?: string
+ jobId?: string
+ quantity?: number
+ reason?: string
+ requestedById?: string
+ targetJobOperationId?: string
+ triggeredAtJobOperationId?: string
+ updatedAt?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "rework_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "rework_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "rework_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "rework_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "rework_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "job"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "rework_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "rework_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "openProductionOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "rework_requestedById_fkey"
+ columns: ["requestedById"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "rework_requestedById_fkey"
+ columns: ["requestedById"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "rework_requestedById_fkey"
+ columns: ["requestedById"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "rework_requestedById_fkey"
+ columns: ["requestedById"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "rework_requestedById_fkey"
+ columns: ["requestedById"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "rework_targetJobOperationId_fkey"
+ columns: ["targetJobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "rework_targetJobOperationId_fkey"
+ columns: ["targetJobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithDependencies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "rework_targetJobOperationId_fkey"
+ columns: ["targetJobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithMakeMethods"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "rework_triggeredAtJobOperationId_fkey"
+ columns: ["triggeredAtJobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "rework_triggeredAtJobOperationId_fkey"
+ columns: ["triggeredAtJobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithDependencies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "rework_triggeredAtJobOperationId_fkey"
+ columns: ["triggeredAtJobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithMakeMethods"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ riskRegister: {
+ Row: {
+ assignee: string | null
+ companyId: string
+ createdAt: string
+ createdBy: string | null
+ description: string | null
+ id: string
+ itemId: string | null
+ likelihood: number | null
+ notes: Json | null
+ severity: number | null
+ source: Database["public"]["Enums"]["riskSource"]
+ sourceId: string | null
+ status: Database["public"]["Enums"]["riskStatus"]
+ title: string
+ type: Database["public"]["Enums"]["riskRegisterType"]
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ assignee?: string | null
+ companyId: string
+ createdAt?: string
+ createdBy?: string | null
+ description?: string | null
+ id?: string
+ itemId?: string | null
+ likelihood?: number | null
+ notes?: Json | null
+ severity?: number | null
+ source: Database["public"]["Enums"]["riskSource"]
+ sourceId?: string | null
+ status?: Database["public"]["Enums"]["riskStatus"]
+ title: string
+ type?: Database["public"]["Enums"]["riskRegisterType"]
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ assignee?: string | null
+ companyId?: string
+ createdAt?: string
+ createdBy?: string | null
+ description?: string | null
+ id?: string
+ itemId?: string | null
+ likelihood?: number | null
+ notes?: Json | null
+ severity?: number | null
+ source?: Database["public"]["Enums"]["riskSource"]
+ sourceId?: string | null
+ status?: Database["public"]["Enums"]["riskStatus"]
+ title?: string
+ type?: Database["public"]["Enums"]["riskRegisterType"]
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "riskRegister_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "riskRegister_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "riskRegister_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "riskRegister_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "riskRegister_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ salesInvoice: {
+ Row: {
+ assignee: string | null
+ balance: number
+ companyId: string
+ createdAt: string
+ createdBy: string
+ currencyCode: string
+ customerId: string
+ customerReference: string | null
+ customFields: Json
+ dateDue: string | null
+ dateIssued: string | null
+ datePaid: string | null
+ exchangeRate: number
+ exchangeRateUpdatedAt: string | null
+ externalNotes: Json
+ id: string
+ internalNotes: Json
+ invoiceCustomerContactId: string | null
+ invoiceCustomerId: string | null
+ invoiceCustomerLocationId: string | null
+ invoiceId: string
+ locationId: string | null
+ opportunityId: string | null
+ paymentTermId: string | null
+ postingDate: string | null
+ shipmentId: string | null
+ status: Database["public"]["Enums"]["salesInvoiceStatus"]
+ subtotal: number
+ tags: string[] | null
+ totalAmount: number
+ totalDiscount: number
+ totalTax: number
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ assignee?: string | null
+ balance?: number
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ currencyCode: string
+ customerId: string
+ customerReference?: string | null
+ customFields?: Json
+ dateDue?: string | null
+ dateIssued?: string | null
+ datePaid?: string | null
+ exchangeRate?: number
+ exchangeRateUpdatedAt?: string | null
+ externalNotes?: Json
+ id?: string
+ internalNotes?: Json
+ invoiceCustomerContactId?: string | null
+ invoiceCustomerId?: string | null
+ invoiceCustomerLocationId?: string | null
+ invoiceId: string
+ locationId?: string | null
+ opportunityId?: string | null
+ paymentTermId?: string | null
+ postingDate?: string | null
+ shipmentId?: string | null
+ status?: Database["public"]["Enums"]["salesInvoiceStatus"]
+ subtotal?: number
+ tags?: string[] | null
+ totalAmount?: number
+ totalDiscount?: number
+ totalTax?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ assignee?: string | null
+ balance?: number
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ currencyCode?: string
+ customerId?: string
+ customerReference?: string | null
+ customFields?: Json
+ dateDue?: string | null
+ dateIssued?: string | null
+ datePaid?: string | null
+ exchangeRate?: number
+ exchangeRateUpdatedAt?: string | null
+ externalNotes?: Json
+ id?: string
+ internalNotes?: Json
+ invoiceCustomerContactId?: string | null
+ invoiceCustomerId?: string | null
+ invoiceCustomerLocationId?: string | null
+ invoiceId?: string
+ locationId?: string | null
+ opportunityId?: string | null
+ paymentTermId?: string | null
+ postingDate?: string | null
+ shipmentId?: string | null
+ status?: Database["public"]["Enums"]["salesInvoiceStatus"]
+ subtotal?: number
+ tags?: string[] | null
+ totalAmount?: number
+ totalDiscount?: number
+ totalTax?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "salesInvoice_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "salesInvoice_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "salesInvoice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "salesInvoice_currencyCode_fkey"
+ columns: ["currencyCode"]
+ isOneToOne: false
+ referencedRelation: "currencyCode"
+ referencedColumns: ["code"]
+ },
+ {
+ foreignKeyName: "salesInvoice_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_invoiceCustomerContactId_fkey"
+ columns: ["invoiceCustomerContactId"]
+ isOneToOne: false
+ referencedRelation: "customerContact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_invoiceCustomerId_fkey"
+ columns: ["invoiceCustomerId"]
+ isOneToOne: false
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_invoiceCustomerId_fkey"
+ columns: ["invoiceCustomerId"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_invoiceCustomerId_fkey"
+ columns: ["invoiceCustomerId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_invoiceCustomerLocationId_fkey"
+ columns: ["invoiceCustomerLocationId"]
+ isOneToOne: false
+ referencedRelation: "customerLocation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_opportunityId_fkey"
+ columns: ["opportunityId"]
+ isOneToOne: false
+ referencedRelation: "opportunity"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_paymentTermId_fkey"
+ columns: ["paymentTermId"]
+ isOneToOne: false
+ referencedRelation: "paymentTerm"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_shipmentId_fkey"
+ columns: ["shipmentId"]
+ isOneToOne: false
+ referencedRelation: "shipment"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ salesInvoiceLine: {
+ Row: {
+ accountId: string | null
+ addOnCost: number
+ assetId: string | null
+ companyId: string
+ convertedAddOnCost: number | null
+ convertedNonTaxableAddOnCost: number | null
+ convertedSetupPrice: number | null
+ convertedShippingCost: number | null
+ convertedUnitPrice: number | null
+ createdAt: string
+ createdBy: string
+ customFields: Json
+ description: string | null
+ exchangeRate: number
+ externalNotes: Json
+ id: string
+ internalNotes: Json
+ invoiceId: string
+ invoiceLineType: Database["public"]["Enums"]["salesInvoiceLineType"]
+ itemId: string | null
+ locationId: string | null
+ methodType: Database["public"]["Enums"]["methodType"]
+ modelUploadId: string | null
+ nonTaxableAddOnCost: number
+ opportunityId: string | null
+ quantity: number
+ salesOrderId: string | null
+ salesOrderLineId: string | null
+ setupPrice: number
+ shippingCost: number
+ sortOrder: number
+ storageUnitId: string | null
+ taxPercent: number
+ unitOfMeasureCode: string
+ unitPrice: number
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ accountId?: string | null
+ addOnCost?: number
+ assetId?: string | null
+ companyId: string
+ convertedAddOnCost?: number | null
+ convertedNonTaxableAddOnCost?: number | null
+ convertedSetupPrice?: number | null
+ convertedShippingCost?: number | null
+ convertedUnitPrice?: number | null
+ createdAt?: string
+ createdBy: string
+ customFields?: Json
+ description?: string | null
+ exchangeRate?: number
+ externalNotes?: Json
+ id?: string
+ internalNotes?: Json
+ invoiceId: string
+ invoiceLineType: Database["public"]["Enums"]["salesInvoiceLineType"]
+ itemId?: string | null
+ locationId?: string | null
+ methodType?: Database["public"]["Enums"]["methodType"]
+ modelUploadId?: string | null
+ nonTaxableAddOnCost?: number
+ opportunityId?: string | null
+ quantity?: number
+ salesOrderId?: string | null
+ salesOrderLineId?: string | null
+ setupPrice?: number
+ shippingCost?: number
+ sortOrder?: number
+ storageUnitId?: string | null
+ taxPercent?: number
+ unitOfMeasureCode: string
+ unitPrice?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ accountId?: string | null
+ addOnCost?: number
+ assetId?: string | null
+ companyId?: string
+ convertedAddOnCost?: number | null
+ convertedNonTaxableAddOnCost?: number | null
+ convertedSetupPrice?: number | null
+ convertedShippingCost?: number | null
+ convertedUnitPrice?: number | null
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json
+ description?: string | null
+ exchangeRate?: number
+ externalNotes?: Json
+ id?: string
+ internalNotes?: Json
+ invoiceId?: string
+ invoiceLineType?: Database["public"]["Enums"]["salesInvoiceLineType"]
+ itemId?: string | null
+ locationId?: string | null
+ methodType?: Database["public"]["Enums"]["methodType"]
+ modelUploadId?: string | null
+ nonTaxableAddOnCost?: number
+ opportunityId?: string | null
+ quantity?: number
+ salesOrderId?: string | null
+ salesOrderLineId?: string | null
+ setupPrice?: number
+ shippingCost?: number
+ sortOrder?: number
+ storageUnitId?: string | null
+ taxPercent?: number
+ unitOfMeasureCode?: string
+ unitPrice?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "salesInvoiceLine_accountId_fkey"
+ columns: ["accountId"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_accountId_fkey"
+ columns: ["accountId"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_assetId_fkey"
+ columns: ["assetId"]
+ isOneToOne: false
+ referencedRelation: "fixedAsset"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_invoiceId_fkey"
+ columns: ["invoiceId"]
+ isOneToOne: false
+ referencedRelation: "salesInvoice"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_invoiceId_fkey"
+ columns: ["invoiceId"]
+ isOneToOne: false
+ referencedRelation: "salesInvoiceLocations"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_invoiceId_fkey"
+ columns: ["invoiceId"]
+ isOneToOne: false
+ referencedRelation: "salesInvoices"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "modelUpload"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "salesRfqLines"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_opportunityId_fkey"
+ columns: ["opportunityId"]
+ isOneToOne: false
+ referencedRelation: "opportunity"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrder"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderLocations"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_salesOrderLineId_fkey"
+ columns: ["salesOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "openSalesOrderLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_salesOrderLineId_fkey"
+ columns: ["salesOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderLine"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_salesOrderLineId_fkey"
+ columns: ["salesOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_storageUnitId_fkey"
+ columns: ["storageUnitId"]
+ isOneToOne: false
+ referencedRelation: "storageUnit"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ salesInvoiceShipment: {
+ Row: {
+ companyId: string | null
+ createdAt: string
+ createdBy: string
+ customFields: Json
+ id: string
+ incoterm: Database["public"]["Enums"]["incoterm"] | null
+ incotermLocation: string | null
+ locationId: string | null
+ shippingCost: number
+ shippingMethodId: string | null
+ shippingTermId: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId?: string | null
+ createdAt?: string
+ createdBy: string
+ customFields?: Json
+ id: string
+ incoterm?: Database["public"]["Enums"]["incoterm"] | null
+ incotermLocation?: string | null
+ locationId?: string | null
+ shippingCost?: number
+ shippingMethodId?: string | null
+ shippingTermId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string | null
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json
+ id?: string
+ incoterm?: Database["public"]["Enums"]["incoterm"] | null
+ incotermLocation?: string | null
+ locationId?: string | null
+ shippingCost?: number
+ shippingMethodId?: string | null
+ shippingTermId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "salesInvoiceShipment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceShipment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceShipment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "salesInvoiceShipment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "salesInvoiceShipment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceShipment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceShipment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceShipment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceShipment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "salesInvoiceShipment_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "salesInvoice"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceShipment_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "salesInvoiceLocations"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceShipment_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "salesInvoices"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceShipment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceShipment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceShipment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceShipment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceShipment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ salesOrder: {
+ Row: {
+ assignee: string | null
+ closedAt: string | null
+ closedBy: string | null
+ companyId: string
+ completedDate: string | null
+ createdAt: string
+ createdBy: string
+ currencyCode: string
+ customerContactId: string | null
+ customerEngineeringContactId: string | null
+ customerId: string
+ customerLocationId: string | null
+ customerReference: string | null
+ customFields: Json | null
+ exchangeRate: number | null
+ exchangeRateUpdatedAt: string | null
+ externalNotes: Json | null
+ id: string
+ internalNotes: Json | null
+ locationId: string | null
+ opportunityId: string | null
+ orderDate: string | null
+ revisionId: number
+ salesOrderId: string
+ salesPersonId: string | null
+ sentCompleteDate: string | null
+ status: Database["public"]["Enums"]["salesOrderStatus"]
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ assignee?: string | null
+ closedAt?: string | null
+ closedBy?: string | null
+ companyId: string
+ completedDate?: string | null
+ createdAt?: string
+ createdBy: string
+ currencyCode: string
+ customerContactId?: string | null
+ customerEngineeringContactId?: string | null
+ customerId: string
+ customerLocationId?: string | null
+ customerReference?: string | null
+ customFields?: Json | null
+ exchangeRate?: number | null
+ exchangeRateUpdatedAt?: string | null
+ externalNotes?: Json | null
+ id?: string
+ internalNotes?: Json | null
+ locationId?: string | null
+ opportunityId?: string | null
+ orderDate?: string | null
+ revisionId?: number
+ salesOrderId: string
+ salesPersonId?: string | null
+ sentCompleteDate?: string | null
+ status?: Database["public"]["Enums"]["salesOrderStatus"]
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ assignee?: string | null
+ closedAt?: string | null
+ closedBy?: string | null
+ companyId?: string
+ completedDate?: string | null
+ createdAt?: string
+ createdBy?: string
+ currencyCode?: string
+ customerContactId?: string | null
+ customerEngineeringContactId?: string | null
+ customerId?: string
+ customerLocationId?: string | null
+ customerReference?: string | null
+ customFields?: Json | null
+ exchangeRate?: number | null
+ exchangeRateUpdatedAt?: string | null
+ externalNotes?: Json | null
+ id?: string
+ internalNotes?: Json | null
+ locationId?: string | null
+ opportunityId?: string | null
+ orderDate?: string | null
+ revisionId?: number
+ salesOrderId?: string
+ salesPersonId?: string | null
+ sentCompleteDate?: string | null
+ status?: Database["public"]["Enums"]["salesOrderStatus"]
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "salesOrder_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "salesOrder_closedBy_fkey"
+ columns: ["closedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_closedBy_fkey"
+ columns: ["closedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_closedBy_fkey"
+ columns: ["closedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_closedBy_fkey"
+ columns: ["closedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_closedBy_fkey"
+ columns: ["closedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "salesOrder_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "salesOrder_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "salesOrder_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "salesOrder_currencyCode_fkey"
+ columns: ["currencyCode"]
+ isOneToOne: false
+ referencedRelation: "currencyCode"
+ referencedColumns: ["code"]
+ },
+ {
+ foreignKeyName: "salesOrder_customerContactId_fkey"
+ columns: ["customerContactId"]
+ isOneToOne: false
+ referencedRelation: "customerContact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_customerEngineeringContactId_fkey"
+ columns: ["customerEngineeringContactId"]
+ isOneToOne: false
+ referencedRelation: "customerContact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_opportunityId_fkey"
+ columns: ["opportunityId"]
+ isOneToOne: false
+ referencedRelation: "opportunity"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_customerLocationId_fkey"
+ columns: ["customerLocationId"]
+ isOneToOne: false
+ referencedRelation: "customerLocation"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ salesOrderFavorite: {
+ Row: {
+ salesOrderId: string
+ userId: string
+ }
+ Insert: {
+ salesOrderId: string
+ userId: string
+ }
+ Update: {
+ salesOrderId?: string
+ userId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "salesOrderFavorites_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrder"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderFavorites_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderLocations"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderFavorites_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ salesOrderLine: {
+ Row: {
+ accountId: string | null
+ addOnCost: number
+ assetId: string | null
+ companyId: string
+ convertedAddOnCost: number | null
+ convertedNonTaxableAddOnCost: number | null
+ convertedShippingCost: number | null
+ convertedUnitPrice: number | null
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ description: string | null
+ exchangeRate: number | null
+ externalNotes: Json | null
+ id: string
+ internalNotes: Json | null
+ invoicedComplete: boolean
+ itemId: string | null
+ locationId: string | null
+ methodType: Database["public"]["Enums"]["methodType"]
+ modelUploadId: string | null
+ nonTaxableAddOnCost: number
+ priceTrace: Json | null
+ pricingRuleId: string | null
+ promisedDate: string | null
+ quantityInvoiced: number | null
+ quantitySent: number | null
+ quantityToInvoice: number | null
+ quantityToSend: number | null
+ requiresInspection: boolean
+ saleQuantity: number | null
+ salesOrderId: string
+ salesOrderLineType: Database["public"]["Enums"]["salesOrderLineType"]
+ sentComplete: boolean
+ sentDate: string | null
+ setupPrice: number | null
+ shippingCost: number
+ sortOrder: number
+ status: Database["public"]["Enums"]["salesOrderLineStatus"]
+ storageUnitId: string | null
+ taxPercent: number
+ unitOfMeasureCode: string | null
+ unitPrice: number | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ accountId?: string | null
+ addOnCost?: number
+ assetId?: string | null
+ companyId: string
+ convertedAddOnCost?: number | null
+ convertedNonTaxableAddOnCost?: number | null
+ convertedShippingCost?: number | null
+ convertedUnitPrice?: number | null
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ description?: string | null
+ exchangeRate?: number | null
+ externalNotes?: Json | null
+ id?: string
+ internalNotes?: Json | null
+ invoicedComplete?: boolean
+ itemId?: string | null
+ locationId?: string | null
+ methodType?: Database["public"]["Enums"]["methodType"]
+ modelUploadId?: string | null
+ nonTaxableAddOnCost?: number
+ priceTrace?: Json | null
+ pricingRuleId?: string | null
+ promisedDate?: string | null
+ quantityInvoiced?: number | null
+ quantitySent?: number | null
+ quantityToInvoice?: number | null
+ quantityToSend?: number | null
+ requiresInspection?: boolean
+ saleQuantity?: number | null
+ salesOrderId: string
+ salesOrderLineType: Database["public"]["Enums"]["salesOrderLineType"]
+ sentComplete?: boolean
+ sentDate?: string | null
+ setupPrice?: number | null
+ shippingCost?: number
+ sortOrder?: number
+ status?: Database["public"]["Enums"]["salesOrderLineStatus"]
+ storageUnitId?: string | null
+ taxPercent?: number
+ unitOfMeasureCode?: string | null
+ unitPrice?: number | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ accountId?: string | null
+ addOnCost?: number
+ assetId?: string | null
+ companyId?: string
+ convertedAddOnCost?: number | null
+ convertedNonTaxableAddOnCost?: number | null
+ convertedShippingCost?: number | null
+ convertedUnitPrice?: number | null
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ description?: string | null
+ exchangeRate?: number | null
+ externalNotes?: Json | null
+ id?: string
+ internalNotes?: Json | null
+ invoicedComplete?: boolean
+ itemId?: string | null
+ locationId?: string | null
+ methodType?: Database["public"]["Enums"]["methodType"]
+ modelUploadId?: string | null
+ nonTaxableAddOnCost?: number
+ priceTrace?: Json | null
+ pricingRuleId?: string | null
+ promisedDate?: string | null
+ quantityInvoiced?: number | null
+ quantitySent?: number | null
+ quantityToInvoice?: number | null
+ quantityToSend?: number | null
+ requiresInspection?: boolean
+ saleQuantity?: number | null
+ salesOrderId?: string
+ salesOrderLineType?: Database["public"]["Enums"]["salesOrderLineType"]
+ sentComplete?: boolean
+ sentDate?: string | null
+ setupPrice?: number | null
+ shippingCost?: number
+ sortOrder?: number
+ status?: Database["public"]["Enums"]["salesOrderLineStatus"]
+ storageUnitId?: string | null
+ taxPercent?: number
+ unitOfMeasureCode?: string | null
+ unitPrice?: number | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "salesOrderLine_accountId_fkey"
+ columns: ["accountId"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_accountId_fkey"
+ columns: ["accountId"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_assetId_fkey"
+ columns: ["assetId"]
+ isOneToOne: false
+ referencedRelation: "fixedAsset"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_pricingRuleId_fkey"
+ columns: ["pricingRuleId"]
+ isOneToOne: false
+ referencedRelation: "pricingRule"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrder"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderLocations"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_storageUnitId_fkey"
+ columns: ["storageUnitId"]
+ isOneToOne: false
+ referencedRelation: "storageUnit"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_unitOfMeasureCode_fkey"
+ columns: ["unitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ salesOrderPayment: {
+ Row: {
+ companyId: string
+ customFields: Json | null
+ id: string
+ invoiceCustomerContactId: string | null
+ invoiceCustomerId: string | null
+ invoiceCustomerLocationId: string | null
+ paymentComplete: boolean
+ paymentTermId: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ customFields?: Json | null
+ id: string
+ invoiceCustomerContactId?: string | null
+ invoiceCustomerId?: string | null
+ invoiceCustomerLocationId?: string | null
+ paymentComplete?: boolean
+ paymentTermId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ customFields?: Json | null
+ id?: string
+ invoiceCustomerContactId?: string | null
+ invoiceCustomerId?: string | null
+ invoiceCustomerLocationId?: string | null
+ paymentComplete?: boolean
+ paymentTermId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "salesOrderPayment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderPayment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderPayment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "salesOrderPayment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "salesOrderPayment_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "salesOrder"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderPayment_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "salesOrderLocations"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderPayment_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "salesOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderPayment_invoiceCustomerContactId_fkey"
+ columns: ["invoiceCustomerContactId"]
+ isOneToOne: false
+ referencedRelation: "customerContact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderPayment_invoiceCustomerId_fkey"
+ columns: ["invoiceCustomerId"]
+ isOneToOne: false
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderPayment_invoiceCustomerId_fkey"
+ columns: ["invoiceCustomerId"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderPayment_invoiceCustomerId_fkey"
+ columns: ["invoiceCustomerId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderPayment_invoiceCustomerLocationId_fkey"
+ columns: ["invoiceCustomerLocationId"]
+ isOneToOne: false
+ referencedRelation: "customerLocation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderPayment_paymentTermId_fkey"
+ columns: ["paymentTermId"]
+ isOneToOne: false
+ referencedRelation: "paymentTerm"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ salesOrderShipment: {
+ Row: {
+ assignee: string | null
+ companyId: string
+ customerId: string | null
+ customerLocationId: string | null
+ customFields: Json | null
+ deliveryDate: string | null
+ dropShipment: boolean
+ id: string
+ incoterm: Database["public"]["Enums"]["incoterm"] | null
+ incotermLocation: string | null
+ locationId: string | null
+ notes: string | null
+ receiptPromisedDate: string | null
+ receiptRequestedDate: string | null
+ shippingCost: number | null
+ shippingMethodId: string | null
+ shippingTermId: string | null
+ supplierId: string | null
+ supplierLocationId: string | null
+ trackingNumber: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ assignee?: string | null
+ companyId: string
+ customerId?: string | null
+ customerLocationId?: string | null
+ customFields?: Json | null
+ deliveryDate?: string | null
+ dropShipment?: boolean
+ id: string
+ incoterm?: Database["public"]["Enums"]["incoterm"] | null
+ incotermLocation?: string | null
+ locationId?: string | null
+ notes?: string | null
+ receiptPromisedDate?: string | null
+ receiptRequestedDate?: string | null
+ shippingCost?: number | null
+ shippingMethodId?: string | null
+ shippingTermId?: string | null
+ supplierId?: string | null
+ supplierLocationId?: string | null
+ trackingNumber?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ assignee?: string | null
+ companyId?: string
+ customerId?: string | null
+ customerLocationId?: string | null
+ customFields?: Json | null
+ deliveryDate?: string | null
+ dropShipment?: boolean
+ id?: string
+ incoterm?: Database["public"]["Enums"]["incoterm"] | null
+ incotermLocation?: string | null
+ locationId?: string | null
+ notes?: string | null
+ receiptPromisedDate?: string | null
+ receiptRequestedDate?: string | null
+ shippingCost?: number | null
+ shippingMethodId?: string | null
+ shippingTermId?: string | null
+ supplierId?: string | null
+ supplierLocationId?: string | null
+ trackingNumber?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "salesOrderShipment_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderShipment_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderShipment_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderShipment_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderShipment_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "salesOrderShipment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderShipment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderShipment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "salesOrderShipment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "salesOrderShipment_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderShipment_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderShipment_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderShipment_customerLocationId_fkey"
+ columns: ["customerLocationId"]
+ isOneToOne: false
+ referencedRelation: "customerLocation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderShipment_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "salesOrder"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderShipment_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "salesOrderLocations"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderShipment_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "salesOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderShipment_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderShipment_shippingMethodId_fkey"
+ columns: ["shippingMethodId"]
+ isOneToOne: false
+ referencedRelation: "shippingMethod"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderShipment_shippingTermId_fkey"
+ columns: ["shippingTermId"]
+ isOneToOne: false
+ referencedRelation: "shippingTerm"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderShipment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderShipment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderShipment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderShipment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderShipment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ salesOrderStatusHistory: {
+ Row: {
+ createdAt: string
+ createdBy: string
+ id: string
+ salesOrderId: string
+ status: Database["public"]["Enums"]["salesOrderStatus"]
+ }
+ Insert: {
+ createdAt?: string
+ createdBy: string
+ id?: string
+ salesOrderId: string
+ status: Database["public"]["Enums"]["salesOrderStatus"]
+ }
+ Update: {
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ salesOrderId?: string
+ status?: Database["public"]["Enums"]["salesOrderStatus"]
+ }
+ Relationships: [
+ {
+ foreignKeyName: "salesOrderStatusHistory_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderStatusHistory_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderStatusHistory_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderStatusHistory_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderStatusHistory_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "salesOrderStatusHistory_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrder"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderStatusHistory_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderLocations"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderStatusHistory_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrders"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ salesOrderTransaction: {
+ Row: {
+ createdAt: string
+ id: string
+ salesOrderId: string
+ type: Database["public"]["Enums"]["salesOrderTransactionType"]
+ userId: string
+ }
+ Insert: {
+ createdAt?: string
+ id?: string
+ salesOrderId: string
+ type: Database["public"]["Enums"]["salesOrderTransactionType"]
+ userId: string
+ }
+ Update: {
+ createdAt?: string
+ id?: string
+ salesOrderId?: string
+ type?: Database["public"]["Enums"]["salesOrderTransactionType"]
+ userId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "salesOrderTransaction_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrder"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderTransaction_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderLocations"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderTransaction_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderTransaction_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderTransaction_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderTransaction_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderTransaction_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderTransaction_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ salesRfq: {
+ Row: {
+ assignee: string | null
+ companyId: string
+ completedDate: string | null
+ createdAt: string | null
+ createdBy: string | null
+ customerContactId: string | null
+ customerEngineeringContactId: string | null
+ customerId: string | null
+ customerLocationId: string | null
+ customerReference: string | null
+ customFields: Json | null
+ employeeId: string | null
+ expirationDate: string | null
+ externalNotes: Json | null
+ id: string
+ internalNotes: Json | null
+ locationId: string | null
+ noQuoteReasonId: string | null
+ opportunityId: string | null
+ revisionId: number
+ rfqDate: string
+ rfqId: string
+ salesPersonId: string | null
+ status: Database["public"]["Enums"]["salesRfqStatus"]
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ assignee?: string | null
+ companyId: string
+ completedDate?: string | null
+ createdAt?: string | null
+ createdBy?: string | null
+ customerContactId?: string | null
+ customerEngineeringContactId?: string | null
+ customerId?: string | null
+ customerLocationId?: string | null
+ customerReference?: string | null
+ customFields?: Json | null
+ employeeId?: string | null
+ expirationDate?: string | null
+ externalNotes?: Json | null
+ id?: string
+ internalNotes?: Json | null
+ locationId?: string | null
+ noQuoteReasonId?: string | null
+ opportunityId?: string | null
+ revisionId?: number
+ rfqDate?: string
+ rfqId: string
+ salesPersonId?: string | null
+ status?: Database["public"]["Enums"]["salesRfqStatus"]
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ assignee?: string | null
+ companyId?: string
+ completedDate?: string | null
+ createdAt?: string | null
+ createdBy?: string | null
+ customerContactId?: string | null
+ customerEngineeringContactId?: string | null
+ customerId?: string | null
+ customerLocationId?: string | null
+ customerReference?: string | null
+ customFields?: Json | null
+ employeeId?: string | null
+ expirationDate?: string | null
+ externalNotes?: Json | null
+ id?: string
+ internalNotes?: Json | null
+ locationId?: string | null
+ noQuoteReasonId?: string | null
+ opportunityId?: string | null
+ revisionId?: number
+ rfqDate?: string
+ rfqId?: string
+ salesPersonId?: string | null
+ status?: Database["public"]["Enums"]["salesRfqStatus"]
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "salesRfq_assigneeId_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_assigneeId_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_assigneeId_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_assigneeId_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_assigneeId_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "salesRfq_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "salesRfq_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "salesRfq_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "salesRfq_customerContactId_fkey"
+ columns: ["customerContactId"]
+ isOneToOne: false
+ referencedRelation: "customerContact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_customerEngineeringContactId_fkey"
+ columns: ["customerEngineeringContactId"]
+ isOneToOne: false
+ referencedRelation: "customerContact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_customerLocationId_fkey"
+ columns: ["customerLocationId"]
+ isOneToOne: false
+ referencedRelation: "customerLocation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "salesRfq_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_noQuoteReasonId_fkey"
+ columns: ["noQuoteReasonId"]
+ isOneToOne: false
+ referencedRelation: "noQuoteReason"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_opportunityId_fkey"
+ columns: ["opportunityId"]
+ isOneToOne: false
+ referencedRelation: "opportunity"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ salesRfqFavorite: {
+ Row: {
+ rfqId: string
+ userId: string
+ }
+ Insert: {
+ rfqId: string
+ userId: string
+ }
+ Update: {
+ rfqId?: string
+ userId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "salesRfqFavorites_salesRfqId_fkey"
+ columns: ["rfqId"]
+ isOneToOne: false
+ referencedRelation: "salesRfq"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqFavorites_salesRfqId_fkey"
+ columns: ["rfqId"]
+ isOneToOne: false
+ referencedRelation: "salesRfqs"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ salesRfqLine: {
+ Row: {
+ companyId: string
+ createdAt: string | null
+ createdBy: string
+ customerPartId: string
+ customerPartRevision: string | null
+ customFields: Json | null
+ description: string | null
+ externalNotes: Json | null
+ id: string
+ internalNotes: Json | null
+ itemId: string | null
+ modelUploadId: string | null
+ order: number
+ quantity: number[] | null
+ salesRfqId: string
+ tags: string[] | null
+ unitOfMeasureCode: string
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string | null
+ createdBy: string
+ customerPartId: string
+ customerPartRevision?: string | null
+ customFields?: Json | null
+ description?: string | null
+ externalNotes?: Json | null
+ id?: string
+ internalNotes?: Json | null
+ itemId?: string | null
+ modelUploadId?: string | null
+ order?: number
+ quantity?: number[] | null
+ salesRfqId: string
+ tags?: string[] | null
+ unitOfMeasureCode: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string | null
+ createdBy?: string
+ customerPartId?: string
+ customerPartRevision?: string | null
+ customFields?: Json | null
+ description?: string | null
+ externalNotes?: Json | null
+ id?: string
+ internalNotes?: Json | null
+ itemId?: string | null
+ modelUploadId?: string | null
+ order?: number
+ quantity?: number[] | null
+ salesRfqId?: string
+ tags?: string[] | null
+ unitOfMeasureCode?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "salesRfqLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "modelUpload"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "salesRfqLines"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_salesRfqId_fkey"
+ columns: ["salesRfqId"]
+ isOneToOne: false
+ referencedRelation: "salesRfq"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_salesRfqId_fkey"
+ columns: ["salesRfqId"]
+ isOneToOne: false
+ referencedRelation: "salesRfqs"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_unitOfMeasureCode_fkey"
+ columns: ["unitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ scrapReason: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ id: string
+ name: string
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ id?: string
+ name: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ id?: string
+ name?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "scrapReason_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "scrapReason_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "scrapReason_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "scrapReason_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "scrapReason_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "scrapReason_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "scrapReason_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "scrapReason_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "scrapReason_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "scrapReason_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "scrapReason_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "scrapReason_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "scrapReason_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "scrapReason_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ searchIndexRegistry: {
+ Row: {
+ companyId: string
+ createdAt: string
+ lastRebuiltAt: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ lastRebuiltAt?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ lastRebuiltAt?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "searchIndexRegistry_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: true
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "searchIndexRegistry_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: true
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "searchIndexRegistry_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: true
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "searchIndexRegistry_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: true
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ ]
+ }
+ sequence: {
+ Row: {
+ companyId: string
+ id: string
+ name: string
+ next: number
+ prefix: string | null
+ size: number
+ step: number
+ suffix: string | null
+ table: string
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ id?: string
+ name: string
+ next?: number
+ prefix?: string | null
+ size?: number
+ step?: number
+ suffix?: string | null
+ table: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ id?: string
+ name?: string
+ next?: number
+ prefix?: string | null
+ size?: number
+ step?: number
+ suffix?: string | null
+ table?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "sequence_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "sequence_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "sequence_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "sequence_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "sequence_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "sequence_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "sequence_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "sequence_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "sequence_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ service: {
+ Row: {
+ approved: boolean
+ approvedBy: string | null
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ fromDate: string | null
+ id: string
+ itemId: string | null
+ serviceType: Database["public"]["Enums"]["serviceType"]
+ tags: string[] | null
+ toDate: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ approved?: boolean
+ approvedBy?: string | null
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ fromDate?: string | null
+ id?: string
+ itemId?: string | null
+ serviceType: Database["public"]["Enums"]["serviceType"]
+ tags?: string[] | null
+ toDate?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ approved?: boolean
+ approvedBy?: string | null
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ fromDate?: string | null
+ id?: string
+ itemId?: string | null
+ serviceType?: Database["public"]["Enums"]["serviceType"]
+ tags?: string[] | null
+ toDate?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "service_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "service_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "service_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "service_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "service_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "service_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "service_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "service_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "service_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "service_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "service_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "service_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "service_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "service_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "service_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "service_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "service_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "service_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "service_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "service_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "service_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "service_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "service_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "service_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "service_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ shift: {
+ Row: {
+ active: boolean
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ endTime: string
+ friday: boolean
+ id: string
+ locationId: string
+ monday: boolean
+ name: string
+ saturday: boolean
+ startTime: string
+ sunday: boolean
+ tags: string[] | null
+ thursday: boolean
+ tuesday: boolean
+ updatedAt: string | null
+ updatedBy: string | null
+ wednesday: boolean
+ }
+ Insert: {
+ active?: boolean
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ endTime: string
+ friday?: boolean
+ id?: string
+ locationId: string
+ monday?: boolean
+ name: string
+ saturday?: boolean
+ startTime: string
+ sunday?: boolean
+ tags?: string[] | null
+ thursday?: boolean
+ tuesday?: boolean
+ updatedAt?: string | null
+ updatedBy?: string | null
+ wednesday?: boolean
+ }
+ Update: {
+ active?: boolean
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ endTime?: string
+ friday?: boolean
+ id?: string
+ locationId?: string
+ monday?: boolean
+ name?: string
+ saturday?: boolean
+ startTime?: string
+ sunday?: boolean
+ tags?: string[] | null
+ thursday?: boolean
+ tuesday?: boolean
+ updatedAt?: string | null
+ updatedBy?: string | null
+ wednesday?: boolean
+ }
+ Relationships: [
+ {
+ foreignKeyName: "shifts_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shifts_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shifts_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "shifts_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "shifts_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shifts_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shifts_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shifts_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shifts_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "shifts_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shifts_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shifts_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shifts_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shifts_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shifts_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ shipment: {
+ Row: {
+ assignee: string | null
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customerId: string | null
+ customFields: Json | null
+ externalDocumentId: string | null
+ externalNotes: Json | null
+ id: string
+ internalNotes: Json | null
+ invoiced: boolean | null
+ locationId: string | null
+ opportunityId: string | null
+ postedBy: string | null
+ postingDate: string | null
+ shipmentId: string
+ shippingMethodId: string | null
+ sourceDocument:
+ | Database["public"]["Enums"]["shipmentSourceDocument"]
+ | null
+ sourceDocumentId: string | null
+ sourceDocumentReadableId: string | null
+ status: Database["public"]["Enums"]["shipmentStatus"]
+ supplierId: string | null
+ supplierInteractionId: string | null
+ tags: string[] | null
+ trackingNumber: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ assignee?: string | null
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customerId?: string | null
+ customFields?: Json | null
+ externalDocumentId?: string | null
+ externalNotes?: Json | null
+ id?: string
+ internalNotes?: Json | null
+ invoiced?: boolean | null
+ locationId?: string | null
+ opportunityId?: string | null
+ postedBy?: string | null
+ postingDate?: string | null
+ shipmentId: string
+ shippingMethodId?: string | null
+ sourceDocument?:
+ | Database["public"]["Enums"]["shipmentSourceDocument"]
+ | null
+ sourceDocumentId?: string | null
+ sourceDocumentReadableId?: string | null
+ status?: Database["public"]["Enums"]["shipmentStatus"]
+ supplierId?: string | null
+ supplierInteractionId?: string | null
+ tags?: string[] | null
+ trackingNumber?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ assignee?: string | null
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customerId?: string | null
+ customFields?: Json | null
+ externalDocumentId?: string | null
+ externalNotes?: Json | null
+ id?: string
+ internalNotes?: Json | null
+ invoiced?: boolean | null
+ locationId?: string | null
+ opportunityId?: string | null
+ postedBy?: string | null
+ postingDate?: string | null
+ shipmentId?: string
+ shippingMethodId?: string | null
+ sourceDocument?:
+ | Database["public"]["Enums"]["shipmentSourceDocument"]
+ | null
+ sourceDocumentId?: string | null
+ sourceDocumentReadableId?: string | null
+ status?: Database["public"]["Enums"]["shipmentStatus"]
+ supplierId?: string | null
+ supplierInteractionId?: string | null
+ tags?: string[] | null
+ trackingNumber?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "shipment_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipment_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipment_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipment_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipment_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "shipment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "shipment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "shipment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "shipment_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipment_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipment_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipment_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipment_opportunityId_fkey"
+ columns: ["opportunityId"]
+ isOneToOne: false
+ referencedRelation: "opportunity"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipment_postedBy_fkey"
+ columns: ["postedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipment_postedBy_fkey"
+ columns: ["postedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipment_postedBy_fkey"
+ columns: ["postedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipment_postedBy_fkey"
+ columns: ["postedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipment_postedBy_fkey"
+ columns: ["postedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "shipment_shippingMethodId_fkey"
+ columns: ["shippingMethodId"]
+ isOneToOne: false
+ referencedRelation: "shippingMethod"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipment_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "shipment_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "shipment_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipment_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipment_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipment_supplierInteractionId_fkey"
+ columns: ["supplierInteractionId"]
+ isOneToOne: false
+ referencedRelation: "supplierInteraction"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ shipmentFixedAssetLine: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ salesOrderLineId: string
+ serialNumber: string | null
+ shipmentId: string
+ shipped: boolean
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ salesOrderLineId: string
+ serialNumber?: string | null
+ shipmentId: string
+ shipped?: boolean
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ salesOrderLineId?: string
+ serialNumber?: string | null
+ shipmentId?: string
+ shipped?: boolean
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "shipmentFixedAssetLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentFixedAssetLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentFixedAssetLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "shipmentFixedAssetLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "shipmentFixedAssetLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentFixedAssetLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentFixedAssetLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentFixedAssetLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentFixedAssetLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "shipmentFixedAssetLine_salesOrderLineId_fkey"
+ columns: ["salesOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "openSalesOrderLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentFixedAssetLine_salesOrderLineId_fkey"
+ columns: ["salesOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderLine"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentFixedAssetLine_salesOrderLineId_fkey"
+ columns: ["salesOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentFixedAssetLine_shipmentId_fkey"
+ columns: ["shipmentId"]
+ isOneToOne: false
+ referencedRelation: "shipment"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ shipmentLine: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ fulfillmentId: string | null
+ id: string
+ itemId: string
+ lineId: string | null
+ locationId: string | null
+ orderQuantity: number
+ outstandingQuantity: number
+ requiresBatchTracking: boolean
+ requiresSerialTracking: boolean
+ shipmentId: string
+ shippedQuantity: number
+ storageUnitId: string | null
+ unitOfMeasure: string
+ unitPrice: number
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ fulfillmentId?: string | null
+ id?: string
+ itemId: string
+ lineId?: string | null
+ locationId?: string | null
+ orderQuantity?: number
+ outstandingQuantity?: number
+ requiresBatchTracking?: boolean
+ requiresSerialTracking?: boolean
+ shipmentId: string
+ shippedQuantity?: number
+ storageUnitId?: string | null
+ unitOfMeasure: string
+ unitPrice: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ fulfillmentId?: string | null
+ id?: string
+ itemId?: string
+ lineId?: string | null
+ locationId?: string | null
+ orderQuantity?: number
+ outstandingQuantity?: number
+ requiresBatchTracking?: boolean
+ requiresSerialTracking?: boolean
+ shipmentId?: string
+ shippedQuantity?: number
+ storageUnitId?: string | null
+ unitOfMeasure?: string
+ unitPrice?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "shipmentLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "shipmentLine_fulfillmentId_fkey"
+ columns: ["fulfillmentId"]
+ isOneToOne: false
+ referencedRelation: "fulfillment"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_shipmentId_fkey"
+ columns: ["shipmentId"]
+ isOneToOne: false
+ referencedRelation: "shipment"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_storageUnitId_fkey"
+ columns: ["storageUnitId"]
+ isOneToOne: false
+ referencedRelation: "storageUnit"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ shippingMethod: {
+ Row: {
+ active: boolean
+ carrier: Database["public"]["Enums"]["shippingCarrier"]
+ carrierAccountId: string | null
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ id: string
+ name: string
+ tags: string[] | null
+ trackingUrl: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ active?: boolean
+ carrier?: Database["public"]["Enums"]["shippingCarrier"]
+ carrierAccountId?: string | null
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ id?: string
+ name: string
+ tags?: string[] | null
+ trackingUrl?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ active?: boolean
+ carrier?: Database["public"]["Enums"]["shippingCarrier"]
+ carrierAccountId?: string | null
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ id?: string
+ name?: string
+ tags?: string[] | null
+ trackingUrl?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "shippingMethod_carrierAccountId_fkey"
+ columns: ["carrierAccountId"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shippingMethod_carrierAccountId_fkey"
+ columns: ["carrierAccountId"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shippingMethod_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shippingMethod_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shippingMethod_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "shippingMethod_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "shippingMethod_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shippingMethod_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shippingMethod_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shippingMethod_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shippingMethod_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "shippingMethod_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shippingMethod_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shippingMethod_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shippingMethod_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shippingMethod_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ shippingTerm: {
+ Row: {
+ active: boolean
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ name: string
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ active?: boolean
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ name: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ active?: boolean
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ name?: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "shippingTerm_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shippingTerm_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shippingTerm_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "shippingTerm_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "shippingTerm_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shippingTerm_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shippingTerm_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shippingTerm_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shippingTerm_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "shippingTerm_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shippingTerm_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shippingTerm_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shippingTerm_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shippingTerm_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ slackDocumentThread: {
+ Row: {
+ channelId: string
+ companyId: string
+ createdAt: string
+ createdBy: string
+ documentId: string
+ documentType: string
+ id: string
+ threadTs: string
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ channelId: string
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ documentId: string
+ documentType: string
+ id?: string
+ threadTs: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ channelId?: string
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ documentId?: string
+ documentType?: string
+ id?: string
+ threadTs?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "slackDocumentThread_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "slackDocumentThread_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "slackDocumentThread_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "slackDocumentThread_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "slackDocumentThread_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "slackDocumentThread_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "slackDocumentThread_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "slackDocumentThread_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "slackDocumentThread_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "slackDocumentThread_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "slackDocumentThread_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "slackDocumentThread_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "slackDocumentThread_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "slackDocumentThread_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ stockTransfer: {
+ Row: {
+ assignee: string | null
+ companyId: string
+ completedAt: string | null
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ id: string
+ locationId: string
+ notes: Json | null
+ status: Database["public"]["Enums"]["stockTransferStatus"]
+ stockTransferId: string
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ assignee?: string | null
+ companyId: string
+ completedAt?: string | null
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ id?: string
+ locationId: string
+ notes?: Json | null
+ status?: Database["public"]["Enums"]["stockTransferStatus"]
+ stockTransferId: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ assignee?: string | null
+ companyId?: string
+ completedAt?: string | null
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ id?: string
+ locationId?: string
+ notes?: Json | null
+ status?: Database["public"]["Enums"]["stockTransferStatus"]
+ stockTransferId?: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "stockTransfer_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransfer_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransfer_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransfer_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransfer_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "stockTransfer_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransfer_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransfer_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "stockTransfer_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "stockTransfer_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransfer_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransfer_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransfer_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransfer_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "stockTransfer_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransfer_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransfer_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransfer_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransfer_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransfer_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ stockTransferLine: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ fromStorageUnitId: string | null
+ id: string
+ itemId: string
+ jobId: string | null
+ jobMaterialId: string | null
+ outstandingQuantity: number | null
+ pickedQuantity: number
+ quantity: number
+ requiresBatchTracking: boolean
+ requiresSerialTracking: boolean
+ stockTransferId: string
+ toStorageUnitId: string | null
+ trackedEntityId: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ fromStorageUnitId?: string | null
+ id?: string
+ itemId: string
+ jobId?: string | null
+ jobMaterialId?: string | null
+ outstandingQuantity?: number | null
+ pickedQuantity?: number
+ quantity?: number
+ requiresBatchTracking?: boolean
+ requiresSerialTracking?: boolean
+ stockTransferId: string
+ toStorageUnitId?: string | null
+ trackedEntityId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ fromStorageUnitId?: string | null
+ id?: string
+ itemId?: string
+ jobId?: string | null
+ jobMaterialId?: string | null
+ outstandingQuantity?: number | null
+ pickedQuantity?: number
+ quantity?: number
+ requiresBatchTracking?: boolean
+ requiresSerialTracking?: boolean
+ stockTransferId?: string
+ toStorageUnitId?: string | null
+ trackedEntityId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "stockTransferLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_fromStorageUnitId_fkey"
+ columns: ["fromStorageUnitId"]
+ isOneToOne: false
+ referencedRelation: "storageUnit"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "job"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "openProductionOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_jobMaterialId_fkey"
+ columns: ["jobMaterialId"]
+ isOneToOne: false
+ referencedRelation: "jobMaterial"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_jobMaterialId_fkey"
+ columns: ["jobMaterialId"]
+ isOneToOne: false
+ referencedRelation: "jobMaterialWithMakeMethodId"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_jobMaterialId_fkey"
+ columns: ["jobMaterialId"]
+ isOneToOne: false
+ referencedRelation: "openJobMaterialLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_stockTransferId_fkey"
+ columns: ["stockTransferId", "companyId"]
+ isOneToOne: false
+ referencedRelation: "stockTransfer"
+ referencedColumns: ["id", "companyId"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_toStorageUnitId_fkey"
+ columns: ["toStorageUnitId"]
+ isOneToOne: false
+ referencedRelation: "storageUnit"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_trackedEntityId_fkey"
+ columns: ["trackedEntityId"]
+ isOneToOne: false
+ referencedRelation: "trackedEntity"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ storageType: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ id: string
+ name: string
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ id?: string
+ name: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ id?: string
+ name?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "storageType_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "storageType_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "storageType_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "storageType_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "storageType_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "storageType_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "storageType_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "storageType_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "storageType_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "storageType_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "storageType_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "storageType_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "storageType_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "storageType_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ storageUnit: {
+ Row: {
+ active: boolean
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ id: string
+ locationId: string
+ name: string
+ parentId: string | null
+ storageTypeIds: string[]
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ warehouseId: string | null
+ }
+ Insert: {
+ active?: boolean
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ id?: string
+ locationId: string
+ name: string
+ parentId?: string | null
+ storageTypeIds?: string[]
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ warehouseId?: string | null
+ }
+ Update: {
+ active?: boolean
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ id?: string
+ locationId?: string
+ name?: string
+ parentId?: string | null
+ storageTypeIds?: string[]
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ warehouseId?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "storageUnit_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "storageUnit_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "storageUnit_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "storageUnit_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "storageUnit_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "storageUnit_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "storageUnit_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "storageUnit_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "storageUnit_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "storageUnit_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "storageUnit_parentId_fkey"
+ columns: ["parentId"]
+ isOneToOne: false
+ referencedRelation: "storageUnit"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "storageUnit_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "storageUnit_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "storageUnit_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "storageUnit_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "storageUnit_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "storageUnit_warehouseId_fkey"
+ columns: ["warehouseId"]
+ isOneToOne: false
+ referencedRelation: "warehouse"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ suggestion: {
+ Row: {
+ attachmentPath: string | null
+ companyId: string
+ createdAt: string
+ emoji: string
+ id: string
+ path: string
+ suggestion: string
+ tags: string[] | null
+ userId: string | null
+ }
+ Insert: {
+ attachmentPath?: string | null
+ companyId: string
+ createdAt?: string
+ emoji?: string
+ id?: string
+ path: string
+ suggestion: string
+ tags?: string[] | null
+ userId?: string | null
+ }
+ Update: {
+ attachmentPath?: string | null
+ companyId?: string
+ createdAt?: string
+ emoji?: string
+ id?: string
+ path?: string
+ suggestion?: string
+ tags?: string[] | null
+ userId?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "suggestion_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "suggestion_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "suggestion_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "suggestion_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "suggestion_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "suggestion_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "suggestion_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "suggestion_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "suggestion_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ supplier: {
+ Row: {
+ accountManagerId: string | null
+ assignee: string | null
+ companyId: string
+ createdAt: string
+ createdBy: string | null
+ currencyCode: string | null
+ customFields: Json | null
+ defaultCc: string[] | null
+ embedding: unknown
+ fax: string | null
+ id: string
+ intercompanyCompanyId: string | null
+ logo: string | null
+ name: string
+ phone: string | null
+ purchasingContactId: string | null
+ readableId: string
+ supplierStatus:
+ | Database["public"]["Enums"]["supplierStatusType"]
+ | null
+ supplierTypeId: string | null
+ tags: string[] | null
+ taxPercent: number
+ updatedAt: string | null
+ updatedBy: string | null
+ website: string | null
+ }
+ Insert: {
+ accountManagerId?: string | null
+ assignee?: string | null
+ companyId: string
+ createdAt?: string
+ createdBy?: string | null
+ currencyCode?: string | null
+ customFields?: Json | null
+ defaultCc?: string[] | null
+ embedding?: unknown
+ fax?: string | null
+ id?: string
+ intercompanyCompanyId?: string | null
+ logo?: string | null
+ name: string
+ phone?: string | null
+ purchasingContactId?: string | null
+ readableId?: string
+ supplierStatus?:
+ | Database["public"]["Enums"]["supplierStatusType"]
+ | null
+ supplierTypeId?: string | null
+ tags?: string[] | null
+ taxPercent?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ website?: string | null
+ }
+ Update: {
+ accountManagerId?: string | null
+ assignee?: string | null
+ companyId?: string
+ createdAt?: string
+ createdBy?: string | null
+ currencyCode?: string | null
+ customFields?: Json | null
+ defaultCc?: string[] | null
+ embedding?: unknown
+ fax?: string | null
+ id?: string
+ intercompanyCompanyId?: string | null
+ logo?: string | null
+ name?: string
+ phone?: string | null
+ purchasingContactId?: string | null
+ readableId?: string
+ supplierStatus?:
+ | Database["public"]["Enums"]["supplierStatusType"]
+ | null
+ supplierTypeId?: string | null
+ tags?: string[] | null
+ taxPercent?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ website?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "supplier_accountManagerId_fkey"
+ columns: ["accountManagerId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_accountManagerId_fkey"
+ columns: ["accountManagerId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_accountManagerId_fkey"
+ columns: ["accountManagerId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_accountManagerId_fkey"
+ columns: ["accountManagerId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_accountManagerId_fkey"
+ columns: ["accountManagerId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "supplier_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "supplier_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplier_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplier_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "supplier_currencyCode_fkey"
+ columns: ["currencyCode"]
+ isOneToOne: false
+ referencedRelation: "currencyCode"
+ referencedColumns: ["code"]
+ },
+ {
+ foreignKeyName: "supplier_intercompanyCompanyId_fkey"
+ columns: ["intercompanyCompanyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_intercompanyCompanyId_fkey"
+ columns: ["intercompanyCompanyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_intercompanyCompanyId_fkey"
+ columns: ["intercompanyCompanyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplier_intercompanyCompanyId_fkey"
+ columns: ["intercompanyCompanyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplier_purchasingContactId_fkey"
+ columns: ["purchasingContactId"]
+ isOneToOne: false
+ referencedRelation: "supplierContact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_supplierTypeId_fkey"
+ columns: ["supplierTypeId"]
+ isOneToOne: false
+ referencedRelation: "supplierType"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ supplierAccount: {
+ Row: {
+ active: boolean
+ companyId: string
+ id: string
+ supplierId: string
+ }
+ Insert: {
+ active?: boolean
+ companyId: string
+ id: string
+ supplierId: string
+ }
+ Update: {
+ active?: boolean
+ companyId?: string
+ id?: string
+ supplierId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "supplierAccount_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierAccount_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierAccount_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplierAccount_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplierAccount_id_fkey"
+ columns: ["id"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierAccount_id_fkey"
+ columns: ["id"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierAccount_id_fkey"
+ columns: ["id"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierAccount_id_fkey"
+ columns: ["id"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierAccount_id_fkey"
+ columns: ["id"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "supplierAccount_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "supplierAccount_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "supplierAccount_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierAccount_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierAccount_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ supplierContact: {
+ Row: {
+ contactId: string
+ customFields: Json | null
+ id: string
+ supplierId: string
+ supplierLocationId: string | null
+ tags: string[] | null
+ userId: string | null
+ }
+ Insert: {
+ contactId: string
+ customFields?: Json | null
+ id?: string
+ supplierId: string
+ supplierLocationId?: string | null
+ tags?: string[] | null
+ userId?: string | null
+ }
+ Update: {
+ contactId?: string
+ customFields?: Json | null
+ id?: string
+ supplierId?: string
+ supplierLocationId?: string | null
+ tags?: string[] | null
+ userId?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "supplierContact_contactId_fkey"
+ columns: ["contactId"]
+ isOneToOne: false
+ referencedRelation: "contact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierContact_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "supplierContact_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "supplierContact_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierContact_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierContact_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierContact_supplierLocationId_fkey"
+ columns: ["supplierLocationId"]
+ isOneToOne: false
+ referencedRelation: "supplierLocation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierContact_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierContact_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierContact_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierContact_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierContact_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ supplierInteraction: {
+ Row: {
+ companyId: string
+ id: string
+ supplierId: string
+ }
+ Insert: {
+ companyId: string
+ id?: string
+ supplierId: string
+ }
+ Update: {
+ companyId?: string
+ id?: string
+ supplierId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "supplierInteraction_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierInteraction_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierInteraction_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplierInteraction_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplierInteraction_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "supplierInteraction_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "supplierInteraction_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierInteraction_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierInteraction_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ supplierLedger: {
+ Row: {
+ amount: number
+ companyId: string
+ createdAt: string
+ documentId: string | null
+ documentType:
+ | Database["public"]["Enums"]["supplierLedgerDocumentType"]
+ | null
+ entryNumber: number
+ externalDocumentId: string | null
+ id: string
+ postingDate: string
+ supplierId: string
+ }
+ Insert: {
+ amount: number
+ companyId: string
+ createdAt?: string
+ documentId?: string | null
+ documentType?:
+ | Database["public"]["Enums"]["supplierLedgerDocumentType"]
+ | null
+ entryNumber?: number
+ externalDocumentId?: string | null
+ id?: string
+ postingDate?: string
+ supplierId: string
+ }
+ Update: {
+ amount?: number
+ companyId?: string
+ createdAt?: string
+ documentId?: string | null
+ documentType?:
+ | Database["public"]["Enums"]["supplierLedgerDocumentType"]
+ | null
+ entryNumber?: number
+ externalDocumentId?: string | null
+ id?: string
+ postingDate?: string
+ supplierId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "supplierLedger_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierLedger_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierLedger_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplierLedger_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplierLedger_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "supplierLedger_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "supplierLedger_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierLedger_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierLedger_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ supplierLocation: {
+ Row: {
+ addressId: string
+ customFields: Json | null
+ id: string
+ name: string
+ supplierId: string
+ tags: string[] | null
+ }
+ Insert: {
+ addressId: string
+ customFields?: Json | null
+ id?: string
+ name: string
+ supplierId: string
+ tags?: string[] | null
+ }
+ Update: {
+ addressId?: string
+ customFields?: Json | null
+ id?: string
+ name?: string
+ supplierId?: string
+ tags?: string[] | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "supplierLocation_addressId_fkey"
+ columns: ["addressId"]
+ isOneToOne: false
+ referencedRelation: "address"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierLocation_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "supplierLocation_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "supplierLocation_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierLocation_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierLocation_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ supplierPart: {
+ Row: {
+ active: boolean
+ companyId: string
+ conversionFactor: number
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ id: string
+ itemId: string
+ minimumOrderQuantity: number | null
+ orderMultiple: number | null
+ supplierId: string
+ supplierPartId: string | null
+ supplierUnitOfMeasureCode: string | null
+ tags: string[] | null
+ unitPrice: number | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ active?: boolean
+ companyId: string
+ conversionFactor?: number
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ id?: string
+ itemId: string
+ minimumOrderQuantity?: number | null
+ orderMultiple?: number | null
+ supplierId: string
+ supplierPartId?: string | null
+ supplierUnitOfMeasureCode?: string | null
+ tags?: string[] | null
+ unitPrice?: number | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ active?: boolean
+ companyId?: string
+ conversionFactor?: number
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ id?: string
+ itemId?: string
+ minimumOrderQuantity?: number | null
+ orderMultiple?: number | null
+ supplierId?: string
+ supplierPartId?: string | null
+ supplierUnitOfMeasureCode?: string | null
+ tags?: string[] | null
+ unitPrice?: number | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "buyMethod_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "buyMethod_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "buyMethod_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "buyMethod_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "buyMethod_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "buyMethod_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "buyMethod_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "buyMethod_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "buyMethod_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "buyMethod_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "buyMethod_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "buyMethod_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "buyMethod_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "buyMethod_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "buyMethod_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "buyMethod_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "buyMethod_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "buyMethod_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "buyMethod_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "buyMethod_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "buyMethod_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "buyMethod_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "buyMethod_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "buyMethod_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "buyMethod_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ supplierPartPrice: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ leadTime: number
+ quantity: number
+ sourceDocumentId: string | null
+ sourceType: Database["public"]["Enums"]["supplierPartPriceSourceType"]
+ supplierPartId: string
+ unitPrice: number
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ leadTime?: number
+ quantity?: number
+ sourceDocumentId?: string | null
+ sourceType?: Database["public"]["Enums"]["supplierPartPriceSourceType"]
+ supplierPartId: string
+ unitPrice: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ leadTime?: number
+ quantity?: number
+ sourceDocumentId?: string | null
+ sourceType?: Database["public"]["Enums"]["supplierPartPriceSourceType"]
+ supplierPartId?: string
+ unitPrice?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "supplierPartPrice_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierPartPrice_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierPartPrice_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplierPartPrice_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplierPartPrice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierPartPrice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierPartPrice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierPartPrice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierPartPrice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "supplierPartPrice_supplierPartId_companyId_fkey"
+ columns: ["supplierPartId", "companyId"]
+ isOneToOne: false
+ referencedRelation: "supplierPart"
+ referencedColumns: ["id", "companyId"]
+ },
+ {
+ foreignKeyName: "supplierPartPrice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierPartPrice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierPartPrice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierPartPrice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierPartPrice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ supplierPayment: {
+ Row: {
+ companyId: string
+ customFields: Json | null
+ invoiceSupplierContactId: string | null
+ invoiceSupplierId: string | null
+ invoiceSupplierLocationId: string | null
+ paymentTermId: string | null
+ supplierId: string
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ customFields?: Json | null
+ invoiceSupplierContactId?: string | null
+ invoiceSupplierId?: string | null
+ invoiceSupplierLocationId?: string | null
+ paymentTermId?: string | null
+ supplierId: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ customFields?: Json | null
+ invoiceSupplierContactId?: string | null
+ invoiceSupplierId?: string | null
+ invoiceSupplierLocationId?: string | null
+ paymentTermId?: string | null
+ supplierId?: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "supplierPayment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierPayment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierPayment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplierPayment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplierPayment_invoiceSupplierContactId_fkey"
+ columns: ["invoiceSupplierContactId"]
+ isOneToOne: false
+ referencedRelation: "supplierContact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierPayment_invoiceSupplierId_fkey"
+ columns: ["invoiceSupplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "supplierPayment_invoiceSupplierId_fkey"
+ columns: ["invoiceSupplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "supplierPayment_invoiceSupplierId_fkey"
+ columns: ["invoiceSupplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierPayment_invoiceSupplierId_fkey"
+ columns: ["invoiceSupplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierPayment_invoiceSupplierId_fkey"
+ columns: ["invoiceSupplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierPayment_invoiceSupplierLocationId_fkey"
+ columns: ["invoiceSupplierLocationId"]
+ isOneToOne: false
+ referencedRelation: "supplierLocation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierPayment_paymentTermId_fkey"
+ columns: ["paymentTermId"]
+ isOneToOne: false
+ referencedRelation: "paymentTerm"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierPayment_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: true
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "supplierPayment_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: true
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "supplierPayment_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: true
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierPayment_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: true
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierPayment_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: true
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierPayment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierPayment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierPayment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierPayment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierPayment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ supplierProcess: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ id: string
+ leadTime: number
+ minimumCost: number
+ processId: string
+ supplierId: string
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ id?: string
+ leadTime?: number
+ minimumCost?: number
+ processId: string
+ supplierId: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ id?: string
+ leadTime?: number
+ minimumCost?: number
+ processId?: string
+ supplierId?: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "supplierProcess_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierProcess_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierProcess_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplierProcess_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplierProcess_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierProcess_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierProcess_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierProcess_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierProcess_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "supplierProcess_processId_fkey"
+ columns: ["processId"]
+ isOneToOne: false
+ referencedRelation: "process"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierProcess_processId_fkey"
+ columns: ["processId"]
+ isOneToOne: false
+ referencedRelation: "processes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierProcess_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "supplierProcess_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "supplierProcess_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierProcess_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierProcess_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierProcess_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierProcess_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierProcess_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierProcess_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierProcess_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ supplierQuote: {
+ Row: {
+ assignee: string | null
+ companyId: string
+ createdAt: string
+ createdBy: string
+ currencyCode: string | null
+ customFields: Json | null
+ exchangeRate: number | null
+ exchangeRateUpdatedAt: string | null
+ expirationDate: string | null
+ externalLinkId: string | null
+ externalNotes: Json | null
+ id: string
+ internalNotes: Json | null
+ quotedDate: string
+ revisionId: number
+ status: Database["public"]["Enums"]["supplierQuoteStatus"]
+ supplierContactId: string | null
+ supplierId: string
+ supplierInteractionId: string
+ supplierLocationId: string | null
+ supplierQuoteId: string
+ supplierQuoteType: Database["public"]["Enums"]["purchaseOrderType"]
+ supplierReference: string | null
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ assignee?: string | null
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ currencyCode?: string | null
+ customFields?: Json | null
+ exchangeRate?: number | null
+ exchangeRateUpdatedAt?: string | null
+ expirationDate?: string | null
+ externalLinkId?: string | null
+ externalNotes?: Json | null
+ id?: string
+ internalNotes?: Json | null
+ quotedDate?: string
+ revisionId?: number
+ status?: Database["public"]["Enums"]["supplierQuoteStatus"]
+ supplierContactId?: string | null
+ supplierId: string
+ supplierInteractionId: string
+ supplierLocationId?: string | null
+ supplierQuoteId: string
+ supplierQuoteType?: Database["public"]["Enums"]["purchaseOrderType"]
+ supplierReference?: string | null
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ assignee?: string | null
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ currencyCode?: string | null
+ customFields?: Json | null
+ exchangeRate?: number | null
+ exchangeRateUpdatedAt?: string | null
+ expirationDate?: string | null
+ externalLinkId?: string | null
+ externalNotes?: Json | null
+ id?: string
+ internalNotes?: Json | null
+ quotedDate?: string
+ revisionId?: number
+ status?: Database["public"]["Enums"]["supplierQuoteStatus"]
+ supplierContactId?: string | null
+ supplierId?: string
+ supplierInteractionId?: string
+ supplierLocationId?: string | null
+ supplierQuoteId?: string
+ supplierQuoteType?: Database["public"]["Enums"]["purchaseOrderType"]
+ supplierReference?: string | null
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "supplierQuote_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "supplierQuote_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplierQuote_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplierQuote_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "supplierQuote_currencyCode_fkey"
+ columns: ["currencyCode"]
+ isOneToOne: false
+ referencedRelation: "currencyCode"
+ referencedColumns: ["code"]
+ },
+ {
+ foreignKeyName: "supplierQuote_externalLinkId_fkey"
+ columns: ["externalLinkId"]
+ isOneToOne: false
+ referencedRelation: "externalLink"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_supplierContactId_fkey"
+ columns: ["supplierContactId"]
+ isOneToOne: false
+ referencedRelation: "supplierContact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "supplierQuote_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "supplierQuote_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_supplierInteractionId_fkey"
+ columns: ["supplierInteractionId"]
+ isOneToOne: false
+ referencedRelation: "supplierInteraction"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_supplierLocationId_fkey"
+ columns: ["supplierLocationId"]
+ isOneToOne: false
+ referencedRelation: "supplierLocation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ supplierQuoteFavorite: {
+ Row: {
+ supplierQuoteId: string
+ userId: string
+ }
+ Insert: {
+ supplierQuoteId: string
+ userId: string
+ }
+ Update: {
+ supplierQuoteId?: string
+ userId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "supplierQuoteFavorites_supplierQuoteId_fkey"
+ columns: ["supplierQuoteId"]
+ isOneToOne: false
+ referencedRelation: "supplierQuote"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteFavorites_supplierQuoteId_fkey"
+ columns: ["supplierQuoteId"]
+ isOneToOne: false
+ referencedRelation: "supplierQuotes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteFavorites_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ supplierQuoteLine: {
+ Row: {
+ accountId: string | null
+ companyId: string
+ conversionFactor: number
+ costCenterId: string | null
+ createdBy: string
+ customFields: Json | null
+ description: string
+ externalNotes: Json | null
+ id: string
+ internalNotes: Json | null
+ inventoryUnitOfMeasureCode: string | null
+ itemId: string | null
+ ownerId: string | null
+ purchaseUnitOfMeasureCode: string | null
+ quantity: number[] | null
+ requiredDate: string | null
+ sortOrder: number
+ supplierPartId: string | null
+ supplierPartRevision: string | null
+ supplierQuoteId: string
+ supplierQuoteLineType: string
+ supplierQuoteRevisionId: number
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ accountId?: string | null
+ companyId: string
+ conversionFactor?: number
+ costCenterId?: string | null
+ createdBy: string
+ customFields?: Json | null
+ description: string
+ externalNotes?: Json | null
+ id?: string
+ internalNotes?: Json | null
+ inventoryUnitOfMeasureCode?: string | null
+ itemId?: string | null
+ ownerId?: string | null
+ purchaseUnitOfMeasureCode?: string | null
+ quantity?: number[] | null
+ requiredDate?: string | null
+ sortOrder?: number
+ supplierPartId?: string | null
+ supplierPartRevision?: string | null
+ supplierQuoteId: string
+ supplierQuoteLineType?: string
+ supplierQuoteRevisionId?: number
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ accountId?: string | null
+ companyId?: string
+ conversionFactor?: number
+ costCenterId?: string | null
+ createdBy?: string
+ customFields?: Json | null
+ description?: string
+ externalNotes?: Json | null
+ id?: string
+ internalNotes?: Json | null
+ inventoryUnitOfMeasureCode?: string | null
+ itemId?: string | null
+ ownerId?: string | null
+ purchaseUnitOfMeasureCode?: string | null
+ quantity?: number[] | null
+ requiredDate?: string | null
+ sortOrder?: number
+ supplierPartId?: string | null
+ supplierPartRevision?: string | null
+ supplierQuoteId?: string
+ supplierQuoteLineType?: string
+ supplierQuoteRevisionId?: number
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "supplierQuoteLine_accountId_fkey"
+ columns: ["accountId"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_accountId_fkey"
+ columns: ["accountId"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_costCenterId_fkey"
+ columns: ["costCenterId"]
+ isOneToOne: false
+ referencedRelation: "costCenter"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_inventoryUnitOfMeasureCode_fkey"
+ columns: ["inventoryUnitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_purchaseUnitOfMeasureCode_fkey"
+ columns: ["purchaseUnitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_supplierQuoteId_fkey"
+ columns: ["supplierQuoteId"]
+ isOneToOne: false
+ referencedRelation: "supplierQuote"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_supplierQuoteId_fkey"
+ columns: ["supplierQuoteId"]
+ isOneToOne: false
+ referencedRelation: "supplierQuotes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ supplierQuoteLinePrice: {
+ Row: {
+ createdAt: string
+ createdBy: string
+ exchangeRate: number | null
+ extendedPrice: number | null
+ leadTime: number
+ quantity: number
+ shippingCost: number | null
+ supplierExtendedPrice: number | null
+ supplierQuoteId: string
+ supplierQuoteLineId: string
+ supplierShippingCost: number
+ supplierTaxAmount: number
+ supplierUnitPrice: number
+ taxAmount: number | null
+ taxPercent: number | null
+ unitPrice: number | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ createdAt?: string
+ createdBy: string
+ exchangeRate?: number | null
+ extendedPrice?: number | null
+ leadTime?: number
+ quantity?: number
+ shippingCost?: number | null
+ supplierExtendedPrice?: number | null
+ supplierQuoteId: string
+ supplierQuoteLineId: string
+ supplierShippingCost?: number
+ supplierTaxAmount?: number
+ supplierUnitPrice?: number
+ taxAmount?: number | null
+ taxPercent?: number | null
+ unitPrice?: number | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ createdAt?: string
+ createdBy?: string
+ exchangeRate?: number | null
+ extendedPrice?: number | null
+ leadTime?: number
+ quantity?: number
+ shippingCost?: number | null
+ supplierExtendedPrice?: number | null
+ supplierQuoteId?: string
+ supplierQuoteLineId?: string
+ supplierShippingCost?: number
+ supplierTaxAmount?: number
+ supplierUnitPrice?: number
+ taxAmount?: number | null
+ taxPercent?: number | null
+ unitPrice?: number | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "supplierQuoteLinePrice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLinePrice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLinePrice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLinePrice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLinePrice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLinePrice_supplierQuoteId_fkey"
+ columns: ["supplierQuoteId"]
+ isOneToOne: false
+ referencedRelation: "supplierQuote"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLinePrice_supplierQuoteId_fkey"
+ columns: ["supplierQuoteId"]
+ isOneToOne: false
+ referencedRelation: "supplierQuotes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLinePrice_supplierQuoteLineId_fkey"
+ columns: ["supplierQuoteLineId"]
+ isOneToOne: false
+ referencedRelation: "supplierQuoteLine"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLinePrice_supplierQuoteLineId_fkey"
+ columns: ["supplierQuoteLineId"]
+ isOneToOne: false
+ referencedRelation: "supplierQuoteLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLinePrice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLinePrice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLinePrice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLinePrice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLinePrice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ supplierShipping: {
+ Row: {
+ companyId: string
+ customFields: Json | null
+ incoterm: Database["public"]["Enums"]["incoterm"] | null
+ incotermLocation: string | null
+ shippingMethodId: string | null
+ shippingSupplierContactId: string | null
+ shippingSupplierId: string | null
+ shippingSupplierLocationId: string | null
+ shippingTermId: string | null
+ supplierId: string
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ customFields?: Json | null
+ incoterm?: Database["public"]["Enums"]["incoterm"] | null
+ incotermLocation?: string | null
+ shippingMethodId?: string | null
+ shippingSupplierContactId?: string | null
+ shippingSupplierId?: string | null
+ shippingSupplierLocationId?: string | null
+ shippingTermId?: string | null
+ supplierId: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ customFields?: Json | null
+ incoterm?: Database["public"]["Enums"]["incoterm"] | null
+ incotermLocation?: string | null
+ shippingMethodId?: string | null
+ shippingSupplierContactId?: string | null
+ shippingSupplierId?: string | null
+ shippingSupplierLocationId?: string | null
+ shippingTermId?: string | null
+ supplierId?: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "supplierShipping_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierShipping_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierShipping_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplierShipping_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplierShipping_shippingMethodId_fkey"
+ columns: ["shippingMethodId"]
+ isOneToOne: false
+ referencedRelation: "shippingMethod"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierShipping_shippingSupplierContactId_fkey"
+ columns: ["shippingSupplierContactId"]
+ isOneToOne: false
+ referencedRelation: "supplierContact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierShipping_shippingSupplierId_fkey"
+ columns: ["shippingSupplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "supplierShipping_shippingSupplierId_fkey"
+ columns: ["shippingSupplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "supplierShipping_shippingSupplierId_fkey"
+ columns: ["shippingSupplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierShipping_shippingSupplierId_fkey"
+ columns: ["shippingSupplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierShipping_shippingSupplierId_fkey"
+ columns: ["shippingSupplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierShipping_shippingSupplierLocationId_fkey"
+ columns: ["shippingSupplierLocationId"]
+ isOneToOne: false
+ referencedRelation: "supplierLocation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierShipping_shippingTermId_fkey"
+ columns: ["shippingTermId"]
+ isOneToOne: false
+ referencedRelation: "shippingTerm"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierShipping_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: true
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "supplierShipping_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: true
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "supplierShipping_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: true
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierShipping_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: true
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierShipping_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: true
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierShipping_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierShipping_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierShipping_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierShipping_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierShipping_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ supplierTax: {
+ Row: {
+ companyId: string
+ eori: string | null
+ supplierId: string
+ taxExempt: boolean
+ taxExemptionCertificateNumber: string | null
+ taxExemptionCertificatePath: string | null
+ taxExemptionReason:
+ | Database["public"]["Enums"]["taxExemptionReason"]
+ | null
+ taxId: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ vatNumber: string | null
+ }
+ Insert: {
+ companyId: string
+ eori?: string | null
+ supplierId: string
+ taxExempt?: boolean
+ taxExemptionCertificateNumber?: string | null
+ taxExemptionCertificatePath?: string | null
+ taxExemptionReason?:
+ | Database["public"]["Enums"]["taxExemptionReason"]
+ | null
+ taxId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ vatNumber?: string | null
+ }
+ Update: {
+ companyId?: string
+ eori?: string | null
+ supplierId?: string
+ taxExempt?: boolean
+ taxExemptionCertificateNumber?: string | null
+ taxExemptionCertificatePath?: string | null
+ taxExemptionReason?:
+ | Database["public"]["Enums"]["taxExemptionReason"]
+ | null
+ taxId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ vatNumber?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "supplierTax_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierTax_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierTax_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplierTax_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplierTax_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: true
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "supplierTax_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: true
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "supplierTax_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: true
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierTax_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: true
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierTax_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: true
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierTax_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierTax_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierTax_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierTax_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierTax_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ supplierType: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ id: string
+ name: string
+ protected: boolean
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ id?: string
+ name: string
+ protected?: boolean
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ id?: string
+ name?: string
+ protected?: boolean
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "supplierType_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierType_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierType_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplierType_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplierType_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierType_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierType_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierType_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierType_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "supplierType_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierType_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierType_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierType_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierType_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ supplyActual: {
+ Row: {
+ actualQuantity: number
+ companyId: string
+ createdAt: string
+ createdBy: string
+ itemId: string
+ locationId: string
+ notes: string | null
+ periodId: string
+ sourceType: Database["public"]["Enums"]["supplySourceType"]
+ updatedAt: string
+ updatedBy: string
+ }
+ Insert: {
+ actualQuantity?: number
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ itemId: string
+ locationId: string
+ notes?: string | null
+ periodId: string
+ sourceType: Database["public"]["Enums"]["supplySourceType"]
+ updatedAt?: string
+ updatedBy: string
+ }
+ Update: {
+ actualQuantity?: number
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ itemId?: string
+ locationId?: string
+ notes?: string | null
+ periodId?: string
+ sourceType?: Database["public"]["Enums"]["supplySourceType"]
+ updatedAt?: string
+ updatedBy?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "supplyActual_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyActual_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyActual_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplyActual_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplyActual_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyActual_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyActual_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyActual_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyActual_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "supplyActual_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyActual_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyActual_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyActual_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyActual_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyActual_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyActual_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyActual_periodId_fkey"
+ columns: ["periodId"]
+ isOneToOne: false
+ referencedRelation: "period"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyActual_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyActual_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyActual_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyActual_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyActual_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ supplyForecast: {
+ Row: {
+ companyId: string
+ confidence: number | null
+ createdAt: string
+ createdBy: string
+ forecastMethod: string | null
+ forecastQuantity: number
+ itemId: string
+ locationId: string
+ notes: string | null
+ periodId: string
+ sourceType: Database["public"]["Enums"]["supplySourceType"] | null
+ updatedAt: string
+ updatedBy: string
+ }
+ Insert: {
+ companyId: string
+ confidence?: number | null
+ createdAt?: string
+ createdBy: string
+ forecastMethod?: string | null
+ forecastQuantity?: number
+ itemId: string
+ locationId: string
+ notes?: string | null
+ periodId: string
+ sourceType?: Database["public"]["Enums"]["supplySourceType"] | null
+ updatedAt?: string
+ updatedBy: string
+ }
+ Update: {
+ companyId?: string
+ confidence?: number | null
+ createdAt?: string
+ createdBy?: string
+ forecastMethod?: string | null
+ forecastQuantity?: number
+ itemId?: string
+ locationId?: string
+ notes?: string | null
+ periodId?: string
+ sourceType?: Database["public"]["Enums"]["supplySourceType"] | null
+ updatedAt?: string
+ updatedBy?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "supplyForecast_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyForecast_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyForecast_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplyForecast_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplyForecast_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyForecast_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyForecast_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyForecast_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyForecast_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "supplyForecast_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyForecast_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyForecast_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyForecast_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyForecast_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyForecast_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyForecast_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyForecast_periodId_fkey"
+ columns: ["periodId"]
+ isOneToOne: false
+ referencedRelation: "period"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyForecast_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyForecast_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyForecast_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyForecast_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplyForecast_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ tableView: {
+ Row: {
+ columnOrder: string[] | null
+ columnPinning: Json | null
+ columnVisibility: Json | null
+ companyId: string
+ createdAt: string
+ createdBy: string
+ description: string | null
+ filters: string[] | null
+ id: string
+ name: string
+ sortOrder: number
+ sorts: string[] | null
+ table: string
+ type: Database["public"]["Enums"]["tableViewType"]
+ updatedBy: string | null
+ }
+ Insert: {
+ columnOrder?: string[] | null
+ columnPinning?: Json | null
+ columnVisibility?: Json | null
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ description?: string | null
+ filters?: string[] | null
+ id?: string
+ name: string
+ sortOrder?: number
+ sorts?: string[] | null
+ table: string
+ type?: Database["public"]["Enums"]["tableViewType"]
+ updatedBy?: string | null
+ }
+ Update: {
+ columnOrder?: string[] | null
+ columnPinning?: Json | null
+ columnVisibility?: Json | null
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ description?: string | null
+ filters?: string[] | null
+ id?: string
+ name?: string
+ sortOrder?: number
+ sorts?: string[] | null
+ table?: string
+ type?: Database["public"]["Enums"]["tableViewType"]
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "tableView_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "tableView_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "tableView_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "tableView_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "tableView_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "tableView_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "tableView_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "tableView_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "tableView_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "tableView_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "tableView_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "tableView_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "tableView_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "tableView_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ tag: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ name: string
+ table: string
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ name: string
+ table: string
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ name?: string
+ table?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "tag_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "tag_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "tag_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "tag_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "tag_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "tag_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "tag_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "tag_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "tag_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ terms: {
+ Row: {
+ id: string
+ purchasingTerms: Json | null
+ salesTerms: Json | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ id?: string
+ purchasingTerms?: Json | null
+ salesTerms?: Json | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ id?: string
+ purchasingTerms?: Json | null
+ salesTerms?: Json | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "terms_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "terms_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "terms_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "terms_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "terms_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "terms_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "terms_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "terms_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "terms_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ timeCardEntry: {
+ Row: {
+ autoCloseShiftId: string | null
+ clockIn: string
+ clockOut: string | null
+ companyId: string
+ createdAt: string
+ createdBy: string
+ employeeId: string
+ id: string
+ note: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ autoCloseShiftId?: string | null
+ clockIn?: string
+ clockOut?: string | null
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ employeeId: string
+ id?: string
+ note?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ autoCloseShiftId?: string | null
+ clockIn?: string
+ clockOut?: string | null
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ employeeId?: string
+ id?: string
+ note?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "timeCardEntry_autoCloseShiftId_fkey"
+ columns: ["autoCloseShiftId"]
+ isOneToOne: false
+ referencedRelation: "shift"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_autoCloseShiftId_fkey"
+ columns: ["autoCloseShiftId"]
+ isOneToOne: false
+ referencedRelation: "shifts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ tool: {
+ Row: {
+ approved: boolean
+ approvedBy: string | null
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ id: string
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ approved?: boolean
+ approvedBy?: string | null
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ id: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ approved?: boolean
+ approvedBy?: string | null
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ id?: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "tool_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "tool_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "tool_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "tool_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "tool_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "tool_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "tool_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "tool_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "tool_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "tool_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "tool_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "tool_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "tool_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "tool_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "tool_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "tool_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "tool_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "tool_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "tool_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ trackedActivity: {
+ Row: {
+ attributes: Json
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ sourceDocument: string | null
+ sourceDocumentId: string | null
+ sourceDocumentReadableId: string | null
+ type: string
+ }
+ Insert: {
+ attributes?: Json
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ sourceDocument?: string | null
+ sourceDocumentId?: string | null
+ sourceDocumentReadableId?: string | null
+ type: string
+ }
+ Update: {
+ attributes?: Json
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ sourceDocument?: string | null
+ sourceDocumentId?: string | null
+ sourceDocumentReadableId?: string | null
+ type?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "trackedActivity_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trackedActivity_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trackedActivity_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "trackedActivity_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "trackedActivity_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trackedActivity_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trackedActivity_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trackedActivity_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trackedActivity_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ trackedActivityInput: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ quantity: number
+ trackedActivityId: string
+ trackedEntityId: string
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ quantity: number
+ trackedActivityId: string
+ trackedEntityId: string
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ quantity?: number
+ trackedActivityId?: string
+ trackedEntityId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "trackedActivityInput_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trackedActivityInput_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trackedActivityInput_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "trackedActivityInput_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "trackedActivityInput_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trackedActivityInput_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trackedActivityInput_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trackedActivityInput_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trackedActivityInput_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "trackedActivityInput_trackedActivityId_fkey"
+ columns: ["trackedActivityId"]
+ isOneToOne: false
+ referencedRelation: "trackedActivity"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trackedActivityInput_trackedEntityId_fkey"
+ columns: ["trackedEntityId"]
+ isOneToOne: false
+ referencedRelation: "trackedEntity"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ trackedActivityOutput: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ quantity: number
+ trackedActivityId: string
+ trackedEntityId: string
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ quantity: number
+ trackedActivityId: string
+ trackedEntityId: string
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ quantity?: number
+ trackedActivityId?: string
+ trackedEntityId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "trackedActivityOutput_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trackedActivityOutput_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trackedActivityOutput_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "trackedActivityOutput_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "trackedActivityOutput_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trackedActivityOutput_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trackedActivityOutput_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trackedActivityOutput_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trackedActivityOutput_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "trackedActivityOutput_trackedActivityId_fkey"
+ columns: ["trackedActivityId"]
+ isOneToOne: false
+ referencedRelation: "trackedActivity"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trackedActivityOutput_trackedEntityId_fkey"
+ columns: ["trackedEntityId"]
+ isOneToOne: false
+ referencedRelation: "trackedEntity"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ trackedEntity: {
+ Row: {
+ attributes: Json
+ companyId: string
+ createdAt: string
+ createdBy: string
+ expirationDate: string | null
+ id: string
+ itemId: string | null
+ quantity: number
+ readableId: string | null
+ sourceDocument: string
+ sourceDocumentId: string
+ sourceDocumentReadableId: string | null
+ status: Database["public"]["Enums"]["trackedEntityStatus"]
+ }
+ Insert: {
+ attributes?: Json
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ expirationDate?: string | null
+ id?: string
+ itemId?: string | null
+ quantity: number
+ readableId?: string | null
+ sourceDocument: string
+ sourceDocumentId: string
+ sourceDocumentReadableId?: string | null
+ status?: Database["public"]["Enums"]["trackedEntityStatus"]
+ }
+ Update: {
+ attributes?: Json
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ expirationDate?: string | null
+ id?: string
+ itemId?: string | null
+ quantity?: number
+ readableId?: string | null
+ sourceDocument?: string
+ sourceDocumentId?: string
+ sourceDocumentReadableId?: string | null
+ status?: Database["public"]["Enums"]["trackedEntityStatus"]
+ }
+ Relationships: [
+ {
+ foreignKeyName: "trackedEntity_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trackedEntity_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trackedEntity_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "trackedEntity_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "trackedEntity_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trackedEntity_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trackedEntity_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trackedEntity_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trackedEntity_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "trackedEntity_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trackedEntity_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trackedEntity_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trackedEntity_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trackedEntity_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trackedEntity_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ training: {
+ Row: {
+ assignee: string | null
+ companyId: string | null
+ content: Json | null
+ createdAt: string
+ createdBy: string
+ description: string | null
+ estimatedDuration: string | null
+ frequency: Database["public"]["Enums"]["trainingFrequency"]
+ id: string
+ name: string
+ processId: string | null
+ status: Database["public"]["Enums"]["trainingStatus"]
+ tags: string[] | null
+ type: Database["public"]["Enums"]["trainingType"]
+ updatedAt: string | null
+ updatedBy: string | null
+ version: number
+ }
+ Insert: {
+ assignee?: string | null
+ companyId?: string | null
+ content?: Json | null
+ createdAt?: string
+ createdBy: string
+ description?: string | null
+ estimatedDuration?: string | null
+ frequency?: Database["public"]["Enums"]["trainingFrequency"]
+ id?: string
+ name: string
+ processId?: string | null
+ status?: Database["public"]["Enums"]["trainingStatus"]
+ tags?: string[] | null
+ type?: Database["public"]["Enums"]["trainingType"]
+ updatedAt?: string | null
+ updatedBy?: string | null
+ version?: number
+ }
+ Update: {
+ assignee?: string | null
+ companyId?: string | null
+ content?: Json | null
+ createdAt?: string
+ createdBy?: string
+ description?: string | null
+ estimatedDuration?: string | null
+ frequency?: Database["public"]["Enums"]["trainingFrequency"]
+ id?: string
+ name?: string
+ processId?: string | null
+ status?: Database["public"]["Enums"]["trainingStatus"]
+ tags?: string[] | null
+ type?: Database["public"]["Enums"]["trainingType"]
+ updatedAt?: string | null
+ updatedBy?: string | null
+ version?: number
+ }
+ Relationships: [
+ {
+ foreignKeyName: "training_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "training_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "training_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "training_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "training_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "training_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "training_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "training_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "training_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "training_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "training_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "training_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "training_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "training_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "training_processId_fkey"
+ columns: ["processId"]
+ isOneToOne: false
+ referencedRelation: "process"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "training_processId_fkey"
+ columns: ["processId"]
+ isOneToOne: false
+ referencedRelation: "processes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "training_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "training_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "training_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "training_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "training_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ trainingAssignment: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ groupIds: string[] | null
+ id: string
+ trainingId: string
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ groupIds?: string[] | null
+ id?: string
+ trainingId: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ groupIds?: string[] | null
+ id?: string
+ trainingId?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "trainingAssignment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingAssignment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingAssignment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "trainingAssignment_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "trainingAssignment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingAssignment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingAssignment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingAssignment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingAssignment_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "trainingAssignment_trainingId_fkey"
+ columns: ["trainingId"]
+ isOneToOne: false
+ referencedRelation: "training"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingAssignment_trainingId_fkey"
+ columns: ["trainingId"]
+ isOneToOne: false
+ referencedRelation: "trainings"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingAssignment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingAssignment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingAssignment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingAssignment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingAssignment_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ trainingCompletion: {
+ Row: {
+ companyId: string
+ completedAt: string
+ completedBy: string
+ createdAt: string
+ createdBy: string
+ employeeId: string
+ id: number
+ period: string | null
+ trainingAssignmentId: string
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ completedAt?: string
+ completedBy: string
+ createdAt?: string
+ createdBy: string
+ employeeId: string
+ id?: number
+ period?: string | null
+ trainingAssignmentId: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ completedAt?: string
+ completedBy?: string
+ createdAt?: string
+ createdBy?: string
+ employeeId?: string
+ id?: number
+ period?: string | null
+ trainingAssignmentId?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "trainingCompletion_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingCompletion_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingCompletion_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "trainingCompletion_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "trainingCompletion_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingCompletion_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingCompletion_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingCompletion_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingCompletion_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "trainingCompletion_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingCompletion_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingCompletion_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingCompletion_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingCompletion_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "trainingCompletion_trainingAssignmentId_fkey"
+ columns: ["trainingAssignmentId"]
+ isOneToOne: false
+ referencedRelation: "trainingAssignment"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingCompletion_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingCompletion_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingCompletion_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingCompletion_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingCompletion_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ trainingQuestion: {
+ Row: {
+ companyId: string
+ correctAnswers: string[] | null
+ correctBoolean: boolean | null
+ correctNumber: number | null
+ createdAt: string
+ createdBy: string
+ id: string
+ matchingPairs: Json | null
+ options: string[] | null
+ question: string
+ required: boolean | null
+ sortOrder: number
+ tolerance: number | null
+ trainingId: string
+ type: Database["public"]["Enums"]["trainingQuestionType"]
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ correctAnswers?: string[] | null
+ correctBoolean?: boolean | null
+ correctNumber?: number | null
+ createdAt?: string
+ createdBy: string
+ id?: string
+ matchingPairs?: Json | null
+ options?: string[] | null
+ question: string
+ required?: boolean | null
+ sortOrder?: number
+ tolerance?: number | null
+ trainingId: string
+ type: Database["public"]["Enums"]["trainingQuestionType"]
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ correctAnswers?: string[] | null
+ correctBoolean?: boolean | null
+ correctNumber?: number | null
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ matchingPairs?: Json | null
+ options?: string[] | null
+ question?: string
+ required?: boolean | null
+ sortOrder?: number
+ tolerance?: number | null
+ trainingId?: string
+ type?: Database["public"]["Enums"]["trainingQuestionType"]
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "trainingQuestion_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingQuestion_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingQuestion_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "trainingQuestion_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "trainingQuestion_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingQuestion_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingQuestion_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingQuestion_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingQuestion_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "trainingQuestion_trainingId_fkey"
+ columns: ["trainingId"]
+ isOneToOne: false
+ referencedRelation: "training"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingQuestion_trainingId_fkey"
+ columns: ["trainingId"]
+ isOneToOne: false
+ referencedRelation: "trainings"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingQuestion_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingQuestion_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingQuestion_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingQuestion_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "trainingQuestion_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ unitOfMeasure: {
+ Row: {
+ active: boolean
+ code: string
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ id: string
+ name: string
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ active?: boolean
+ code: string
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ id?: string
+ name: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ active?: boolean
+ code?: string
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ id?: string
+ name?: string
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "unitOfMeasure_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "unitOfMeasure_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "unitOfMeasure_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "unitOfMeasure_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "unitOfMeasure_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "unitOfMeasure_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "unitOfMeasure_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "unitOfMeasure_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "unitOfMeasure_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "unitOfMeasure_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "unitOfMeasure_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "unitOfMeasure_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "unitOfMeasure_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "unitOfMeasure_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ user: {
+ Row: {
+ about: string
+ acknowledgedITAR: boolean
+ active: boolean | null
+ admin: boolean | null
+ avatarUrl: string | null
+ createdAt: string
+ developer: boolean | null
+ email: string
+ firstName: string
+ flags: Json
+ fullName: string | null
+ id: string
+ isConsoleOperator: boolean
+ lastName: string
+ phone: string | null
+ updatedAt: string | null
+ }
+ Insert: {
+ about?: string
+ acknowledgedITAR?: boolean
+ active?: boolean | null
+ admin?: boolean | null
+ avatarUrl?: string | null
+ createdAt?: string
+ developer?: boolean | null
+ email: string
+ firstName?: string
+ flags?: Json
+ fullName?: string | null
+ id: string
+ isConsoleOperator?: boolean
+ lastName?: string
+ phone?: string | null
+ updatedAt?: string | null
+ }
+ Update: {
+ about?: string
+ acknowledgedITAR?: boolean
+ active?: boolean | null
+ admin?: boolean | null
+ avatarUrl?: string | null
+ createdAt?: string
+ developer?: boolean | null
+ email?: string
+ firstName?: string
+ flags?: Json
+ fullName?: string | null
+ id?: string
+ isConsoleOperator?: boolean
+ lastName?: string
+ phone?: string | null
+ updatedAt?: string | null
+ }
+ Relationships: []
+ }
+ userAttribute: {
+ Row: {
+ active: boolean | null
+ attributeDataTypeId: number
+ canSelfManage: boolean | null
+ createdAt: string
+ createdBy: string
+ id: string
+ listOptions: string[] | null
+ name: string
+ sortOrder: number
+ updatedAt: string | null
+ updatedBy: string | null
+ userAttributeCategoryId: string
+ }
+ Insert: {
+ active?: boolean | null
+ attributeDataTypeId: number
+ canSelfManage?: boolean | null
+ createdAt?: string
+ createdBy: string
+ id?: string
+ listOptions?: string[] | null
+ name: string
+ sortOrder?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ userAttributeCategoryId: string
+ }
+ Update: {
+ active?: boolean | null
+ attributeDataTypeId?: number
+ canSelfManage?: boolean | null
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ listOptions?: string[] | null
+ name?: string
+ sortOrder?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ userAttributeCategoryId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "userAttribute_attributeDataTypeId_fkey"
+ columns: ["attributeDataTypeId"]
+ isOneToOne: false
+ referencedRelation: "attributeDataType"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttribute_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttribute_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttribute_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttribute_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttribute_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "userAttribute_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttribute_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttribute_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttribute_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttribute_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "userAttribute_userAttributeCategoryId_fkey"
+ columns: ["userAttributeCategoryId"]
+ isOneToOne: false
+ referencedRelation: "userAttributeCategory"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ userAttributeCategory: {
+ Row: {
+ active: boolean | null
+ companyId: string | null
+ createdAt: string
+ createdBy: string
+ emoji: string | null
+ id: string
+ name: string
+ protected: boolean | null
+ public: boolean | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ active?: boolean | null
+ companyId?: string | null
+ createdAt?: string
+ createdBy: string
+ emoji?: string | null
+ id?: string
+ name: string
+ protected?: boolean | null
+ public?: boolean | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ active?: boolean | null
+ companyId?: string | null
+ createdAt?: string
+ createdBy?: string
+ emoji?: string | null
+ id?: string
+ name?: string
+ protected?: boolean | null
+ public?: boolean | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "userAttributeCategory_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttributeCategory_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttributeCategory_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "userAttributeCategory_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "userAttributeCategory_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttributeCategory_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttributeCategory_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttributeCategory_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttributeCategory_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "userAttributeCategory_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttributeCategory_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttributeCategory_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttributeCategory_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttributeCategory_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ userAttributeValue: {
+ Row: {
+ createdAt: string
+ createdBy: string
+ id: string
+ updatedAt: string | null
+ updatedBy: string | null
+ userAttributeId: string
+ userId: string
+ valueBoolean: boolean | null
+ valueDate: string | null
+ valueFile: string | null
+ valueNumeric: number | null
+ valueText: string | null
+ valueUser: string | null
+ }
+ Insert: {
+ createdAt?: string
+ createdBy: string
+ id?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ userAttributeId: string
+ userId: string
+ valueBoolean?: boolean | null
+ valueDate?: string | null
+ valueFile?: string | null
+ valueNumeric?: number | null
+ valueText?: string | null
+ valueUser?: string | null
+ }
+ Update: {
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ userAttributeId?: string
+ userId?: string
+ valueBoolean?: boolean | null
+ valueDate?: string | null
+ valueFile?: string | null
+ valueNumeric?: number | null
+ valueText?: string | null
+ valueUser?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "userAttributeValue_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttributeValue_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttributeValue_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttributeValue_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttributeValue_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "userAttributeValue_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttributeValue_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttributeValue_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttributeValue_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttributeValue_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "userAttributeValue_userAttributeId_fkey"
+ columns: ["userAttributeId"]
+ isOneToOne: false
+ referencedRelation: "userAttribute"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttributeValue_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttributeValue_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttributeValue_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttributeValue_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttributeValue_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "userAttributeValue_valueUser_fkey"
+ columns: ["valueUser"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttributeValue_valueUser_fkey"
+ columns: ["valueUser"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttributeValue_valueUser_fkey"
+ columns: ["valueUser"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttributeValue_valueUser_fkey"
+ columns: ["valueUser"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userAttributeValue_valueUser_fkey"
+ columns: ["valueUser"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ userModulePreference: {
+ Row: {
+ companyId: string
+ hidden: boolean
+ id: string
+ module: string
+ position: number
+ updatedAt: string
+ userId: string
+ }
+ Insert: {
+ companyId: string
+ hidden?: boolean
+ id?: string
+ module: string
+ position: number
+ updatedAt?: string
+ userId: string
+ }
+ Update: {
+ companyId?: string
+ hidden?: boolean
+ id?: string
+ module?: string
+ position?: number
+ updatedAt?: string
+ userId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "userModulePreference_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userModulePreference_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userModulePreference_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "userModulePreference_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "userModulePreference_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userModulePreference_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userModulePreference_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userModulePreference_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userModulePreference_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ userPermission: {
+ Row: {
+ id: string
+ permissions: Json | null
+ }
+ Insert: {
+ id: string
+ permissions?: Json | null
+ }
+ Update: {
+ id?: string
+ permissions?: Json | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "userPermission_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userPermission_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userPermission_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userPermission_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userPermission_id_fkey"
+ columns: ["id"]
+ isOneToOne: true
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ userToCompany: {
+ Row: {
+ companyId: string
+ role: Database["public"]["Enums"]["role"]
+ userId: string
+ }
+ Insert: {
+ companyId: string
+ role: Database["public"]["Enums"]["role"]
+ userId: string
+ }
+ Update: {
+ companyId?: string
+ role?: Database["public"]["Enums"]["role"]
+ userId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "userToCompany_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userToCompany_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userToCompany_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "userToCompany_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "userToCompany_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userToCompany_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userToCompany_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userToCompany_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userToCompany_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ warehouse: {
+ Row: {
+ active: boolean
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ locationId: string
+ name: string
+ requiresBin: boolean
+ requiresPick: boolean
+ requiresPutAway: boolean
+ requiresReceive: boolean
+ requiresShipment: boolean
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ active?: boolean
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ locationId: string
+ name: string
+ requiresBin?: boolean
+ requiresPick?: boolean
+ requiresPutAway?: boolean
+ requiresReceive?: boolean
+ requiresShipment?: boolean
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ active?: boolean
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ locationId?: string
+ name?: string
+ requiresBin?: boolean
+ requiresPick?: boolean
+ requiresPutAway?: boolean
+ requiresReceive?: boolean
+ requiresShipment?: boolean
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "warehouse_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouse_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouse_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "warehouse_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "warehouse_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouse_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouse_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouse_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouse_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "warehouse_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouse_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouse_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouse_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouse_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouse_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ warehouseTransfer: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ expectedReceiptDate: string | null
+ fromLocationId: string
+ id: string
+ notes: string | null
+ reference: string | null
+ status: Database["public"]["Enums"]["warehouseTransferStatus"]
+ tags: string[] | null
+ toLocationId: string
+ transferDate: string | null
+ transferId: string
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ expectedReceiptDate?: string | null
+ fromLocationId: string
+ id?: string
+ notes?: string | null
+ reference?: string | null
+ status?: Database["public"]["Enums"]["warehouseTransferStatus"]
+ tags?: string[] | null
+ toLocationId: string
+ transferDate?: string | null
+ transferId: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ expectedReceiptDate?: string | null
+ fromLocationId?: string
+ id?: string
+ notes?: string | null
+ reference?: string | null
+ status?: Database["public"]["Enums"]["warehouseTransferStatus"]
+ tags?: string[] | null
+ toLocationId?: string
+ transferDate?: string | null
+ transferId?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "warehouseTransfer_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransfer_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransfer_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "warehouseTransfer_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "warehouseTransfer_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransfer_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransfer_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransfer_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransfer_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "warehouseTransfer_fromLocationId_fkey"
+ columns: ["fromLocationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransfer_toLocationId_fkey"
+ columns: ["toLocationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransfer_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransfer_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransfer_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransfer_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransfer_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ warehouseTransferLine: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ fromLocationId: string
+ fromStorageUnitId: string | null
+ id: string
+ itemId: string
+ notes: string | null
+ quantity: number
+ receivedQuantity: number
+ shippedQuantity: number
+ toLocationId: string
+ toStorageUnitId: string | null
+ transferId: string
+ unitOfMeasureCode: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ fromLocationId: string
+ fromStorageUnitId?: string | null
+ id?: string
+ itemId: string
+ notes?: string | null
+ quantity?: number
+ receivedQuantity?: number
+ shippedQuantity?: number
+ toLocationId: string
+ toStorageUnitId?: string | null
+ transferId: string
+ unitOfMeasureCode?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ fromLocationId?: string
+ fromStorageUnitId?: string | null
+ id?: string
+ itemId?: string
+ notes?: string | null
+ quantity?: number
+ receivedQuantity?: number
+ shippedQuantity?: number
+ toLocationId?: string
+ toStorageUnitId?: string | null
+ transferId?: string
+ unitOfMeasureCode?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "warehouseTransferLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransferLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransferLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "warehouseTransferLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "warehouseTransferLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransferLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransferLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransferLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransferLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "warehouseTransferLine_fromLocationId_fkey"
+ columns: ["fromLocationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransferLine_fromStorageUnitId_fkey"
+ columns: ["fromStorageUnitId"]
+ isOneToOne: false
+ referencedRelation: "storageUnit"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransferLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransferLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransferLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransferLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransferLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransferLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransferLine_toLocationId_fkey"
+ columns: ["toLocationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransferLine_toStorageUnitId_fkey"
+ columns: ["toStorageUnitId"]
+ isOneToOne: false
+ referencedRelation: "storageUnit"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransferLine_transferId_fkey"
+ columns: ["transferId"]
+ isOneToOne: false
+ referencedRelation: "warehouseTransfer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransferLine_unitOfMeasureCode_fkey"
+ columns: ["unitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "warehouseTransferLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransferLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransferLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransferLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "warehouseTransferLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ webhook: {
+ Row: {
+ active: boolean
+ companyId: string
+ createdAt: string
+ createdBy: string
+ errorCount: number
+ id: string
+ lastError: string | null
+ lastSuccess: string | null
+ name: string
+ onDelete: boolean
+ onInsert: boolean
+ onUpdate: boolean
+ successCount: number
+ table: string
+ updatedAt: string | null
+ updatedBy: string | null
+ url: string
+ }
+ Insert: {
+ active?: boolean
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ errorCount?: number
+ id?: string
+ lastError?: string | null
+ lastSuccess?: string | null
+ name: string
+ onDelete?: boolean
+ onInsert?: boolean
+ onUpdate?: boolean
+ successCount?: number
+ table: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ url: string
+ }
+ Update: {
+ active?: boolean
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ errorCount?: number
+ id?: string
+ lastError?: string | null
+ lastSuccess?: string | null
+ name?: string
+ onDelete?: boolean
+ onInsert?: boolean
+ onUpdate?: boolean
+ successCount?: number
+ table?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ url?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "webhook_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "webhook_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "webhook_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "webhook_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "webhook_table_fkey"
+ columns: ["table"]
+ isOneToOne: false
+ referencedRelation: "webhookTable"
+ referencedColumns: ["table"]
+ },
+ ]
+ }
+ webhookTable: {
+ Row: {
+ module: Database["public"]["Enums"]["module"]
+ name: string
+ table: string
+ }
+ Insert: {
+ module: Database["public"]["Enums"]["module"]
+ name: string
+ table: string
+ }
+ Update: {
+ module?: Database["public"]["Enums"]["module"]
+ name?: string
+ table?: string
+ }
+ Relationships: []
+ }
+ workCenter: {
+ Row: {
+ active: boolean
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json | null
+ defaultStandardFactor: Database["public"]["Enums"]["factor"]
+ departmentId: string | null
+ description: string | null
+ id: string
+ laborRate: number
+ locationId: string | null
+ machineRate: number
+ name: string
+ overheadRate: number
+ requiredAbilityId: string | null
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ active?: boolean
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ customFields?: Json | null
+ defaultStandardFactor?: Database["public"]["Enums"]["factor"]
+ departmentId?: string | null
+ description?: string | null
+ id?: string
+ laborRate?: number
+ locationId?: string | null
+ machineRate?: number
+ name: string
+ overheadRate?: number
+ requiredAbilityId?: string | null
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ active?: boolean
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ customFields?: Json | null
+ defaultStandardFactor?: Database["public"]["Enums"]["factor"]
+ departmentId?: string | null
+ description?: string | null
+ id?: string
+ laborRate?: number
+ locationId?: string | null
+ machineRate?: number
+ name?: string
+ overheadRate?: number
+ requiredAbilityId?: string | null
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "workCenter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "workCenter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "workCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "workCenter_departmentId_fkey"
+ columns: ["departmentId"]
+ isOneToOne: false
+ referencedRelation: "department"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_requiredAbilityId_fkey"
+ columns: ["requiredAbilityId"]
+ isOneToOne: false
+ referencedRelation: "ability"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ workCenterProcess: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ processId: string
+ updatedAt: string | null
+ updatedBy: string | null
+ workCenterId: string
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ processId: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ workCenterId: string
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ processId?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ workCenterId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "workCenterProcess_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterProcess_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterProcess_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "workCenterProcess_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "workCenterProcess_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterProcess_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterProcess_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterProcess_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterProcess_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "workCenterProcess_processId_fkey"
+ columns: ["processId"]
+ isOneToOne: false
+ referencedRelation: "process"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterProcess_processId_fkey"
+ columns: ["processId"]
+ isOneToOne: false
+ referencedRelation: "processes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterProcess_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterProcess_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterProcess_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterProcess_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterProcess_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "workCenterProcess_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "riskRegisters"
+ referencedColumns: ["workCenterId"]
+ },
+ {
+ foreignKeyName: "workCenterProcess_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenter"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterProcess_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenters"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterProcess_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ workCenterReplacementPart: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ itemId: string
+ quantity: number
+ unitOfMeasureCode: string
+ updatedAt: string | null
+ updatedBy: string | null
+ workCenterId: string
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ itemId: string
+ quantity: number
+ unitOfMeasureCode: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ workCenterId: string
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ itemId?: string
+ quantity?: number
+ unitOfMeasureCode?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ workCenterId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "workCenterReplacementPart_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "riskRegisters"
+ referencedColumns: ["workCenterId"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenter"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenters"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ }
+ Views: {
+ accounts: {
+ Row: {
+ accountType: Database["public"]["Enums"]["accountType"] | null
+ active: boolean | null
+ class: Database["public"]["Enums"]["glAccountClass"] | null
+ companyGroupId: string | null
+ consolidatedRate:
+ | Database["public"]["Enums"]["glConsolidatedRate"]
+ | null
+ createdAt: string | null
+ createdBy: string | null
+ customFields: Json | null
+ id: string | null
+ incomeBalance: Database["public"]["Enums"]["glIncomeBalance"] | null
+ isGroup: boolean | null
+ isSystem: boolean | null
+ name: string | null
+ number: string | null
+ parentId: string | null
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ accountType?: Database["public"]["Enums"]["accountType"] | null
+ active?: boolean | null
+ class?: Database["public"]["Enums"]["glAccountClass"] | null
+ companyGroupId?: string | null
+ consolidatedRate?:
+ | Database["public"]["Enums"]["glConsolidatedRate"]
+ | null
+ createdAt?: string | null
+ createdBy?: string | null
+ customFields?: Json | null
+ id?: string | null
+ incomeBalance?: Database["public"]["Enums"]["glIncomeBalance"] | null
+ isGroup?: boolean | null
+ isSystem?: boolean | null
+ name?: string | null
+ number?: string | null
+ parentId?: string | null
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ accountType?: Database["public"]["Enums"]["accountType"] | null
+ active?: boolean | null
+ class?: Database["public"]["Enums"]["glAccountClass"] | null
+ companyGroupId?: string | null
+ consolidatedRate?:
+ | Database["public"]["Enums"]["glConsolidatedRate"]
+ | null
+ createdAt?: string | null
+ createdBy?: string | null
+ customFields?: Json | null
+ id?: string | null
+ incomeBalance?: Database["public"]["Enums"]["glIncomeBalance"] | null
+ isGroup?: boolean | null
+ isSystem?: boolean | null
+ name?: string | null
+ number?: string | null
+ parentId?: string | null
+ tags?: string[] | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "account_companyGroupId_fkey"
+ columns: ["companyGroupId"]
+ isOneToOne: false
+ referencedRelation: "companyGroup"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "account_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "account_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "account_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "account_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "account_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "account_parentId_fkey"
+ columns: ["parentId"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "account_parentId_fkey"
+ columns: ["parentId"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "account_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "account_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "account_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "account_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "account_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ activeMaintenanceDispatchesByLocation: {
+ Row: {
+ actualEndTime: string | null
+ actualFailureModeId: string | null
+ actualFailureModeName: string | null
+ actualStartTime: string | null
+ assignee: string | null
+ assigneeAvatarUrl: string | null
+ assigneeName: string | null
+ companyId: string | null
+ completedAt: string | null
+ content: Json | null
+ createdAt: string | null
+ createdBy: string | null
+ duration: number | null
+ id: string | null
+ locationId: string | null
+ locationName: string | null
+ maintenanceDispatchId: string | null
+ maintenanceScheduleId: string | null
+ nonConformanceId: string | null
+ oeeImpact: Database["public"]["Enums"]["oeeImpact"] | null
+ plannedEndTime: string | null
+ plannedStartTime: string | null
+ priority:
+ | Database["public"]["Enums"]["maintenanceDispatchPriority"]
+ | null
+ severity: Database["public"]["Enums"]["maintenanceSeverity"] | null
+ source: Database["public"]["Enums"]["maintenanceSource"] | null
+ status:
+ | Database["public"]["Enums"]["maintenanceDispatchStatus"]
+ | null
+ suspectedFailureModeId: string | null
+ suspectedFailureModeName: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ workCenterId: string | null
+ workCenterName: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "maintenanceDispatch_actualFailureModeId_fkey"
+ columns: ["actualFailureModeId"]
+ isOneToOne: false
+ referencedRelation: "maintenanceFailureMode"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_maintenanceScheduleId_fkey"
+ columns: ["maintenanceScheduleId"]
+ isOneToOne: false
+ referencedRelation: "maintenanceSchedule"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_maintenanceScheduleId_fkey"
+ columns: ["maintenanceScheduleId"]
+ isOneToOne: false
+ referencedRelation: "maintenanceSchedules"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "issues"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "nonConformance"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_suspectedFailureModeId_fkey"
+ columns: ["suspectedFailureModeId"]
+ isOneToOne: false
+ referencedRelation: "maintenanceFailureMode"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "riskRegisters"
+ referencedColumns: ["workCenterId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenter"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenters"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ activeMakeMethods: {
+ Row: {
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ customFields: Json | null
+ id: string | null
+ itemId: string | null
+ rn: number | null
+ status: Database["public"]["Enums"]["makeMethodStatus"] | null
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ version: number | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "method_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "method_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "method_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "method_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "method_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "method_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "method_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "method_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "method_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "method_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "method_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "method_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "method_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "method_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "method_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ approvalRequests: {
+ Row: {
+ companyId: string | null
+ createdAt: string | null
+ decisionAt: string | null
+ decisionBy: string | null
+ decisionNotes: string | null
+ documentDescription: string | null
+ documentId: string | null
+ documentReadableId: string | null
+ documentType:
+ | Database["public"]["Enums"]["approvalDocumentType"]
+ | null
+ id: string | null
+ requestedAt: string | null
+ requestedBy: string | null
+ status: Database["public"]["Enums"]["approvalStatus"] | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "approvalRequest_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRequest_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRequest_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "approvalRequest_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "approvalRequest_decisionBy_fkey"
+ columns: ["decisionBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRequest_decisionBy_fkey"
+ columns: ["decisionBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRequest_decisionBy_fkey"
+ columns: ["decisionBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRequest_decisionBy_fkey"
+ columns: ["decisionBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRequest_decisionBy_fkey"
+ columns: ["decisionBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "approvalRequest_requestedBy_fkey"
+ columns: ["requestedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRequest_requestedBy_fkey"
+ columns: ["requestedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRequest_requestedBy_fkey"
+ columns: ["requestedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRequest_requestedBy_fkey"
+ columns: ["requestedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "approvalRequest_requestedBy_fkey"
+ columns: ["requestedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ companies: {
+ Row: {
+ active: boolean | null
+ addressLine1: string | null
+ addressLine2: string | null
+ auditLogEnabled: boolean | null
+ baseCurrencyCode: string | null
+ city: string | null
+ companyGroupId: string | null
+ companyGroupName: string | null
+ companyId: string | null
+ countryCode: string | null
+ createdAt: string | null
+ email: string | null
+ employeeType: string | null
+ eori: string | null
+ fax: string | null
+ id: string | null
+ isEliminationEntity: boolean | null
+ logoDark: string | null
+ logoDarkIcon: string | null
+ logoLight: string | null
+ logoLightIcon: string | null
+ logoWatermark: string | null
+ name: string | null
+ ownerId: string | null
+ parentCompanyId: string | null
+ phone: string | null
+ postalCode: string | null
+ role: Database["public"]["Enums"]["role"] | null
+ slackChannel: string | null
+ stateProvince: string | null
+ suggestionNotificationGroup: string[] | null
+ taxId: string | null
+ updatedBy: string | null
+ userId: string | null
+ vatNumber: string | null
+ website: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "accountDefault_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "accountDefault_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "company_baseCurrencyCode_fkey"
+ columns: ["baseCurrencyCode"]
+ isOneToOne: false
+ referencedRelation: "currencyCode"
+ referencedColumns: ["code"]
+ },
+ {
+ foreignKeyName: "company_companyGroupId_fkey"
+ columns: ["companyGroupId"]
+ isOneToOne: false
+ referencedRelation: "companyGroup"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "company_parentCompanyId_fkey"
+ columns: ["parentCompanyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "company_parentCompanyId_fkey"
+ columns: ["parentCompanyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "company_parentCompanyId_fkey"
+ columns: ["parentCompanyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "company_parentCompanyId_fkey"
+ columns: ["parentCompanyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "companyGroup_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "companyGroup_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "companyGroup_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "companyGroup_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "companyGroup_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "userToCompany_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userToCompany_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userToCompany_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "userToCompany_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "userToCompany_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userToCompany_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userToCompany_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userToCompany_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "userToCompany_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ consumables: {
+ Row: {
+ active: boolean | null
+ assignee: string | null
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ customFields: Json | null
+ defaultMethodType: Database["public"]["Enums"]["methodType"] | null
+ description: string | null
+ externalId: Json | null
+ id: string | null
+ itemPostingGroupId: string | null
+ itemTrackingType:
+ | Database["public"]["Enums"]["itemTrackingType"]
+ | null
+ modelName: string | null
+ modelPath: string | null
+ modelSize: number | null
+ modelUploadId: string | null
+ name: string | null
+ notes: Json | null
+ readableId: string | null
+ readableIdWithRevision: string | null
+ replenishmentSystem:
+ | Database["public"]["Enums"]["itemReplenishmentSystem"]
+ | null
+ revision: string | null
+ revisions: Json | null
+ supplierIds: string | null
+ tags: string[] | null
+ thumbnailPath: string | null
+ unitOfMeasure: string | null
+ unitOfMeasureCode: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "item_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "item_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "item_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "item_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "item_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "item_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "modelUpload"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "salesRfqLines"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "item_unitOfMeasureCode_fkey"
+ columns: ["unitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "item_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "itemCost_itemPostingGroupId_fkey"
+ columns: ["itemPostingGroupId"]
+ isOneToOne: false
+ referencedRelation: "itemPostingGroup"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ contractors: {
+ Row: {
+ abilityIds: string[] | null
+ active: boolean | null
+ companyId: string | null
+ customFields: Json | null
+ email: string | null
+ firstName: string | null
+ fullName: string | null
+ hoursPerWeek: number | null
+ lastName: string | null
+ supplierContactId: string | null
+ supplierId: string | null
+ supplierName: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "contractor_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "contractor_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "contractor_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "contractor_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "contractor_id_fkey"
+ columns: ["supplierContactId"]
+ isOneToOne: true
+ referencedRelation: "supplierContact"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ currencies: {
+ Row: {
+ active: boolean | null
+ code: string | null
+ companyGroupId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ customFields: Json | null
+ decimalPlaces: number | null
+ exchangeRate: number | null
+ id: string | null
+ name: string | null
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "currency_companyGroupId_fkey"
+ columns: ["companyGroupId"]
+ isOneToOne: false
+ referencedRelation: "companyGroup"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "currency_currencyCode_fkey"
+ columns: ["code"]
+ isOneToOne: false
+ referencedRelation: "currencyCode"
+ referencedColumns: ["code"]
+ },
+ {
+ foreignKeyName: "currency_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "currency_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "currency_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "currency_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "currency_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ customers: {
+ Row: {
+ accountManagerId: string | null
+ assignee: string | null
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ currencyCode: string | null
+ customerStatusId: string | null
+ customerTypeId: string | null
+ customFields: Json | null
+ defaultCc: string[] | null
+ eori: string | null
+ externalId: Json | null
+ fax: string | null
+ id: string | null
+ logo: string | null
+ name: string | null
+ orderCount: number | null
+ phone: string | null
+ readableId: string | null
+ salesContactId: string | null
+ status: string | null
+ tags: string[] | null
+ taxId: string | null
+ taxPercent: number | null
+ type: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ vatNumber: string | null
+ website: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "customer_accountManagerId_fkey"
+ columns: ["accountManagerId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_accountManagerId_fkey"
+ columns: ["accountManagerId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_accountManagerId_fkey"
+ columns: ["accountManagerId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_accountManagerId_fkey"
+ columns: ["accountManagerId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_accountManagerId_fkey"
+ columns: ["accountManagerId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "customer_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "customer_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customer_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customer_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "customer_currencyCode_fkey"
+ columns: ["currencyCode"]
+ isOneToOne: false
+ referencedRelation: "currencyCode"
+ referencedColumns: ["code"]
+ },
+ {
+ foreignKeyName: "customer_customerStatusId_fkey"
+ columns: ["customerStatusId"]
+ isOneToOne: false
+ referencedRelation: "customerStatus"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_customerTypeId_fkey"
+ columns: ["customerTypeId"]
+ isOneToOne: false
+ referencedRelation: "customerType"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_salesContactId_fkey"
+ columns: ["salesContactId"]
+ isOneToOne: false
+ referencedRelation: "customerContact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ customFieldTables: {
+ Row: {
+ companyId: string | null
+ fields: Json | null
+ module: Database["public"]["Enums"]["module"] | null
+ name: string | null
+ table: string | null
+ }
+ Relationships: []
+ }
+ dimensionValues: {
+ Row: {
+ companyGroupId: string | null
+ dimensionId: string | null
+ dimensionName: string | null
+ entityType: Database["public"]["Enums"]["dimensionEntityType"] | null
+ valueId: string | null
+ valueName: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "dimension_companyGroupId_fkey"
+ columns: ["companyGroupId"]
+ isOneToOne: false
+ referencedRelation: "companyGroup"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ documentExtensions: {
+ Row: {
+ extension: string | null
+ }
+ Relationships: []
+ }
+ documentLabels: {
+ Row: {
+ label: string | null
+ userId: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "documentLabels_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "documentLabels_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "documentLabels_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "documentLabels_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "documentLabels_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ documents: {
+ Row: {
+ active: boolean | null
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ description: string | null
+ extension: string | null
+ favorite: boolean | null
+ id: string | null
+ labels: string[] | null
+ lastActivityAt: string | null
+ name: string | null
+ path: string | null
+ readGroups: string[] | null
+ size: number | null
+ sourceDocument:
+ | Database["public"]["Enums"]["documentSourceType"]
+ | null
+ sourceDocumentId: string | null
+ type: Database["public"]["Enums"]["documentType"] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ writeGroups: string[] | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "document_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "document_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "document_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "document_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "document_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "document_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "document_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "document_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "document_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "document_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ employees: {
+ Row: {
+ active: boolean | null
+ avatarUrl: string | null
+ companyId: string | null
+ email: string | null
+ employeeTypeId: string | null
+ firstName: string | null
+ id: string | null
+ lastName: string | null
+ locationId: string | null
+ locationName: string | null
+ name: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "employee_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employee_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employee_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "employee_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "employee_employeeTypeId_fkey"
+ columns: ["employeeTypeId"]
+ isOneToOne: false
+ referencedRelation: "employeeType"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeJob_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ employeesAcrossCompanies: {
+ Row: {
+ active: boolean | null
+ avatarUrl: string | null
+ companyId: string[] | null
+ email: string | null
+ firstName: string | null
+ id: string | null
+ lastName: string | null
+ name: string | null
+ }
+ Relationships: []
+ }
+ employeeSummary: {
+ Row: {
+ avatarUrl: string | null
+ companyId: string | null
+ departmentName: string | null
+ id: string | null
+ locationName: string | null
+ managerName: string | null
+ name: string | null
+ startDate: string | null
+ title: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "employee_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employee_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employee_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "employee_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ ]
+ }
+ eventSystemTrigger: {
+ Row: {
+ attachedFunctions: string | null
+ status: string | null
+ systemTriggerName: unknown
+ tableName: string | null
+ type: string | null
+ }
+ Insert: {
+ attachedFunctions?: never
+ status?: never
+ systemTriggerName?: unknown
+ tableName?: never
+ type?: never
+ }
+ Update: {
+ attachedFunctions?: never
+ status?: never
+ systemTriggerName?: unknown
+ tableName?: never
+ type?: never
+ }
+ Relationships: []
+ }
+ gaugeCalibrationRecords: {
+ Row: {
+ approvedBy: string | null
+ calibrationAttempts: Json | null
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ customFields: Json | null
+ dateCalibrated: string | null
+ description: string | null
+ gaugeId: string | null
+ gaugeReadableId: string | null
+ gaugeTypeId: string | null
+ humidity: number | null
+ id: string | null
+ inspectionStatus:
+ | Database["public"]["Enums"]["inspectionStatus"]
+ | null
+ measurementStandard: string | null
+ notes: Json | null
+ requiresAction: boolean | null
+ requiresAdjustment: boolean | null
+ requiresRepair: boolean | null
+ supplierId: string | null
+ temperature: number | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "gauge_gaugeTypeId_fkey"
+ columns: ["gaugeTypeId"]
+ isOneToOne: false
+ referencedRelation: "gaugeType"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_approvedBy_fkey"
+ columns: ["approvedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_gaugeId_fkey"
+ columns: ["gaugeId"]
+ isOneToOne: false
+ referencedRelation: "gauge"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_gaugeId_fkey"
+ columns: ["gaugeId"]
+ isOneToOne: false
+ referencedRelation: "gauges"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gaugeCalibrationRecord_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ gauges: {
+ Row: {
+ calibrationIntervalInMonths: number | null
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ customFields: Json | null
+ dateAcquired: string | null
+ description: string | null
+ gaugeCalibrationStatus:
+ | Database["public"]["Enums"]["gaugeCalibrationStatus"]
+ | null
+ gaugeCalibrationStatusWithDueDate:
+ | Database["public"]["Enums"]["gaugeCalibrationStatus"]
+ | null
+ gaugeId: string | null
+ gaugeRole: Database["public"]["Enums"]["gaugeRole"] | null
+ gaugeStatus: Database["public"]["Enums"]["gaugeStatus"] | null
+ gaugeTypeId: string | null
+ id: string | null
+ lastCalibrationDate: string | null
+ lastCalibrationStatus:
+ | Database["public"]["Enums"]["gaugeCalibrationStatus"]
+ | null
+ locationId: string | null
+ modelNumber: string | null
+ nextCalibrationDate: string | null
+ serialNumber: string | null
+ storageUnitId: string | null
+ supplierId: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ calibrationIntervalInMonths?: number | null
+ companyId?: string | null
+ createdAt?: string | null
+ createdBy?: string | null
+ customFields?: Json | null
+ dateAcquired?: string | null
+ description?: string | null
+ gaugeCalibrationStatus?:
+ | Database["public"]["Enums"]["gaugeCalibrationStatus"]
+ | null
+ gaugeCalibrationStatusWithDueDate?: never
+ gaugeId?: string | null
+ gaugeRole?: Database["public"]["Enums"]["gaugeRole"] | null
+ gaugeStatus?: Database["public"]["Enums"]["gaugeStatus"] | null
+ gaugeTypeId?: string | null
+ id?: string | null
+ lastCalibrationDate?: string | null
+ lastCalibrationStatus?:
+ | Database["public"]["Enums"]["gaugeCalibrationStatus"]
+ | null
+ locationId?: string | null
+ modelNumber?: string | null
+ nextCalibrationDate?: string | null
+ serialNumber?: string | null
+ storageUnitId?: string | null
+ supplierId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ calibrationIntervalInMonths?: number | null
+ companyId?: string | null
+ createdAt?: string | null
+ createdBy?: string | null
+ customFields?: Json | null
+ dateAcquired?: string | null
+ description?: string | null
+ gaugeCalibrationStatus?:
+ | Database["public"]["Enums"]["gaugeCalibrationStatus"]
+ | null
+ gaugeCalibrationStatusWithDueDate?: never
+ gaugeId?: string | null
+ gaugeRole?: Database["public"]["Enums"]["gaugeRole"] | null
+ gaugeStatus?: Database["public"]["Enums"]["gaugeStatus"] | null
+ gaugeTypeId?: string | null
+ id?: string | null
+ lastCalibrationDate?: string | null
+ lastCalibrationStatus?:
+ | Database["public"]["Enums"]["gaugeCalibrationStatus"]
+ | null
+ locationId?: string | null
+ modelNumber?: string | null
+ nextCalibrationDate?: string | null
+ serialNumber?: string | null
+ storageUnitId?: string | null
+ supplierId?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "gauge_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gauge_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gauge_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "gauge_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "gauge_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gauge_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gauge_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gauge_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gauge_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "gauge_gaugeTypeId_fkey"
+ columns: ["gaugeTypeId"]
+ isOneToOne: false
+ referencedRelation: "gaugeType"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gauge_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gauge_storageUnitId_fkey"
+ columns: ["storageUnitId"]
+ isOneToOne: false
+ referencedRelation: "storageUnit"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gauge_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "gauge_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "gauge_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gauge_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gauge_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gauge_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gauge_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gauge_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gauge_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "gauge_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ groupMembers: {
+ Row: {
+ companyId: string | null
+ groupId: string | null
+ id: number | null
+ isCustomerOrgGroup: boolean | null
+ isCustomerTypeGroup: boolean | null
+ isEmployeeTypeGroup: boolean | null
+ isIdentityGroup: boolean | null
+ isSupplierOrgGroup: boolean | null
+ isSupplierTypeGroup: boolean | null
+ memberGroupId: string | null
+ memberUserId: string | null
+ name: string | null
+ user: Json | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "group_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "group_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "group_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "group_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "membership_groupId_fkey"
+ columns: ["groupId"]
+ isOneToOne: false
+ referencedRelation: "group"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "membership_memberGroupId_fkey"
+ columns: ["memberGroupId"]
+ isOneToOne: false
+ referencedRelation: "group"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "membership_memberUserId_fkey"
+ columns: ["memberUserId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "membership_memberUserId_fkey"
+ columns: ["memberUserId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "membership_memberUserId_fkey"
+ columns: ["memberUserId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "membership_memberUserId_fkey"
+ columns: ["memberUserId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "membership_memberUserId_fkey"
+ columns: ["memberUserId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ groups: {
+ Row: {
+ companyId: string | null
+ id: string | null
+ isCustomerOrgGroup: boolean | null
+ isCustomerTypeGroup: boolean | null
+ isEmployeeTypeGroup: boolean | null
+ isSupplierOrgGroup: boolean | null
+ isSupplierTypeGroup: boolean | null
+ name: string | null
+ parentId: string | null
+ users: Json | null
+ }
+ Relationships: []
+ }
+ groups_recursive: {
+ Row: {
+ companyId: string | null
+ groupId: string | null
+ isCustomerOrgGroup: boolean | null
+ isCustomerTypeGroup: boolean | null
+ isEmployeeTypeGroup: boolean | null
+ isIdentityGroup: boolean | null
+ isSupplierOrgGroup: boolean | null
+ isSupplierTypeGroup: boolean | null
+ name: string | null
+ parentId: string | null
+ user: Json | null
+ }
+ Relationships: []
+ }
+ holidayYears: {
+ Row: {
+ companyId: string | null
+ year: number | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "holiday_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "holiday_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "holiday_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "holiday_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ ]
+ }
+ inspectionDocuments: {
+ Row: {
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ defaultPageHeight: number | null
+ defaultPageWidth: number | null
+ drawingNumber: string | null
+ fileName: string | null
+ id: string | null
+ pageCount: number | null
+ partId: string | null
+ partReadableId: string | null
+ storagePath: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ uploadedBy: string | null
+ version: number | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "inspectionDocument_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_uploadedBy_fkey"
+ columns: ["uploadedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_uploadedBy_fkey"
+ columns: ["uploadedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_uploadedBy_fkey"
+ columns: ["uploadedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_uploadedBy_fkey"
+ columns: ["uploadedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_uploadedBy_fkey"
+ columns: ["uploadedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ integrations: {
+ Row: {
+ active: boolean | null
+ companyId: string | null
+ id: string | null
+ jsonschema: Json | null
+ metadata: Json | null
+ }
+ Relationships: []
+ }
+ issues: {
+ Row: {
+ approvalRequirements:
+ | Database["public"]["Enums"]["nonConformanceApproval"][]
+ | null
+ assignee: string | null
+ closeDate: string | null
+ companyId: string | null
+ containmentStatus: string | null
+ content: Json | null
+ createdAt: string | null
+ createdBy: string | null
+ customFields: Json | null
+ description: string | null
+ dueDate: string | null
+ id: string | null
+ items: string[] | null
+ locationId: string | null
+ name: string | null
+ nonConformanceId: string | null
+ nonConformanceTypeId: string | null
+ nonConformanceWorkflowId: string | null
+ openDate: string | null
+ priority: Database["public"]["Enums"]["nonConformancePriority"] | null
+ quantity: number | null
+ requiredActionIds: string[] | null
+ source: Database["public"]["Enums"]["nonConformanceSource"] | null
+ status: Database["public"]["Enums"]["nonConformanceStatus"] | null
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "nonConformance_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "nonConformance_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformance_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformance_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "nonConformance_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_nonConformanceTypeId_fkey"
+ columns: ["nonConformanceTypeId"]
+ isOneToOne: false
+ referencedRelation: "nonConformanceType"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_nonConformanceWorkflowId_fkey"
+ columns: ["nonConformanceWorkflowId"]
+ isOneToOne: false
+ referencedRelation: "nonConformanceWorkflow"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformance_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ itemStockQuantities: {
+ Row: {
+ companyId: string | null
+ itemId: string | null
+ locationId: string | null
+ quantityOnHand: number | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "itemLedger_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemLedger_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemLedger_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemLedger_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemLedger_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "itemLedger_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "partLeger_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "partLeger_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "partLeger_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "partLeger_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ ]
+ }
+ jobMaterialWithMakeMethodId: {
+ Row: {
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ customFields: Json | null
+ defaultStorageUnit: boolean | null
+ description: string | null
+ estimatedQuantity: number | null
+ id: string | null
+ itemId: string | null
+ itemReadableId: string | null
+ itemReadableIdWithoutRevision: string | null
+ itemScrapPercentage: number | null
+ itemType: string | null
+ jobId: string | null
+ jobMakeMethodId: string | null
+ jobMaterialMakeMethodId: string | null
+ jobOperationId: string | null
+ kit: boolean | null
+ methodType: Database["public"]["Enums"]["methodType"] | null
+ order: number | null
+ quantity: number | null
+ quantityIssued: number | null
+ quantityToIssue: number | null
+ requiresBatchTracking: boolean | null
+ requiresSerialTracking: boolean | null
+ scrapQuantity: number | null
+ storageUnitId: string | null
+ storageUnitName: string | null
+ unitCost: number | null
+ unitOfMeasureCode: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ version: number | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "jobMaterial_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "jobMaterial_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "jobMaterial_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "jobMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "job"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "openProductionOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_jobMakeMethodId_fkey"
+ columns: ["jobMakeMethodId"]
+ isOneToOne: false
+ referencedRelation: "jobMakeMethod"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_jobMakeMethodId_fkey"
+ columns: ["jobMakeMethodId"]
+ isOneToOne: false
+ referencedRelation: "jobMaterialWithMakeMethodId"
+ referencedColumns: ["jobMaterialMakeMethodId"]
+ },
+ {
+ foreignKeyName: "jobMaterial_jobMakeMethodId_fkey"
+ columns: ["jobMakeMethodId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["jobMakeMethodId"]
+ },
+ {
+ foreignKeyName: "jobMaterial_jobOperationId_fkey"
+ columns: ["jobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_jobOperationId_fkey"
+ columns: ["jobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithDependencies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_jobOperationId_fkey"
+ columns: ["jobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithMakeMethods"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_storageUnitId_fkey"
+ columns: ["storageUnitId"]
+ isOneToOne: false
+ referencedRelation: "storageUnit"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_unitOfMeasureCode_fkey"
+ columns: ["unitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "jobMaterial_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ jobOperationsWithDependencies: {
+ Row: {
+ assignee: string | null
+ companyId: string | null
+ conflictReason: string | null
+ createdAt: string | null
+ createdBy: string | null
+ customFields: Json | null
+ dependencies: string[] | null
+ description: string | null
+ dueDate: string | null
+ hasConflict: boolean | null
+ id: string | null
+ jobId: string | null
+ jobMakeMethodId: string | null
+ laborRate: number | null
+ laborTime: number | null
+ laborUnit: Database["public"]["Enums"]["factor"] | null
+ machineRate: number | null
+ machineTime: number | null
+ machineUnit: Database["public"]["Enums"]["factor"] | null
+ manuallyScheduled: boolean | null
+ operationLeadTime: number | null
+ operationMinimumCost: number | null
+ operationOrder:
+ | Database["public"]["Enums"]["methodOperationOrder"]
+ | null
+ operationQuantity: number | null
+ operationSupplierProcessId: string | null
+ operationType: Database["public"]["Enums"]["operationType"] | null
+ operationUnitCost: number | null
+ order: number | null
+ overheadRate: number | null
+ priority: number | null
+ procedureId: string | null
+ processId: string | null
+ quantityComplete: number | null
+ quantityReworked: number | null
+ quantityScrapped: number | null
+ reworkId: string | null
+ setupTime: number | null
+ setupUnit: Database["public"]["Enums"]["factor"] | null
+ startDate: string | null
+ status: Database["public"]["Enums"]["jobOperationStatus"] | null
+ tags: string[] | null
+ targetQuantity: number | null
+ updatedAt: string | null
+ updatedBy: string | null
+ workCenterId: string | null
+ workInstruction: Json | null
+ }
+ Insert: {
+ assignee?: string | null
+ companyId?: string | null
+ conflictReason?: string | null
+ createdAt?: string | null
+ createdBy?: string | null
+ customFields?: Json | null
+ dependencies?: never
+ description?: string | null
+ dueDate?: string | null
+ hasConflict?: boolean | null
+ id?: string | null
+ jobId?: string | null
+ jobMakeMethodId?: string | null
+ laborRate?: number | null
+ laborTime?: number | null
+ laborUnit?: Database["public"]["Enums"]["factor"] | null
+ machineRate?: number | null
+ machineTime?: number | null
+ machineUnit?: Database["public"]["Enums"]["factor"] | null
+ manuallyScheduled?: boolean | null
+ operationLeadTime?: number | null
+ operationMinimumCost?: number | null
+ operationOrder?:
+ | Database["public"]["Enums"]["methodOperationOrder"]
+ | null
+ operationQuantity?: number | null
+ operationSupplierProcessId?: string | null
+ operationType?: Database["public"]["Enums"]["operationType"] | null
+ operationUnitCost?: number | null
+ order?: number | null
+ overheadRate?: number | null
+ priority?: number | null
+ procedureId?: string | null
+ processId?: string | null
+ quantityComplete?: number | null
+ quantityReworked?: number | null
+ quantityScrapped?: number | null
+ reworkId?: string | null
+ setupTime?: number | null
+ setupUnit?: Database["public"]["Enums"]["factor"] | null
+ startDate?: string | null
+ status?: Database["public"]["Enums"]["jobOperationStatus"] | null
+ tags?: string[] | null
+ targetQuantity?: number | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ workCenterId?: string | null
+ workInstruction?: Json | null
+ }
+ Update: {
+ assignee?: string | null
+ companyId?: string | null
+ conflictReason?: string | null
+ createdAt?: string | null
+ createdBy?: string | null
+ customFields?: Json | null
+ dependencies?: never
+ description?: string | null
+ dueDate?: string | null
+ hasConflict?: boolean | null
+ id?: string | null
+ jobId?: string | null
+ jobMakeMethodId?: string | null
+ laborRate?: number | null
+ laborTime?: number | null
+ laborUnit?: Database["public"]["Enums"]["factor"] | null
+ machineRate?: number | null
+ machineTime?: number | null
+ machineUnit?: Database["public"]["Enums"]["factor"] | null
+ manuallyScheduled?: boolean | null
+ operationLeadTime?: number | null
+ operationMinimumCost?: number | null
+ operationOrder?:
+ | Database["public"]["Enums"]["methodOperationOrder"]
+ | null
+ operationQuantity?: number | null
+ operationSupplierProcessId?: string | null
+ operationType?: Database["public"]["Enums"]["operationType"] | null
+ operationUnitCost?: number | null
+ order?: number | null
+ overheadRate?: number | null
+ priority?: number | null
+ procedureId?: string | null
+ processId?: string | null
+ quantityComplete?: number | null
+ quantityReworked?: number | null
+ quantityScrapped?: number | null
+ reworkId?: string | null
+ setupTime?: number | null
+ setupUnit?: Database["public"]["Enums"]["factor"] | null
+ startDate?: string | null
+ status?: Database["public"]["Enums"]["jobOperationStatus"] | null
+ tags?: string[] | null
+ targetQuantity?: number | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ workCenterId?: string | null
+ workInstruction?: Json | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "jobOperation_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "jobOperation_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "jobOperation_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "jobOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "jobOperation_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "job"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "openProductionOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_jobMakeMethodId_fkey"
+ columns: ["jobMakeMethodId"]
+ isOneToOne: false
+ referencedRelation: "jobMakeMethod"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_jobMakeMethodId_fkey"
+ columns: ["jobMakeMethodId"]
+ isOneToOne: false
+ referencedRelation: "jobMaterialWithMakeMethodId"
+ referencedColumns: ["jobMaterialMakeMethodId"]
+ },
+ {
+ foreignKeyName: "jobOperation_jobMakeMethodId_fkey"
+ columns: ["jobMakeMethodId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["jobMakeMethodId"]
+ },
+ {
+ foreignKeyName: "jobOperation_procedureId_fkey"
+ columns: ["procedureId"]
+ isOneToOne: false
+ referencedRelation: "procedure"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_procedureId_fkey"
+ columns: ["procedureId"]
+ isOneToOne: false
+ referencedRelation: "procedures"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_processId_fkey"
+ columns: ["processId"]
+ isOneToOne: false
+ referencedRelation: "process"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_processId_fkey"
+ columns: ["processId"]
+ isOneToOne: false
+ referencedRelation: "processes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_reworkId_fkey"
+ columns: ["reworkId"]
+ isOneToOne: false
+ referencedRelation: "rework"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "jobOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "riskRegisters"
+ referencedColumns: ["workCenterId"]
+ },
+ {
+ foreignKeyName: "jobOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenter"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenters"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ jobOperationsWithMakeMethods: {
+ Row: {
+ assignee: string | null
+ companyId: string | null
+ conflictReason: string | null
+ createdAt: string | null
+ createdBy: string | null
+ customFields: Json | null
+ description: string | null
+ dueDate: string | null
+ hasConflict: boolean | null
+ id: string | null
+ jobId: string | null
+ jobMakeMethodId: string | null
+ laborRate: number | null
+ laborTime: number | null
+ laborUnit: Database["public"]["Enums"]["factor"] | null
+ machineRate: number | null
+ machineTime: number | null
+ machineUnit: Database["public"]["Enums"]["factor"] | null
+ makeMethodId: string | null
+ manuallyScheduled: boolean | null
+ operationLeadTime: number | null
+ operationMinimumCost: number | null
+ operationOrder:
+ | Database["public"]["Enums"]["methodOperationOrder"]
+ | null
+ operationQuantity: number | null
+ operationSupplierProcessId: string | null
+ operationType: Database["public"]["Enums"]["operationType"] | null
+ operationUnitCost: number | null
+ order: number | null
+ overheadRate: number | null
+ priority: number | null
+ procedureId: string | null
+ processId: string | null
+ quantityComplete: number | null
+ quantityReworked: number | null
+ quantityScrapped: number | null
+ reworkId: string | null
+ setupTime: number | null
+ setupUnit: Database["public"]["Enums"]["factor"] | null
+ startDate: string | null
+ status: Database["public"]["Enums"]["jobOperationStatus"] | null
+ tags: string[] | null
+ targetQuantity: number | null
+ updatedAt: string | null
+ updatedBy: string | null
+ workCenterId: string | null
+ workInstruction: Json | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "jobOperation_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "jobOperation_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "jobOperation_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "jobOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "jobOperation_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "job"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "openProductionOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_jobMakeMethodId_fkey"
+ columns: ["jobMakeMethodId"]
+ isOneToOne: false
+ referencedRelation: "jobMakeMethod"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_jobMakeMethodId_fkey"
+ columns: ["jobMakeMethodId"]
+ isOneToOne: false
+ referencedRelation: "jobMaterialWithMakeMethodId"
+ referencedColumns: ["jobMaterialMakeMethodId"]
+ },
+ {
+ foreignKeyName: "jobOperation_jobMakeMethodId_fkey"
+ columns: ["jobMakeMethodId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["jobMakeMethodId"]
+ },
+ {
+ foreignKeyName: "jobOperation_procedureId_fkey"
+ columns: ["procedureId"]
+ isOneToOne: false
+ referencedRelation: "procedure"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_procedureId_fkey"
+ columns: ["procedureId"]
+ isOneToOne: false
+ referencedRelation: "procedures"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_processId_fkey"
+ columns: ["processId"]
+ isOneToOne: false
+ referencedRelation: "process"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_processId_fkey"
+ columns: ["processId"]
+ isOneToOne: false
+ referencedRelation: "processes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_reworkId_fkey"
+ columns: ["reworkId"]
+ isOneToOne: false
+ referencedRelation: "rework"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "jobOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "riskRegisters"
+ referencedColumns: ["workCenterId"]
+ },
+ {
+ foreignKeyName: "jobOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenter"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenters"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ jobs: {
+ Row: {
+ active: boolean | null
+ actualTime: number | null
+ assignee: string | null
+ autodeskUrn: string | null
+ companyId: string | null
+ completedDate: string | null
+ configuration: Json | null
+ createdAt: string | null
+ createdBy: string | null
+ customerId: string | null
+ customFields: Json | null
+ deadlineType: Database["public"]["Enums"]["deadlineType"] | null
+ description: string | null
+ dueDate: string | null
+ estimatedTime: number | null
+ id: string | null
+ itemId: string | null
+ itemReadableIdWithRevision: string | null
+ itemTrackingType:
+ | Database["public"]["Enums"]["itemTrackingType"]
+ | null
+ itemType: Database["public"]["Enums"]["itemType"] | null
+ jobId: string | null
+ jobMakeMethodId: string | null
+ locationId: string | null
+ modelId: string | null
+ modelName: string | null
+ modelPath: string | null
+ modelSize: number | null
+ modelUploadId: string | null
+ name: string | null
+ notes: Json | null
+ priority: number | null
+ productionQuantity: number | null
+ quantity: number | null
+ quantityComplete: number | null
+ quantityReceivedToInventory: number | null
+ quantityShipped: number | null
+ quoteId: string | null
+ quoteLineId: string | null
+ quoteReadableId: string | null
+ releasedDate: string | null
+ replenishmentSystem:
+ | Database["public"]["Enums"]["itemReplenishmentSystem"]
+ | null
+ salesOrderId: string | null
+ salesOrderLineId: string | null
+ salesOrderReadableId: string | null
+ scrapQuantity: number | null
+ secondsToComplete: number | null
+ startDate: string | null
+ status: Database["public"]["Enums"]["jobStatus"] | null
+ storageUnitId: string | null
+ tags: string[] | null
+ thumbnailPath: string | null
+ unitOfMeasureCode: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "job_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "job_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "job_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "job_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "job_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quote"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quoteCustomerDetails"
+ referencedColumns: ["quoteId"]
+ },
+ {
+ foreignKeyName: "job_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quotes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrder"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderLocations"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_salesOrderLineId_fkey"
+ columns: ["salesOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "openSalesOrderLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_salesOrderLineId_fkey"
+ columns: ["salesOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderLine"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_salesOrderLineId_fkey"
+ columns: ["salesOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_storageUnitId_fkey"
+ columns: ["storageUnitId"]
+ isOneToOne: false
+ referencedRelation: "storageUnit"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_unitOfMeasureCode_fkey"
+ columns: ["unitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "job_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ journalEntries: {
+ Row: {
+ accountingPeriodId: string | null
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ customFields: Json | null
+ description: string | null
+ id: string | null
+ journalEntryId: string | null
+ lineCount: number | null
+ postedAt: string | null
+ postedBy: string | null
+ postingDate: string | null
+ reversalOfId: string | null
+ reversedById: string | null
+ sourceType:
+ | Database["public"]["Enums"]["journalEntrySourceType"]
+ | null
+ status: Database["public"]["Enums"]["journalEntryStatus"] | null
+ tags: string[] | null
+ totalCredits: number | null
+ totalDebits: number | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "journal_accountPeriodId_fkey"
+ columns: ["accountingPeriodId"]
+ isOneToOne: false
+ referencedRelation: "accountingPeriod"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "journal_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "journal_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "journal_postedBy_fkey"
+ columns: ["postedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_postedBy_fkey"
+ columns: ["postedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_postedBy_fkey"
+ columns: ["postedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_postedBy_fkey"
+ columns: ["postedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_postedBy_fkey"
+ columns: ["postedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "journal_reversalOfId_fkey"
+ columns: ["reversalOfId"]
+ isOneToOne: false
+ referencedRelation: "journal"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_reversalOfId_fkey"
+ columns: ["reversalOfId"]
+ isOneToOne: false
+ referencedRelation: "journalEntries"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_reversedById_fkey"
+ columns: ["reversedById"]
+ isOneToOne: false
+ referencedRelation: "journal"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_reversedById_fkey"
+ columns: ["reversedById"]
+ isOneToOne: false
+ referencedRelation: "journalEntries"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "journal_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ kanbans: {
+ Row: {
+ autoRelease: boolean | null
+ autoStartJob: boolean | null
+ companyId: string | null
+ completedBarcodeOverride: string | null
+ conversionFactor: number | null
+ createdAt: string | null
+ createdBy: string | null
+ id: string | null
+ itemId: string | null
+ jobId: string | null
+ jobReadableId: string | null
+ locationId: string | null
+ locationName: string | null
+ name: string | null
+ purchaseUnitOfMeasureCode: string | null
+ quantity: number | null
+ readableIdWithRevision: string | null
+ replenishmentSystem:
+ | Database["public"]["Enums"]["itemReplenishmentSystem"]
+ | null
+ storageUnitId: string | null
+ storageUnitName: string | null
+ supplierId: string | null
+ supplierName: string | null
+ thumbnailPath: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "kanban_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "kanban_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "kanban_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "kanban_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "job"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "openProductionOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_purchaseUnitOfMeasureCode_fkey"
+ columns: ["purchaseUnitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "kanban_storageUnitId_fkey"
+ columns: ["storageUnitId"]
+ isOneToOne: false
+ referencedRelation: "storageUnit"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "kanban_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "kanban_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "kanban_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ maintenanceSchedules: {
+ Row: {
+ active: boolean | null
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ description: string | null
+ estimatedDuration: number | null
+ frequency: Database["public"]["Enums"]["maintenanceFrequency"] | null
+ friday: boolean | null
+ id: string | null
+ lastGeneratedAt: string | null
+ locationId: string | null
+ locationName: string | null
+ monday: boolean | null
+ name: string | null
+ nextDueAt: string | null
+ priority:
+ | Database["public"]["Enums"]["maintenanceDispatchPriority"]
+ | null
+ saturday: boolean | null
+ skipHolidays: boolean | null
+ sunday: boolean | null
+ thursday: boolean | null
+ tuesday: boolean | null
+ updatedAt: string | null
+ updatedBy: string | null
+ wednesday: boolean | null
+ workCenterId: string | null
+ workCenterName: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "maintenanceSchedule_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "riskRegisters"
+ referencedColumns: ["workCenterId"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenter"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenters"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceSchedule_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ materialDimensions: {
+ Row: {
+ companyId: string | null
+ formName: string | null
+ id: string | null
+ isMetric: boolean | null
+ materialFormId: string | null
+ name: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "materialDimensions_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialDimensions_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialDimensions_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "materialDimensions_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "materialDimensions_materialFormId_fkey"
+ columns: ["materialFormId"]
+ isOneToOne: false
+ referencedRelation: "materialForm"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ materialFinishes: {
+ Row: {
+ companyId: string | null
+ id: string | null
+ materialSubstanceId: string | null
+ name: string | null
+ substanceName: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "materialFinish_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialFinish_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialFinish_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "materialFinish_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "materialFinish_materialSubstanceId_fkey"
+ columns: ["materialSubstanceId"]
+ isOneToOne: false
+ referencedRelation: "materialSubstance"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ materialGrades: {
+ Row: {
+ companyId: string | null
+ id: string | null
+ materialSubstanceId: string | null
+ name: string | null
+ substanceName: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "materialGrade_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialGrade_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialGrade_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "materialGrade_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "materialGrade_materialSubstanceId_fkey"
+ columns: ["materialSubstanceId"]
+ isOneToOne: false
+ referencedRelation: "materialSubstance"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ materials: {
+ Row: {
+ active: boolean | null
+ assignee: string | null
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ customFields: Json | null
+ defaultMethodType: Database["public"]["Enums"]["methodType"] | null
+ description: string | null
+ dimensions: string | null
+ externalId: Json | null
+ finish: string | null
+ grade: string | null
+ id: string | null
+ itemPostingGroupId: string | null
+ itemTrackingType:
+ | Database["public"]["Enums"]["itemTrackingType"]
+ | null
+ materialForm: string | null
+ materialFormId: string | null
+ materialSubstance: string | null
+ materialSubstanceId: string | null
+ materialType: string | null
+ modelName: string | null
+ modelPath: string | null
+ modelSize: number | null
+ modelUploadId: string | null
+ name: string | null
+ notes: Json | null
+ readableId: string | null
+ readableIdWithRevision: string | null
+ replenishmentSystem:
+ | Database["public"]["Enums"]["itemReplenishmentSystem"]
+ | null
+ revision: string | null
+ revisions: Json | null
+ supplierIds: string | null
+ tags: string[] | null
+ thumbnailPath: string | null
+ unitOfMeasure: string | null
+ unitOfMeasureCode: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "item_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "item_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "item_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "item_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "item_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "item_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "modelUpload"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "salesRfqLines"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "item_unitOfMeasureCode_fkey"
+ columns: ["unitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "item_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "itemCost_itemPostingGroupId_fkey"
+ columns: ["itemPostingGroupId"]
+ isOneToOne: false
+ referencedRelation: "itemPostingGroup"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "material_materialFormId_fkey"
+ columns: ["materialFormId"]
+ isOneToOne: false
+ referencedRelation: "materialForm"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "material_materialSubstanceId_fkey"
+ columns: ["materialSubstanceId"]
+ isOneToOne: false
+ referencedRelation: "materialSubstance"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ materialTypes: {
+ Row: {
+ companyId: string | null
+ formName: string | null
+ id: string | null
+ materialFormId: string | null
+ materialSubstanceId: string | null
+ name: string | null
+ substanceName: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "materialType_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialType_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialType_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "materialType_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "materialType_materialFormId_fkey"
+ columns: ["materialFormId"]
+ isOneToOne: false
+ referencedRelation: "materialForm"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "materialType_materialSubstanceId_fkey"
+ columns: ["materialSubstanceId"]
+ isOneToOne: false
+ referencedRelation: "materialSubstance"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ modules: {
+ Row: {
+ name: Database["public"]["Enums"]["module"] | null
+ }
+ Relationships: []
+ }
+ openJobMaterialLines: {
+ Row: {
+ companyId: string | null
+ dueDate: string | null
+ id: string | null
+ itemId: string | null
+ itemTrackingType:
+ | Database["public"]["Enums"]["itemTrackingType"]
+ | null
+ jobId: string | null
+ jobMakeMethodId: string | null
+ jobReadableId: string | null
+ leadTime: number | null
+ locationId: string | null
+ parentMaterialId: string | null
+ quantityToIssue: number | null
+ replenishmentSystem:
+ | Database["public"]["Enums"]["itemReplenishmentSystem"]
+ | null
+ unitOfMeasureCode: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "job_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMakeMethod_parentMaterialId_fkey"
+ columns: ["parentMaterialId"]
+ isOneToOne: false
+ referencedRelation: "jobMaterial"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMakeMethod_parentMaterialId_fkey"
+ columns: ["parentMaterialId"]
+ isOneToOne: false
+ referencedRelation: "jobMaterialWithMakeMethodId"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMakeMethod_parentMaterialId_fkey"
+ columns: ["parentMaterialId"]
+ isOneToOne: false
+ referencedRelation: "openJobMaterialLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "jobMaterial_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "jobMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "job"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "openProductionOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_jobMakeMethodId_fkey"
+ columns: ["jobMakeMethodId"]
+ isOneToOne: false
+ referencedRelation: "jobMakeMethod"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "jobMaterial_jobMakeMethodId_fkey"
+ columns: ["jobMakeMethodId"]
+ isOneToOne: false
+ referencedRelation: "jobMaterialWithMakeMethodId"
+ referencedColumns: ["jobMaterialMakeMethodId"]
+ },
+ {
+ foreignKeyName: "jobMaterial_jobMakeMethodId_fkey"
+ columns: ["jobMakeMethodId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["jobMakeMethodId"]
+ },
+ {
+ foreignKeyName: "jobMaterial_unitOfMeasureCode_fkey"
+ columns: ["unitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ ]
+ }
+ openProductionOrders: {
+ Row: {
+ companyId: string | null
+ deadlineType: Database["public"]["Enums"]["deadlineType"] | null
+ dueDate: string | null
+ id: string | null
+ itemId: string | null
+ itemTrackingType:
+ | Database["public"]["Enums"]["itemTrackingType"]
+ | null
+ jobId: string | null
+ leadTime: number | null
+ locationId: string | null
+ quantityToReceive: number | null
+ replenishmentSystem:
+ | Database["public"]["Enums"]["itemReplenishmentSystem"]
+ | null
+ unitOfMeasureCode: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "job_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "job_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "job_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "job_unitOfMeasureCode_fkey"
+ columns: ["unitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ ]
+ }
+ openPurchaseOrderLines: {
+ Row: {
+ companyId: string | null
+ dueDate: string | null
+ id: string | null
+ itemId: string | null
+ itemTrackingType:
+ | Database["public"]["Enums"]["itemTrackingType"]
+ | null
+ leadTime: number | null
+ locationId: string | null
+ orderDate: string | null
+ promisedDate: string | null
+ purchaseOrderId: string | null
+ purchaseOrderLineType:
+ | Database["public"]["Enums"]["purchaseOrderLineType"]
+ | null
+ purchaseOrderReadableId: string | null
+ quantityToReceive: number | null
+ replenishmentSystem:
+ | Database["public"]["Enums"]["itemReplenishmentSystem"]
+ | null
+ status: Database["public"]["Enums"]["purchaseOrderStatus"] | null
+ supplierId: string | null
+ unitOfMeasureCode: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "purchaseOrder_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_purchaseOrderId_fkey"
+ columns: ["purchaseOrderId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrder"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_purchaseOrderId_fkey"
+ columns: ["purchaseOrderId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderLocations"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_purchaseOrderId_fkey"
+ columns: ["purchaseOrderId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrders"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ openSalesOrderLines: {
+ Row: {
+ companyId: string | null
+ id: string | null
+ itemId: string | null
+ itemTrackingType:
+ | Database["public"]["Enums"]["itemTrackingType"]
+ | null
+ leadTime: number | null
+ locationId: string | null
+ methodType: Database["public"]["Enums"]["methodType"] | null
+ promisedDate: string | null
+ quantityToSend: number | null
+ replenishmentSystem:
+ | Database["public"]["Enums"]["itemReplenishmentSystem"]
+ | null
+ salesOrderId: string | null
+ salesOrderLineType:
+ | Database["public"]["Enums"]["salesOrderLineType"]
+ | null
+ unitOfMeasureCode: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "salesOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrder"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderLocations"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_unitOfMeasureCode_fkey"
+ columns: ["unitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ ]
+ }
+ partners: {
+ Row: {
+ abilityId: string | null
+ abilityName: string | null
+ active: boolean | null
+ city: string | null
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ customFields: Json | null
+ hoursPerWeek: number | null
+ id: string | null
+ state: string | null
+ supplierId: string | null
+ supplierLocationId: string | null
+ supplierName: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "partner_abilityId_fkey"
+ columns: ["abilityId"]
+ isOneToOne: false
+ referencedRelation: "ability"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "partner_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "partner_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "partner_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "partner_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "partner_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "partner_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "partner_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "partner_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "partner_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "partner_id_fkey"
+ columns: ["supplierLocationId"]
+ isOneToOne: false
+ referencedRelation: "supplierLocation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "partner_id_fkey"
+ columns: ["id"]
+ isOneToOne: false
+ referencedRelation: "supplierLocation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "partner_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "partner_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "partner_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "partner_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "partner_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ parts: {
+ Row: {
+ active: boolean | null
+ assignee: string | null
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ customFields: Json | null
+ defaultMethodType: Database["public"]["Enums"]["methodType"] | null
+ description: string | null
+ externalId: Json | null
+ id: string | null
+ itemPostingGroupId: string | null
+ itemTrackingType:
+ | Database["public"]["Enums"]["itemTrackingType"]
+ | null
+ modelName: string | null
+ modelPath: string | null
+ modelSize: number | null
+ name: string | null
+ notes: Json | null
+ readableId: string | null
+ readableIdWithRevision: string | null
+ replenishmentSystem:
+ | Database["public"]["Enums"]["itemReplenishmentSystem"]
+ | null
+ revision: string | null
+ revisions: Json | null
+ supplierIds: string | null
+ tags: string[] | null
+ thumbnailPath: string | null
+ unitOfMeasure: string | null
+ unitOfMeasureCode: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "item_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "item_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "item_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "item_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "item_unitOfMeasureCode_fkey"
+ columns: ["unitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "item_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "itemCost_itemPostingGroupId_fkey"
+ columns: ["itemPostingGroupId"]
+ isOneToOne: false
+ referencedRelation: "itemPostingGroup"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ procedures: {
+ Row: {
+ assignee: string | null
+ companyId: string | null
+ id: string | null
+ name: string | null
+ processId: string | null
+ status: Database["public"]["Enums"]["procedureStatus"] | null
+ tags: string[] | null
+ version: number | null
+ versions: Json | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "procedure_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedure_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedure_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedure_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedure_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "procedure_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedure_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedure_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "procedure_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "procedure_processId_fkey"
+ columns: ["processId"]
+ isOneToOne: false
+ referencedRelation: "process"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "procedure_processId_fkey"
+ columns: ["processId"]
+ isOneToOne: false
+ referencedRelation: "processes"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ processes: {
+ Row: {
+ active: boolean | null
+ companyId: string | null
+ completeAllOnScan: boolean | null
+ createdAt: string | null
+ createdBy: string | null
+ customFields: Json | null
+ defaultStandardFactor: Database["public"]["Enums"]["factor"] | null
+ id: string | null
+ name: string | null
+ processType: Database["public"]["Enums"]["processType"] | null
+ suppliers: Json | null
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ workCenters: string[] | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "process_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "process_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "process_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "process_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "process_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "process_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "process_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "process_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "process_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "process_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "process_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "process_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "process_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "process_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ purchaseInvoiceLines: {
+ Row: {
+ accountId: string | null
+ accountName: string | null
+ assetId: string | null
+ assetName: string | null
+ assetReadableId: string | null
+ companyId: string | null
+ conversionFactor: number | null
+ costCenterId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ customFields: Json | null
+ description: string | null
+ exchangeRate: number | null
+ extendedPrice: number | null
+ id: string | null
+ internalNotes: Json | null
+ inventoryUnitOfMeasureCode: string | null
+ invoiceId: string | null
+ invoiceLineType: Database["public"]["Enums"]["payableLineType"] | null
+ itemDescription: string | null
+ itemId: string | null
+ itemName: string | null
+ itemReadableId: string | null
+ jobOperationId: string | null
+ locationId: string | null
+ modelUploadId: string | null
+ ownerId: string | null
+ purchaseOrderId: string | null
+ purchaseOrderLineId: string | null
+ purchaseUnitOfMeasureCode: string | null
+ quantity: number | null
+ requiredDate: string | null
+ serviceId: string | null
+ shippingCost: number | null
+ sortOrder: number | null
+ storageUnitId: string | null
+ supplierExtendedPrice: number | null
+ supplierPartId: string | null
+ supplierShippingCost: number | null
+ supplierTaxAmount: number | null
+ supplierUnitPrice: number | null
+ tags: string[] | null
+ taxAmount: number | null
+ taxPercent: number | null
+ thumbnailPath: string | null
+ totalAmount: number | null
+ unitCost: number | null
+ unitPrice: number | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "purchaseInvoiceLine_accountId_fkey"
+ columns: ["accountId"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLine_accountId_fkey"
+ columns: ["accountId"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLine_costCenterId_fkey"
+ columns: ["costCenterId"]
+ isOneToOne: false
+ referencedRelation: "costCenter"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLine_jobOperationId_fkey"
+ columns: ["jobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLine_jobOperationId_fkey"
+ columns: ["jobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithDependencies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLine_jobOperationId_fkey"
+ columns: ["jobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithMakeMethods"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "modelUpload"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "salesRfqLines"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLine_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLine_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLine_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLine_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLine_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLine_storageUnitId_fkey"
+ columns: ["storageUnitId"]
+ isOneToOne: false
+ referencedRelation: "storageUnit"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_inventoryUnitOfMeasureCode_fkey"
+ columns: ["inventoryUnitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_invoiceId_fkey"
+ columns: ["invoiceId"]
+ isOneToOne: false
+ referencedRelation: "purchaseInvoice"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_invoiceId_fkey"
+ columns: ["invoiceId"]
+ isOneToOne: false
+ referencedRelation: "purchaseInvoices"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_purchaseOrderId_fkey"
+ columns: ["purchaseOrderId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrder"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_purchaseOrderId_fkey"
+ columns: ["purchaseOrderId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderLocations"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_purchaseOrderId_fkey"
+ columns: ["purchaseOrderId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_purchaseOrderLineId_fkey"
+ columns: ["purchaseOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "openPurchaseOrderLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_purchaseOrderLineId_fkey"
+ columns: ["purchaseOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderLine"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_purchaseOrderLineId_fkey"
+ columns: ["purchaseOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_purchaseUnitOfMeasureCode_fkey"
+ columns: ["purchaseUnitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoiceLines_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ purchaseInvoices: {
+ Row: {
+ assignee: string | null
+ balance: number | null
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ currencyCode: string | null
+ customFields: Json | null
+ dateDue: string | null
+ dateIssued: string | null
+ datePaid: string | null
+ exchangeRate: number | null
+ exchangeRateUpdatedAt: string | null
+ id: string | null
+ internalNotes: Json | null
+ invoiceId: string | null
+ invoiceSupplierContactId: string | null
+ invoiceSupplierId: string | null
+ invoiceSupplierLocationId: string | null
+ itemType: Database["public"]["Enums"]["itemType"] | null
+ locationId: string | null
+ orderTotal: number | null
+ paymentTermId: string | null
+ paymentTermName: string | null
+ postingDate: string | null
+ status: Database["public"]["Enums"]["purchaseInvoiceStatus"] | null
+ subtotal: number | null
+ supplierId: string | null
+ supplierInteractionId: string | null
+ supplierReference: string | null
+ thumbnailPath: string | null
+ totalAmount: number | null
+ totalDiscount: number | null
+ totalTax: number | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "purchaseInvoice_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_currencyCode_fkey"
+ columns: ["currencyCode"]
+ isOneToOne: false
+ referencedRelation: "currencyCode"
+ referencedColumns: ["code"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_invoiceSupplierContactId_fkey"
+ columns: ["invoiceSupplierContactId"]
+ isOneToOne: false
+ referencedRelation: "supplierContact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_invoiceSupplierId_fkey"
+ columns: ["invoiceSupplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_invoiceSupplierId_fkey"
+ columns: ["invoiceSupplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_invoiceSupplierId_fkey"
+ columns: ["invoiceSupplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_invoiceSupplierId_fkey"
+ columns: ["invoiceSupplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_invoiceSupplierId_fkey"
+ columns: ["invoiceSupplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_invoiceSupplierLocationId_fkey"
+ columns: ["invoiceSupplierLocationId"]
+ isOneToOne: false
+ referencedRelation: "supplierLocation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_paymentTermId_fkey"
+ columns: ["paymentTermId"]
+ isOneToOne: false
+ referencedRelation: "paymentTerm"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_supplierInteractionId_fkey"
+ columns: ["supplierInteractionId"]
+ isOneToOne: false
+ referencedRelation: "supplierInteraction"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseInvoice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ purchaseOrderLines: {
+ Row: {
+ accountId: string | null
+ accountName: string | null
+ assetId: string | null
+ assetName: string | null
+ assetReadableId: string | null
+ autodeskUrn: string | null
+ companyId: string | null
+ conversionFactor: number | null
+ costCenterId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ customFields: Json | null
+ description: string | null
+ exchangeRate: number | null
+ extendedPrice: number | null
+ externalNotes: Json | null
+ id: string | null
+ internalNotes: Json | null
+ inventoryUnitOfMeasureCode: string | null
+ invoicedComplete: boolean | null
+ itemDescription: string | null
+ itemId: string | null
+ itemName: string | null
+ itemReadableId: string | null
+ jobId: string | null
+ jobOperationDescription: string | null
+ jobOperationId: string | null
+ locationId: string | null
+ modelId: string | null
+ modelName: string | null
+ modelPath: string | null
+ modelSize: number | null
+ modelUploadId: string | null
+ ownerId: string | null
+ promisedDate: string | null
+ purchaseOrderId: string | null
+ purchaseOrderLineType:
+ | Database["public"]["Enums"]["purchaseOrderLineType"]
+ | null
+ purchaseQuantity: number | null
+ purchaseUnitOfMeasureCode: string | null
+ quantityInvoiced: number | null
+ quantityReceived: number | null
+ quantityShipped: number | null
+ quantityToInvoice: number | null
+ quantityToReceive: number | null
+ receivedComplete: boolean | null
+ receivedDate: string | null
+ requiredDate: string | null
+ requiresInspection: boolean | null
+ setupPrice: number | null
+ shippingCost: number | null
+ sortOrder: number | null
+ storageUnitId: string | null
+ supplierExtendedPrice: number | null
+ supplierPartId: string | null
+ supplierPartIdFromSupplier: string | null
+ supplierShippingCost: number | null
+ supplierTaxAmount: number | null
+ supplierUnitPrice: number | null
+ tags: string[] | null
+ taxAmount: number | null
+ taxPercent: number | null
+ thumbnailPath: string | null
+ unitCost: number | null
+ unitPrice: number | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "purchaseOrderLine_accountId_fkey"
+ columns: ["accountId"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_accountId_fkey"
+ columns: ["accountId"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_assetId_fkey"
+ columns: ["assetId"]
+ isOneToOne: false
+ referencedRelation: "fixedAsset"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_costCenterId_fkey"
+ columns: ["costCenterId"]
+ isOneToOne: false
+ referencedRelation: "costCenter"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_inventoryUnitOfMeasureCode_fkey"
+ columns: ["inventoryUnitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "job"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "openProductionOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_jobOperationId_fkey"
+ columns: ["jobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_jobOperationId_fkey"
+ columns: ["jobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithDependencies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_jobOperationId_fkey"
+ columns: ["jobOperationId"]
+ isOneToOne: false
+ referencedRelation: "jobOperationsWithMakeMethods"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "modelUpload"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "salesRfqLines"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_purchaseOrderId_fkey"
+ columns: ["purchaseOrderId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrder"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_purchaseOrderId_fkey"
+ columns: ["purchaseOrderId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderLocations"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_purchaseOrderId_fkey"
+ columns: ["purchaseOrderId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_purchaseUnitOfMeasureCode_fkey"
+ columns: ["purchaseUnitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_storageUnitId_fkey"
+ columns: ["storageUnitId"]
+ isOneToOne: false
+ referencedRelation: "storageUnit"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ purchaseOrderLocations: {
+ Row: {
+ companyCountryCode: string | null
+ companyCountryName: string | null
+ customerAddressLine1: string | null
+ customerAddressLine2: string | null
+ customerCity: string | null
+ customerCountryCode: string | null
+ customerCountryName: string | null
+ customerName: string | null
+ customerPostalCode: string | null
+ customerStateProvince: string | null
+ deliveryAddressLine1: string | null
+ deliveryAddressLine2: string | null
+ deliveryCity: string | null
+ deliveryCountryCode: string | null
+ deliveryCountryName: string | null
+ deliveryName: string | null
+ deliveryPostalCode: string | null
+ deliveryStateProvince: string | null
+ dropShipment: boolean | null
+ id: string | null
+ supplierAddressLine1: string | null
+ supplierAddressLine2: string | null
+ supplierCity: string | null
+ supplierContactEmail: string | null
+ supplierContactName: string | null
+ supplierCountryCode: string | null
+ supplierCountryName: string | null
+ supplierEori: string | null
+ supplierName: string | null
+ supplierPostalCode: string | null
+ supplierStateProvince: string | null
+ supplierTaxId: string | null
+ supplierVatNumber: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "address_countryCode_fkey"
+ columns: ["supplierCountryCode"]
+ isOneToOne: false
+ referencedRelation: "country"
+ referencedColumns: ["alpha2"]
+ },
+ {
+ foreignKeyName: "address_countryCode_fkey"
+ columns: ["customerCountryCode"]
+ isOneToOne: false
+ referencedRelation: "country"
+ referencedColumns: ["alpha2"]
+ },
+ ]
+ }
+ purchaseOrders: {
+ Row: {
+ accountManagerEmail: string | null
+ accountManagerFullName: string | null
+ accountManagerPhone: string | null
+ assignee: string | null
+ assigneeEmail: string | null
+ assigneeFullName: string | null
+ assigneePhone: string | null
+ closedAt: string | null
+ closedBy: string | null
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ createdByEmail: string | null
+ createdByFullName: string | null
+ createdByPhone: string | null
+ currencyCode: string | null
+ customFields: Json | null
+ deliveryDate: string | null
+ dropShipment: boolean | null
+ exchangeRate: number | null
+ exchangeRateUpdatedAt: string | null
+ externalNotes: Json | null
+ id: string | null
+ incoterm: Database["public"]["Enums"]["incoterm"] | null
+ incotermLocation: string | null
+ internalNotes: Json | null
+ itemType: Database["public"]["Enums"]["itemType"] | null
+ jobId: string | null
+ jobReadableId: string | null
+ locationId: string | null
+ orderDate: string | null
+ orderTotal: number | null
+ paymentTermId: string | null
+ purchaseOrderId: string | null
+ purchaseOrderType:
+ | Database["public"]["Enums"]["purchaseOrderType"]
+ | null
+ receiptPromisedDate: string | null
+ receiptRequestedDate: string | null
+ revisionId: number | null
+ shippingMethodId: string | null
+ shippingTermId: string | null
+ status: Database["public"]["Enums"]["purchaseOrderStatus"] | null
+ supplierContactId: string | null
+ supplierId: string | null
+ supplierInteractionId: string | null
+ supplierLocationId: string | null
+ supplierReference: string | null
+ supplierShippingCost: number | null
+ tags: string[] | null
+ thumbnailPath: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "purchaseOrder_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_closedBy_fkey"
+ columns: ["closedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_closedBy_fkey"
+ columns: ["closedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_closedBy_fkey"
+ columns: ["closedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_closedBy_fkey"
+ columns: ["closedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_closedBy_fkey"
+ columns: ["closedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_currencyCode_fkey"
+ columns: ["currencyCode"]
+ isOneToOne: false
+ referencedRelation: "currencyCode"
+ referencedColumns: ["code"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "job"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "openProductionOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_supplierContactId_fkey"
+ columns: ["supplierContactId"]
+ isOneToOne: false
+ referencedRelation: "supplierContact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_supplierInteractionId_fkey"
+ columns: ["supplierInteractionId"]
+ isOneToOne: false
+ referencedRelation: "supplierInteraction"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_supplierLocationId_fkey"
+ columns: ["supplierLocationId"]
+ isOneToOne: false
+ referencedRelation: "supplierLocation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrder_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "purchaseOrderDelivery_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderDelivery_shippingMethodId_fkey"
+ columns: ["shippingMethodId"]
+ isOneToOne: false
+ referencedRelation: "shippingMethod"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderDelivery_shippingTermId_fkey"
+ columns: ["shippingTermId"]
+ isOneToOne: false
+ referencedRelation: "shippingTerm"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchaseOrderPayment_paymentTermId_fkey"
+ columns: ["paymentTermId"]
+ isOneToOne: false
+ referencedRelation: "paymentTerm"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ purchaseOrderSuppliers: {
+ Row: {
+ companyId: string | null
+ id: string | null
+ name: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "supplier_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplier_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ ]
+ }
+ purchasingRfqLines: {
+ Row: {
+ companyId: string | null
+ conversionFactor: number | null
+ createdAt: string | null
+ createdBy: string | null
+ customFields: Json | null
+ description: string | null
+ externalNotes: Json | null
+ id: string | null
+ internalNotes: Json | null
+ inventoryUnitOfMeasureCode: string | null
+ itemId: string | null
+ itemName: string | null
+ itemReadableId: string | null
+ itemType: Database["public"]["Enums"]["itemType"] | null
+ modelPath: string | null
+ order: number | null
+ purchaseUnitOfMeasureCode: string | null
+ purchasingRfqId: string | null
+ quantity: number[] | null
+ thumbnailPath: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "purchasingRfqLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_inventoryUnitOfMeasureCode_fkey"
+ columns: ["inventoryUnitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_purchaseUnitOfMeasureCode_fkey"
+ columns: ["purchaseUnitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_purchasingRfqId_fkey"
+ columns: ["purchasingRfqId"]
+ isOneToOne: false
+ referencedRelation: "purchasingRfq"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_purchasingRfqId_fkey"
+ columns: ["purchasingRfqId"]
+ isOneToOne: false
+ referencedRelation: "purchasingRfqs"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfqLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ purchasingRfqs: {
+ Row: {
+ assignee: string | null
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ customFields: Json | null
+ employeeId: string | null
+ expirationDate: string | null
+ favorite: boolean | null
+ id: string | null
+ internalNotes: string | null
+ locationId: string | null
+ locationName: string | null
+ notes: Json | null
+ revisionId: number | null
+ rfqDate: string | null
+ rfqId: string | null
+ status: Database["public"]["Enums"]["purchasingRfqStatus"] | null
+ supplierCount: number | null
+ supplierIds: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "purchasingRfq_assigneeId_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_assigneeId_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_assigneeId_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_assigneeId_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_assigneeId_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "purchasingRfq_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ qualityActions: {
+ Row: {
+ actionType: string | null
+ actionTypeId: string | null
+ assignee: string | null
+ companyId: string | null
+ completedDate: string | null
+ createdAt: string | null
+ createdBy: string | null
+ dueDate: string | null
+ id: string | null
+ items: string[] | null
+ nonConformanceCloseDate: string | null
+ nonConformanceDueDate: string | null
+ nonConformanceId: string | null
+ nonConformanceName: string | null
+ nonConformanceOpenDate: string | null
+ nonConformanceStatus:
+ | Database["public"]["Enums"]["nonConformanceStatus"]
+ | null
+ nonConformanceTypeName: string | null
+ notes: Json | null
+ readableNonConformanceId: string | null
+ sortOrder: number | null
+ status: Database["public"]["Enums"]["nonConformanceTaskStatus"] | null
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "nonConformanceActionTask_actionTypeId_fkey"
+ columns: ["actionTypeId"]
+ isOneToOne: false
+ referencedRelation: "nonConformanceRequiredAction"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "issues"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "nonConformance"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "nonConformanceActionTask_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ qualityDocuments: {
+ Row: {
+ assignee: string | null
+ companyId: string | null
+ id: string | null
+ name: string | null
+ status: Database["public"]["Enums"]["qualityDocumentStatus"] | null
+ tags: string[] | null
+ version: number | null
+ versions: Json | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "qualityDocument_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "qualityDocument_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "qualityDocument_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "qualityDocument_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "qualityDocument_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "qualityDocument_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "qualityDocument_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "qualityDocument_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "qualityDocument_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ ]
+ }
+ quoteCustomerDetails: {
+ Row: {
+ contactEmail: string | null
+ contactName: string | null
+ customerAddressLine1: string | null
+ customerAddressLine2: string | null
+ customerCity: string | null
+ customerCountryCode: string | null
+ customerCountryName: string | null
+ customerEori: string | null
+ customerName: string | null
+ customerPostalCode: string | null
+ customerStateProvince: string | null
+ customerTaxId: string | null
+ customerVatNumber: string | null
+ quoteId: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "address_countryCode_fkey"
+ columns: ["customerCountryCode"]
+ isOneToOne: false
+ referencedRelation: "country"
+ referencedColumns: ["alpha2"]
+ },
+ ]
+ }
+ quoteLinePrices: {
+ Row: {
+ additionalCharges: Json | null
+ autodeskUrn: string | null
+ companyId: string | null
+ configuration: Json | null
+ createdBy: string | null
+ customerId: string | null
+ customerPartId: string | null
+ customerPartRevision: string | null
+ customFields: Json | null
+ description: string | null
+ estimatorId: string | null
+ externalNotes: Json | null
+ id: string | null
+ internalNotes: Json | null
+ itemId: string | null
+ itemReadableId: string | null
+ itemType: string | null
+ locationId: string | null
+ methodType: Database["public"]["Enums"]["methodType"] | null
+ modelId: string | null
+ modelName: string | null
+ modelPath: string | null
+ modelSize: number | null
+ modelUploadId: string | null
+ noQuoteReason: string | null
+ qty: number | null
+ quantity: number[] | null
+ quoteCreatedAt: string | null
+ quoteId: string | null
+ quoteReadableId: string | null
+ quoteRevisionId: number | null
+ status: Database["public"]["Enums"]["quoteLineStatus"] | null
+ tags: string[] | null
+ taxPercent: number | null
+ thumbnailPath: string | null
+ unitCost: number | null
+ unitOfMeasureCode: string | null
+ unitPrice: number | null
+ unitPricePrecision: number | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "quote_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "quoteLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "quoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "quoteLine_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "quoteLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "quoteLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "modelUpload"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "salesRfqLines"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "quoteLine_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quote"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quoteCustomerDetails"
+ referencedColumns: ["quoteId"]
+ },
+ {
+ foreignKeyName: "quoteLine_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quotes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_unitOfMeasureCode_fkey"
+ columns: ["unitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "quoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ quoteLines: {
+ Row: {
+ additionalCharges: Json | null
+ autodeskUrn: string | null
+ companyId: string | null
+ configuration: Json | null
+ createdBy: string | null
+ customerPartId: string | null
+ customerPartRevision: string | null
+ customFields: Json | null
+ description: string | null
+ estimatorId: string | null
+ externalNotes: Json | null
+ id: string | null
+ internalNotes: Json | null
+ itemId: string | null
+ itemReadableId: string | null
+ itemType: string | null
+ locationId: string | null
+ methodType: Database["public"]["Enums"]["methodType"] | null
+ modelId: string | null
+ modelName: string | null
+ modelPath: string | null
+ modelSize: number | null
+ modelUploadId: string | null
+ noQuoteReason: string | null
+ priceTrace: Json | null
+ pricingRuleId: string | null
+ quantity: number[] | null
+ quoteId: string | null
+ quoteRevisionId: number | null
+ sortOrder: number | null
+ status: Database["public"]["Enums"]["quoteLineStatus"] | null
+ tags: string[] | null
+ taxPercent: number | null
+ thumbnailPath: string | null
+ unitCost: number | null
+ unitOfMeasureCode: string | null
+ unitPricePrecision: number | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "quoteLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "quoteLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "quoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "quoteLine_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "quoteLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "quoteLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "modelUpload"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "salesRfqLines"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "quoteLine_pricingRuleId_fkey"
+ columns: ["pricingRuleId"]
+ isOneToOne: false
+ referencedRelation: "pricingRule"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quote"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quoteCustomerDetails"
+ referencedColumns: ["quoteId"]
+ },
+ {
+ foreignKeyName: "quoteLine_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quotes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_unitOfMeasureCode_fkey"
+ columns: ["unitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "quoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ quoteMaterialWithMakeMethodId: {
+ Row: {
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ customFields: Json | null
+ description: string | null
+ id: string | null
+ itemId: string | null
+ itemType: string | null
+ kit: boolean | null
+ methodType: Database["public"]["Enums"]["methodType"] | null
+ order: number | null
+ productionQuantity: number | null
+ quantity: number | null
+ quoteId: string | null
+ quoteLineId: string | null
+ quoteMakeMethodId: string | null
+ quoteMaterialMakeMethodId: string | null
+ quoteOperationId: string | null
+ scrapQuantity: number | null
+ storageUnitId: string | null
+ tags: string[] | null
+ unitCost: number | null
+ unitOfMeasureCode: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ version: number | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "quoteMaterial_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quote"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quoteCustomerDetails"
+ referencedColumns: ["quoteId"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quotes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_quoteLineId_fkey"
+ columns: ["quoteLineId"]
+ isOneToOne: false
+ referencedRelation: "quoteLine"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_quoteLineId_fkey"
+ columns: ["quoteLineId"]
+ isOneToOne: false
+ referencedRelation: "quoteLinePrices"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_quoteLineId_fkey"
+ columns: ["quoteLineId"]
+ isOneToOne: false
+ referencedRelation: "quoteLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_quoteMakeMethodId_fkey"
+ columns: ["quoteMakeMethodId"]
+ isOneToOne: false
+ referencedRelation: "quoteMakeMethod"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_quoteMakeMethodId_fkey"
+ columns: ["quoteMakeMethodId"]
+ isOneToOne: false
+ referencedRelation: "quoteMaterialWithMakeMethodId"
+ referencedColumns: ["quoteMaterialMakeMethodId"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_quoteOperationId_fkey"
+ columns: ["quoteOperationId"]
+ isOneToOne: false
+ referencedRelation: "quoteOperation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_quoteOperationId_fkey"
+ columns: ["quoteOperationId"]
+ isOneToOne: false
+ referencedRelation: "quoteOperationsWithMakeMethods"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_storageUnitId_fkey"
+ columns: ["storageUnitId"]
+ isOneToOne: false
+ referencedRelation: "storageUnit"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_unitOfMeasureCode_fkey"
+ columns: ["unitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteMaterial_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ quoteOperationsWithMakeMethods: {
+ Row: {
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ customFields: Json | null
+ description: string | null
+ id: string | null
+ laborRate: number | null
+ laborTime: number | null
+ laborUnit: Database["public"]["Enums"]["factor"] | null
+ machineRate: number | null
+ machineTime: number | null
+ machineUnit: Database["public"]["Enums"]["factor"] | null
+ makeMethodId: string | null
+ operationLeadTime: number | null
+ operationMinimumCost: number | null
+ operationOrder:
+ | Database["public"]["Enums"]["methodOperationOrder"]
+ | null
+ operationSupplierProcessId: string | null
+ operationType: Database["public"]["Enums"]["operationType"] | null
+ operationUnitCost: number | null
+ order: number | null
+ overheadRate: number | null
+ procedureId: string | null
+ processId: string | null
+ quoteId: string | null
+ quoteLineId: string | null
+ quoteMakeMethodId: string | null
+ setupTime: number | null
+ setupUnit: Database["public"]["Enums"]["factor"] | null
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ workCenterId: string | null
+ workInstruction: Json | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "quoteOperation_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "quoteOperation_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "quoteOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "quoteOperation_operationSupplierProcessId_fkey"
+ columns: ["operationSupplierProcessId"]
+ isOneToOne: false
+ referencedRelation: "supplierProcess"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_operationSupplierProcessId_fkey"
+ columns: ["operationSupplierProcessId"]
+ isOneToOne: false
+ referencedRelation: "supplierProcesses"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_procedureId_fkey"
+ columns: ["procedureId"]
+ isOneToOne: false
+ referencedRelation: "procedure"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_procedureId_fkey"
+ columns: ["procedureId"]
+ isOneToOne: false
+ referencedRelation: "procedures"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_processId_fkey"
+ columns: ["processId"]
+ isOneToOne: false
+ referencedRelation: "process"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_processId_fkey"
+ columns: ["processId"]
+ isOneToOne: false
+ referencedRelation: "processes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quote"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quoteCustomerDetails"
+ referencedColumns: ["quoteId"]
+ },
+ {
+ foreignKeyName: "quoteOperation_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quotes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_quoteLineId_fkey"
+ columns: ["quoteLineId"]
+ isOneToOne: false
+ referencedRelation: "quoteLine"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_quoteLineId_fkey"
+ columns: ["quoteLineId"]
+ isOneToOne: false
+ referencedRelation: "quoteLinePrices"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_quoteLineId_fkey"
+ columns: ["quoteLineId"]
+ isOneToOne: false
+ referencedRelation: "quoteLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_quoteMakeMethodId_fkey"
+ columns: ["quoteMakeMethodId"]
+ isOneToOne: false
+ referencedRelation: "quoteMakeMethod"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_quoteMakeMethodId_fkey"
+ columns: ["quoteMakeMethodId"]
+ isOneToOne: false
+ referencedRelation: "quoteMaterialWithMakeMethodId"
+ referencedColumns: ["quoteMaterialMakeMethodId"]
+ },
+ {
+ foreignKeyName: "quoteOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "quoteOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "riskRegisters"
+ referencedColumns: ["workCenterId"]
+ },
+ {
+ foreignKeyName: "quoteOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenter"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenters"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ quotes: {
+ Row: {
+ assignee: string | null
+ companyId: string | null
+ completedDate: string | null
+ completedLines: number | null
+ createdAt: string | null
+ createdBy: string | null
+ currencyCode: string | null
+ customerContactId: string | null
+ customerEngineeringContactId: string | null
+ customerId: string | null
+ customerLocationId: string | null
+ customerReference: string | null
+ customFields: Json | null
+ digitalQuoteAcceptedBy: string | null
+ digitalQuoteAcceptedByEmail: string | null
+ digitalQuoteRejectedBy: string | null
+ digitalQuoteRejectedByEmail: string | null
+ dueDate: string | null
+ estimatorId: string | null
+ exchangeRate: number | null
+ exchangeRateUpdatedAt: string | null
+ expirationDate: string | null
+ externalLinkId: string | null
+ externalNotes: Json | null
+ id: string | null
+ internalNotes: Json | null
+ itemType: Database["public"]["Enums"]["itemType"] | null
+ lines: number | null
+ locationId: string | null
+ locationName: string | null
+ opportunityId: string | null
+ quoteId: string | null
+ revisionId: number | null
+ salesPersonId: string | null
+ shippingCost: number | null
+ status: Database["public"]["Enums"]["quoteStatus"] | null
+ tags: string[] | null
+ thumbnailPath: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "quote_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "quote_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "quote_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "quote_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "quote_currencyCode_fkey"
+ columns: ["currencyCode"]
+ isOneToOne: false
+ referencedRelation: "currencyCode"
+ referencedColumns: ["code"]
+ },
+ {
+ foreignKeyName: "quote_customerContactId_fkey"
+ columns: ["customerContactId"]
+ isOneToOne: false
+ referencedRelation: "customerContact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_customerEngineeringContactId_fkey"
+ columns: ["customerEngineeringContactId"]
+ isOneToOne: false
+ referencedRelation: "customerContact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_customerLocationId_fkey"
+ columns: ["customerLocationId"]
+ isOneToOne: false
+ referencedRelation: "customerLocation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "quote_externalLinkId_fkey"
+ columns: ["externalLinkId"]
+ isOneToOne: false
+ referencedRelation: "externalLink"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_opportunityId_fkey"
+ columns: ["opportunityId"]
+ isOneToOne: false
+ referencedRelation: "opportunity"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_salesPersonId_fkey"
+ columns: ["salesPersonId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_salesPersonId_fkey"
+ columns: ["salesPersonId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_salesPersonId_fkey"
+ columns: ["salesPersonId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_salesPersonId_fkey"
+ columns: ["salesPersonId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_salesPersonId_fkey"
+ columns: ["salesPersonId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "quote_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quote_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ receiptLines: {
+ Row: {
+ companyId: string | null
+ conversionFactor: number | null
+ createdAt: string | null
+ createdBy: string | null
+ description: string | null
+ id: string | null
+ itemId: string | null
+ itemReadableId: string | null
+ lineId: string | null
+ locationId: string | null
+ orderQuantity: number | null
+ outstandingQuantity: number | null
+ receiptId: string | null
+ receivedQuantity: number | null
+ requiresBatchTracking: boolean | null
+ requiresSerialTracking: boolean | null
+ storageUnitId: string | null
+ thumbnailPath: string | null
+ unitOfMeasure: string | null
+ unitPrice: number | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "receiptLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "receiptLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_receiptId_fkey"
+ columns: ["receiptId"]
+ isOneToOne: false
+ referencedRelation: "receipt"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_receiptId_fkey"
+ columns: ["receiptId"]
+ isOneToOne: false
+ referencedRelation: "receipts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_storageUnitId_fkey"
+ columns: ["storageUnitId"]
+ isOneToOne: false
+ referencedRelation: "storageUnit"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receiptLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ receipts: {
+ Row: {
+ assignee: string | null
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ customFields: Json | null
+ externalDocumentId: string | null
+ id: string | null
+ internalNotes: Json | null
+ invoiced: boolean | null
+ locationId: string | null
+ locationName: string | null
+ postedBy: string | null
+ postingDate: string | null
+ receiptId: string | null
+ sourceDocument:
+ | Database["public"]["Enums"]["receiptSourceDocument"]
+ | null
+ sourceDocumentId: string | null
+ sourceDocumentReadableId: string | null
+ status: Database["public"]["Enums"]["receiptStatus"] | null
+ supplierId: string | null
+ supplierInteractionId: string | null
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "receipt_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "receipt_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "receipt_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "receipt_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "receipt_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_postedBy_fkey"
+ columns: ["postedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_postedBy_fkey"
+ columns: ["postedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_postedBy_fkey"
+ columns: ["postedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_postedBy_fkey"
+ columns: ["postedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_postedBy_fkey"
+ columns: ["postedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "receipt_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "receipt_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "receipt_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_supplierInteractionId_fkey"
+ columns: ["supplierInteractionId"]
+ isOneToOne: false
+ referencedRelation: "supplierInteraction"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "receipt_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ riskRegisters: {
+ Row: {
+ assignee: string | null
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ description: string | null
+ id: string | null
+ itemId: string | null
+ likelihood: number | null
+ notes: Json | null
+ severity: number | null
+ source: Database["public"]["Enums"]["riskSource"] | null
+ sourceId: string | null
+ status: Database["public"]["Enums"]["riskStatus"] | null
+ title: string | null
+ type: Database["public"]["Enums"]["riskRegisterType"] | null
+ updatedAt: string | null
+ workCenterId: string | null
+ workCenterName: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "riskRegister_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "riskRegister_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "riskRegister_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "riskRegister_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "riskRegister_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "riskRegister_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ salesInvoiceLines: {
+ Row: {
+ accountId: string | null
+ addOnCost: number | null
+ assetId: string | null
+ assetName: string | null
+ assetReadableId: string | null
+ companyId: string | null
+ convertedAddOnCost: number | null
+ convertedNonTaxableAddOnCost: number | null
+ convertedSetupPrice: number | null
+ convertedShippingCost: number | null
+ convertedUnitPrice: number | null
+ createdAt: string | null
+ createdBy: string | null
+ customerPartId: string | null
+ customFields: Json | null
+ description: string | null
+ exchangeRate: number | null
+ externalNotes: Json | null
+ id: string | null
+ internalNotes: Json | null
+ invoiceId: string | null
+ invoiceLineType:
+ | Database["public"]["Enums"]["salesInvoiceLineType"]
+ | null
+ itemDescription: string | null
+ itemId: string | null
+ itemName: string | null
+ itemReadableId: string | null
+ locationId: string | null
+ methodType: Database["public"]["Enums"]["methodType"] | null
+ modelUploadId: string | null
+ nonTaxableAddOnCost: number | null
+ opportunityId: string | null
+ quantity: number | null
+ salesOrderId: string | null
+ salesOrderLineId: string | null
+ setupPrice: number | null
+ shippingCost: number | null
+ sortOrder: number | null
+ storageUnitId: string | null
+ taxPercent: number | null
+ thumbnailPath: string | null
+ unitCost: number | null
+ unitOfMeasureCode: string | null
+ unitPrice: number | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "salesInvoiceLine_accountId_fkey"
+ columns: ["accountId"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_accountId_fkey"
+ columns: ["accountId"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_assetId_fkey"
+ columns: ["assetId"]
+ isOneToOne: false
+ referencedRelation: "fixedAsset"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_invoiceId_fkey"
+ columns: ["invoiceId"]
+ isOneToOne: false
+ referencedRelation: "salesInvoice"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_invoiceId_fkey"
+ columns: ["invoiceId"]
+ isOneToOne: false
+ referencedRelation: "salesInvoiceLocations"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_invoiceId_fkey"
+ columns: ["invoiceId"]
+ isOneToOne: false
+ referencedRelation: "salesInvoices"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "modelUpload"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "salesRfqLines"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_opportunityId_fkey"
+ columns: ["opportunityId"]
+ isOneToOne: false
+ referencedRelation: "opportunity"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrder"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderLocations"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_salesOrderLineId_fkey"
+ columns: ["salesOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "openSalesOrderLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_salesOrderLineId_fkey"
+ columns: ["salesOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderLine"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_salesOrderLineId_fkey"
+ columns: ["salesOrderLineId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_storageUnitId_fkey"
+ columns: ["storageUnitId"]
+ isOneToOne: false
+ referencedRelation: "storageUnit"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoiceLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ salesInvoiceLocations: {
+ Row: {
+ customerAddressLine1: string | null
+ customerAddressLine2: string | null
+ customerCity: string | null
+ customerCountryCode: string | null
+ customerCountryName: string | null
+ customerEori: string | null
+ customerName: string | null
+ customerPostalCode: string | null
+ customerStateProvince: string | null
+ customerTaxId: string | null
+ customerVatNumber: string | null
+ id: string | null
+ invoiceAddressLine1: string | null
+ invoiceAddressLine2: string | null
+ invoiceCity: string | null
+ invoiceCountryCode: string | null
+ invoiceCountryName: string | null
+ invoiceCustomerName: string | null
+ invoicePostalCode: string | null
+ invoiceStateProvince: string | null
+ shipmentAddressLine1: string | null
+ shipmentAddressLine2: string | null
+ shipmentCity: string | null
+ shipmentCountryCode: string | null
+ shipmentCountryName: string | null
+ shipmentCustomerName: string | null
+ shipmentPostalCode: string | null
+ shipmentStateProvince: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "address_countryCode_fkey"
+ columns: ["shipmentCountryCode"]
+ isOneToOne: false
+ referencedRelation: "country"
+ referencedColumns: ["alpha2"]
+ },
+ {
+ foreignKeyName: "address_countryCode_fkey"
+ columns: ["customerCountryCode"]
+ isOneToOne: false
+ referencedRelation: "country"
+ referencedColumns: ["alpha2"]
+ },
+ {
+ foreignKeyName: "address_countryCode_fkey"
+ columns: ["invoiceCountryCode"]
+ isOneToOne: false
+ referencedRelation: "country"
+ referencedColumns: ["alpha2"]
+ },
+ ]
+ }
+ salesInvoices: {
+ Row: {
+ assignee: string | null
+ balance: number | null
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ currencyCode: string | null
+ customerId: string | null
+ customerReference: string | null
+ customFields: Json | null
+ dateDue: string | null
+ dateIssued: string | null
+ datePaid: string | null
+ exchangeRate: number | null
+ exchangeRateUpdatedAt: string | null
+ externalNotes: Json | null
+ id: string | null
+ internalNotes: Json | null
+ invoiceCustomerContactId: string | null
+ invoiceCustomerId: string | null
+ invoiceCustomerLocationId: string | null
+ invoiceId: string | null
+ invoiceTotal: number | null
+ itemType: Database["public"]["Enums"]["itemType"] | null
+ lines: Json[] | null
+ locationId: string | null
+ opportunityId: string | null
+ paymentTermId: string | null
+ postingDate: string | null
+ shipmentId: string | null
+ status: Database["public"]["Enums"]["salesInvoiceStatus"] | null
+ subtotal: number | null
+ tags: string[] | null
+ thumbnailPath: string | null
+ totalAmount: number | null
+ totalDiscount: number | null
+ totalTax: number | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "salesInvoice_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "salesInvoice_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "salesInvoice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "salesInvoice_currencyCode_fkey"
+ columns: ["currencyCode"]
+ isOneToOne: false
+ referencedRelation: "currencyCode"
+ referencedColumns: ["code"]
+ },
+ {
+ foreignKeyName: "salesInvoice_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_invoiceCustomerContactId_fkey"
+ columns: ["invoiceCustomerContactId"]
+ isOneToOne: false
+ referencedRelation: "customerContact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_invoiceCustomerId_fkey"
+ columns: ["invoiceCustomerId"]
+ isOneToOne: false
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_invoiceCustomerId_fkey"
+ columns: ["invoiceCustomerId"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_invoiceCustomerId_fkey"
+ columns: ["invoiceCustomerId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_invoiceCustomerLocationId_fkey"
+ columns: ["invoiceCustomerLocationId"]
+ isOneToOne: false
+ referencedRelation: "customerLocation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_opportunityId_fkey"
+ columns: ["opportunityId"]
+ isOneToOne: false
+ referencedRelation: "opportunity"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_paymentTermId_fkey"
+ columns: ["paymentTermId"]
+ isOneToOne: false
+ referencedRelation: "paymentTerm"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_shipmentId_fkey"
+ columns: ["shipmentId"]
+ isOneToOne: false
+ referencedRelation: "shipment"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesInvoice_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ salesOrderCustomers: {
+ Row: {
+ companyId: string | null
+ id: string | null
+ name: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "customer_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "customer_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "customer_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ ]
+ }
+ salesOrderLines: {
+ Row: {
+ accountId: string | null
+ addOnCost: number | null
+ assetId: string | null
+ assetName: string | null
+ assetReadableId: string | null
+ autodeskUrn: string | null
+ companyId: string | null
+ convertedAddOnCost: number | null
+ convertedNonTaxableAddOnCost: number | null
+ convertedShippingCost: number | null
+ convertedUnitPrice: number | null
+ createdAt: string | null
+ createdBy: string | null
+ customerId: string | null
+ customerPartId: string | null
+ customerPartRevision: string | null
+ customFields: Json | null
+ description: string | null
+ exchangeRate: number | null
+ externalNotes: Json | null
+ id: string | null
+ internalNotes: Json | null
+ invoicedComplete: boolean | null
+ itemId: string | null
+ itemReadableId: string | null
+ locationId: string | null
+ methodType: Database["public"]["Enums"]["methodType"] | null
+ modelId: string | null
+ modelName: string | null
+ modelPath: string | null
+ modelSize: number | null
+ modelUploadId: string | null
+ nonTaxableAddOnCost: number | null
+ orderDate: string | null
+ priceTrace: Json | null
+ pricingRuleId: string | null
+ promisedDate: string | null
+ quantityInvoiced: number | null
+ quantitySent: number | null
+ quantityToInvoice: number | null
+ quantityToSend: number | null
+ requiresInspection: boolean | null
+ saleQuantity: number | null
+ salesOrderId: string | null
+ salesOrderLineType:
+ | Database["public"]["Enums"]["salesOrderLineType"]
+ | null
+ salesOrderReadableId: string | null
+ sentComplete: boolean | null
+ sentDate: string | null
+ setupPrice: number | null
+ shippingCost: number | null
+ sortOrder: number | null
+ status: Database["public"]["Enums"]["salesOrderLineStatus"] | null
+ storageUnitId: string | null
+ taxPercent: number | null
+ thumbnailPath: string | null
+ unitCost: number | null
+ unitOfMeasureCode: string | null
+ unitPrice: number | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "salesOrder_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_accountId_fkey"
+ columns: ["accountId"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_accountId_fkey"
+ columns: ["accountId"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_assetId_fkey"
+ columns: ["assetId"]
+ isOneToOne: false
+ referencedRelation: "fixedAsset"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_pricingRuleId_fkey"
+ columns: ["pricingRuleId"]
+ isOneToOne: false
+ referencedRelation: "pricingRule"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrder"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderLocations"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_salesOrderId_fkey"
+ columns: ["salesOrderId"]
+ isOneToOne: false
+ referencedRelation: "salesOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_storageUnitId_fkey"
+ columns: ["storageUnitId"]
+ isOneToOne: false
+ referencedRelation: "storageUnit"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_unitOfMeasureCode_fkey"
+ columns: ["unitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ salesOrderLocations: {
+ Row: {
+ customerAddressLine1: string | null
+ customerAddressLine2: string | null
+ customerCity: string | null
+ customerCountryCode: string | null
+ customerCountryName: string | null
+ customerEori: string | null
+ customerName: string | null
+ customerPostalCode: string | null
+ customerStateProvince: string | null
+ customerTaxId: string | null
+ customerVatNumber: string | null
+ id: string | null
+ paymentAddressLine1: string | null
+ paymentAddressLine2: string | null
+ paymentCity: string | null
+ paymentCountryCode: string | null
+ paymentCountryName: string | null
+ paymentCustomerName: string | null
+ paymentPostalCode: string | null
+ paymentStateProvince: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "address_countryCode_fkey"
+ columns: ["customerCountryCode"]
+ isOneToOne: false
+ referencedRelation: "country"
+ referencedColumns: ["alpha2"]
+ },
+ {
+ foreignKeyName: "address_countryCode_fkey"
+ columns: ["paymentCountryCode"]
+ isOneToOne: false
+ referencedRelation: "country"
+ referencedColumns: ["alpha2"]
+ },
+ ]
+ }
+ salesOrders: {
+ Row: {
+ assignee: string | null
+ closedAt: string | null
+ closedBy: string | null
+ companyId: string | null
+ completedDate: string | null
+ createdAt: string | null
+ createdBy: string | null
+ currencyCode: string | null
+ customerContactId: string | null
+ customerEngineeringContactId: string | null
+ customerId: string | null
+ customerLocationId: string | null
+ customerReference: string | null
+ customFields: Json | null
+ dropShipment: boolean | null
+ exchangeRate: number | null
+ exchangeRateUpdatedAt: string | null
+ externalId: Json | null
+ externalNotes: Json | null
+ id: string | null
+ incoterm: Database["public"]["Enums"]["incoterm"] | null
+ incotermLocation: string | null
+ internalNotes: Json | null
+ itemType: Database["public"]["Enums"]["itemType"] | null
+ jobs: Json[] | null
+ lines: Json[] | null
+ locationId: string | null
+ opportunityId: string | null
+ orderDate: string | null
+ orderTotal: number | null
+ paymentTermId: string | null
+ receiptPromisedDate: string | null
+ receiptRequestedDate: string | null
+ revisionId: number | null
+ salesOrderId: string | null
+ salesPersonId: string | null
+ sentCompleteDate: string | null
+ shippingCost: number | null
+ shippingMethodId: string | null
+ shippingTermName: string | null
+ status: Database["public"]["Enums"]["salesOrderStatus"] | null
+ thumbnailPath: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "salesOrder_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "salesOrder_closedBy_fkey"
+ columns: ["closedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_closedBy_fkey"
+ columns: ["closedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_closedBy_fkey"
+ columns: ["closedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_closedBy_fkey"
+ columns: ["closedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_closedBy_fkey"
+ columns: ["closedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "salesOrder_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "salesOrder_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "salesOrder_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "salesOrder_currencyCode_fkey"
+ columns: ["currencyCode"]
+ isOneToOne: false
+ referencedRelation: "currencyCode"
+ referencedColumns: ["code"]
+ },
+ {
+ foreignKeyName: "salesOrder_customerContactId_fkey"
+ columns: ["customerContactId"]
+ isOneToOne: false
+ referencedRelation: "customerContact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_customerEngineeringContactId_fkey"
+ columns: ["customerEngineeringContactId"]
+ isOneToOne: false
+ referencedRelation: "customerContact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_opportunityId_fkey"
+ columns: ["opportunityId"]
+ isOneToOne: false
+ referencedRelation: "opportunity"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrder_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "salesOrderLine_customerLocationId_fkey"
+ columns: ["customerLocationId"]
+ isOneToOne: false
+ referencedRelation: "customerLocation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderPayment_paymentTermId_fkey"
+ columns: ["paymentTermId"]
+ isOneToOne: false
+ referencedRelation: "paymentTerm"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesOrderShipment_shippingMethodId_fkey"
+ columns: ["shippingMethodId"]
+ isOneToOne: false
+ referencedRelation: "shippingMethod"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ salesRfqLines: {
+ Row: {
+ autodeskUrn: string | null
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ customerPartId: string | null
+ customerPartRevision: string | null
+ customFields: Json | null
+ description: string | null
+ externalNotes: Json | null
+ id: string | null
+ internalNotes: Json | null
+ itemId: string | null
+ itemName: string | null
+ itemReadableId: string | null
+ itemType: Database["public"]["Enums"]["itemType"] | null
+ methodType: Database["public"]["Enums"]["methodType"] | null
+ modelId: string | null
+ modelName: string | null
+ modelPath: string | null
+ modelSize: number | null
+ modelUploadId: string | null
+ order: number | null
+ quantity: number[] | null
+ salesRfqId: string | null
+ tags: string[] | null
+ thumbnailPath: string | null
+ unitOfMeasureCode: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "salesRfqLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "modelUpload"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "salesRfqLines"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_salesRfqId_fkey"
+ columns: ["salesRfqId"]
+ isOneToOne: false
+ referencedRelation: "salesRfq"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_salesRfqId_fkey"
+ columns: ["salesRfqId"]
+ isOneToOne: false
+ referencedRelation: "salesRfqs"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_unitOfMeasureCode_fkey"
+ columns: ["unitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfqLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ salesRfqs: {
+ Row: {
+ assignee: string | null
+ companyId: string | null
+ completedDate: string | null
+ createdAt: string | null
+ createdBy: string | null
+ customerContactId: string | null
+ customerEngineeringContactId: string | null
+ customerId: string | null
+ customerLocationId: string | null
+ customerReference: string | null
+ customFields: Json | null
+ employeeId: string | null
+ expirationDate: string | null
+ externalNotes: Json | null
+ id: string | null
+ internalNotes: Json | null
+ locationId: string | null
+ locationName: string | null
+ noQuoteReasonId: string | null
+ opportunityId: string | null
+ revisionId: number | null
+ rfqDate: string | null
+ rfqId: string | null
+ salesPersonId: string | null
+ status: Database["public"]["Enums"]["salesRfqStatus"] | null
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "salesRfq_assigneeId_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_assigneeId_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_assigneeId_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_assigneeId_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_assigneeId_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "salesRfq_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "salesRfq_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "salesRfq_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "salesRfq_customerContactId_fkey"
+ columns: ["customerContactId"]
+ isOneToOne: false
+ referencedRelation: "customerContact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_customerEngineeringContactId_fkey"
+ columns: ["customerEngineeringContactId"]
+ isOneToOne: false
+ referencedRelation: "customerContact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customer"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_customerId_fkey"
+ columns: ["customerId"]
+ isOneToOne: false
+ referencedRelation: "salesOrderCustomers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_customerLocationId_fkey"
+ columns: ["customerLocationId"]
+ isOneToOne: false
+ referencedRelation: "customerLocation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "salesRfq_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_noQuoteReasonId_fkey"
+ columns: ["noQuoteReasonId"]
+ isOneToOne: false
+ referencedRelation: "noQuoteReason"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_opportunityId_fkey"
+ columns: ["opportunityId"]
+ isOneToOne: false
+ referencedRelation: "opportunity"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "salesRfq_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ services: {
+ Row: {
+ active: boolean | null
+ assignee: string | null
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ customFields: Json | null
+ defaultMethodType: Database["public"]["Enums"]["methodType"] | null
+ description: string | null
+ externalId: Json | null
+ id: string | null
+ itemPostingGroupId: string | null
+ itemTrackingType:
+ | Database["public"]["Enums"]["itemTrackingType"]
+ | null
+ name: string | null
+ notes: Json | null
+ readableId: string | null
+ readableIdWithRevision: string | null
+ replenishmentSystem:
+ | Database["public"]["Enums"]["itemReplenishmentSystem"]
+ | null
+ revision: string | null
+ revisions: Json | null
+ supplierIds: string | null
+ tags: string[] | null
+ thumbnailPath: string | null
+ unitOfMeasure: string | null
+ unitOfMeasureCode: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "item_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "item_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "item_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "item_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "item_unitOfMeasureCode_fkey"
+ columns: ["unitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "item_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "itemCost_itemPostingGroupId_fkey"
+ columns: ["itemPostingGroupId"]
+ isOneToOne: false
+ referencedRelation: "itemPostingGroup"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ shifts: {
+ Row: {
+ active: boolean | null
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ customFields: Json | null
+ endTime: string | null
+ friday: boolean | null
+ id: string | null
+ locationId: string | null
+ locationName: string | null
+ monday: boolean | null
+ name: string | null
+ saturday: boolean | null
+ startTime: string | null
+ sunday: boolean | null
+ thursday: boolean | null
+ tuesday: boolean | null
+ updatedAt: string | null
+ updatedBy: string | null
+ wednesday: boolean | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "shifts_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shifts_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shifts_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "shifts_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "shifts_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shifts_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shifts_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shifts_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shifts_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "shifts_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shifts_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shifts_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shifts_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shifts_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shifts_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ shipmentLines: {
+ Row: {
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ description: string | null
+ fulfillmentId: string | null
+ id: string | null
+ itemId: string | null
+ itemReadableId: string | null
+ lineId: string | null
+ locationId: string | null
+ orderQuantity: number | null
+ outstandingQuantity: number | null
+ requiresBatchTracking: boolean | null
+ requiresSerialTracking: boolean | null
+ shipmentId: string | null
+ shippedQuantity: number | null
+ storageUnitId: string | null
+ thumbnailPath: string | null
+ unitOfMeasure: string | null
+ unitPrice: number | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "shipmentLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "shipmentLine_fulfillmentId_fkey"
+ columns: ["fulfillmentId"]
+ isOneToOne: false
+ referencedRelation: "fulfillment"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_shipmentId_fkey"
+ columns: ["shipmentId"]
+ isOneToOne: false
+ referencedRelation: "shipment"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_storageUnitId_fkey"
+ columns: ["storageUnitId"]
+ isOneToOne: false
+ referencedRelation: "storageUnit"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "shipmentLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ stockTransferLines: {
+ Row: {
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ fromStorageUnitId: string | null
+ fromStorageUnitName: string | null
+ id: string | null
+ itemDescription: string | null
+ itemId: string | null
+ itemReadableId: string | null
+ jobId: string | null
+ jobMaterialId: string | null
+ outstandingQuantity: number | null
+ pickedQuantity: number | null
+ quantity: number | null
+ requiresBatchTracking: boolean | null
+ requiresSerialTracking: boolean | null
+ stockTransferId: string | null
+ thumbnailPath: string | null
+ toStorageUnitId: string | null
+ toStorageUnitName: string | null
+ trackedEntityId: string | null
+ unitOfMeasure: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "stockTransferLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_fromStorageUnitId_fkey"
+ columns: ["fromStorageUnitId"]
+ isOneToOne: false
+ referencedRelation: "storageUnit"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "job"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_jobId_fkey"
+ columns: ["jobId"]
+ isOneToOne: false
+ referencedRelation: "openProductionOrders"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_jobMaterialId_fkey"
+ columns: ["jobMaterialId"]
+ isOneToOne: false
+ referencedRelation: "jobMaterial"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_jobMaterialId_fkey"
+ columns: ["jobMaterialId"]
+ isOneToOne: false
+ referencedRelation: "jobMaterialWithMakeMethodId"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_jobMaterialId_fkey"
+ columns: ["jobMaterialId"]
+ isOneToOne: false
+ referencedRelation: "openJobMaterialLines"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_stockTransferId_fkey"
+ columns: ["stockTransferId", "companyId"]
+ isOneToOne: false
+ referencedRelation: "stockTransfer"
+ referencedColumns: ["id", "companyId"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_toStorageUnitId_fkey"
+ columns: ["toStorageUnitId"]
+ isOneToOne: false
+ referencedRelation: "storageUnit"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_trackedEntityId_fkey"
+ columns: ["trackedEntityId"]
+ isOneToOne: false
+ referencedRelation: "trackedEntity"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "stockTransferLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ storageUnits_recursive: {
+ Row: {
+ active: boolean | null
+ ancestorPath: string[] | null
+ companyId: string | null
+ depth: number | null
+ id: string | null
+ locationId: string | null
+ name: string | null
+ parentId: string | null
+ storageTypeIds: string[] | null
+ warehouseId: string | null
+ }
+ Relationships: []
+ }
+ suggestions: {
+ Row: {
+ attachmentPath: string | null
+ companyId: string | null
+ createdAt: string | null
+ emoji: string | null
+ employeeAvatarUrl: string | null
+ employeeName: string | null
+ id: string | null
+ path: string | null
+ suggestion: string | null
+ tags: string[] | null
+ userId: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "suggestion_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "suggestion_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "suggestion_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "suggestion_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "suggestion_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "suggestion_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "suggestion_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "suggestion_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "suggestion_userId_fkey"
+ columns: ["userId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ supplierProcesses: {
+ Row: {
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ customFields: Json | null
+ id: string | null
+ leadTime: number | null
+ minimumCost: number | null
+ processId: string | null
+ processName: string | null
+ supplierId: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "supplierProcess_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierProcess_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierProcess_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplierProcess_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplierProcess_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierProcess_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierProcess_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierProcess_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierProcess_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "supplierProcess_processId_fkey"
+ columns: ["processId"]
+ isOneToOne: false
+ referencedRelation: "process"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierProcess_processId_fkey"
+ columns: ["processId"]
+ isOneToOne: false
+ referencedRelation: "processes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierProcess_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "supplierProcess_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "supplierProcess_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierProcess_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierProcess_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierProcess_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierProcess_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierProcess_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierProcess_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierProcess_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ supplierQuoteLines: {
+ Row: {
+ accountId: string | null
+ accountName: string | null
+ companyId: string | null
+ conversionFactor: number | null
+ costCenterId: string | null
+ createdBy: string | null
+ customFields: Json | null
+ description: string | null
+ externalNotes: Json | null
+ id: string | null
+ internalNotes: Json | null
+ inventoryUnitOfMeasureCode: string | null
+ itemId: string | null
+ itemReadableId: string | null
+ itemType: Database["public"]["Enums"]["itemType"] | null
+ ownerId: string | null
+ purchaseUnitOfMeasureCode: string | null
+ quantity: number[] | null
+ requiredDate: string | null
+ sortOrder: number | null
+ supplierPartId: string | null
+ supplierPartRevision: string | null
+ supplierQuoteId: string | null
+ supplierQuoteLineType: string | null
+ supplierQuoteRevisionId: number | null
+ tags: string[] | null
+ thumbnailPath: string | null
+ unitCost: number | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "supplierQuoteLine_accountId_fkey"
+ columns: ["accountId"]
+ isOneToOne: false
+ referencedRelation: "account"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_accountId_fkey"
+ columns: ["accountId"]
+ isOneToOne: false
+ referencedRelation: "accounts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_costCenterId_fkey"
+ columns: ["costCenterId"]
+ isOneToOne: false
+ referencedRelation: "costCenter"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_inventoryUnitOfMeasureCode_fkey"
+ columns: ["inventoryUnitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_ownerId_fkey"
+ columns: ["ownerId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_purchaseUnitOfMeasureCode_fkey"
+ columns: ["purchaseUnitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_supplierQuoteId_fkey"
+ columns: ["supplierQuoteId"]
+ isOneToOne: false
+ referencedRelation: "supplierQuote"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_supplierQuoteId_fkey"
+ columns: ["supplierQuoteId"]
+ isOneToOne: false
+ referencedRelation: "supplierQuotes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ supplierQuotes: {
+ Row: {
+ assignee: string | null
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ currencyCode: string | null
+ customFields: Json | null
+ exchangeRate: number | null
+ exchangeRateUpdatedAt: string | null
+ expirationDate: string | null
+ externalLinkId: string | null
+ externalNotes: Json | null
+ id: string | null
+ internalNotes: Json | null
+ itemType: Database["public"]["Enums"]["itemType"] | null
+ quotedDate: string | null
+ revisionId: number | null
+ status: Database["public"]["Enums"]["supplierQuoteStatus"] | null
+ supplierContactId: string | null
+ supplierId: string | null
+ supplierInteractionId: string | null
+ supplierLocationId: string | null
+ supplierQuoteId: string | null
+ supplierQuoteType:
+ | Database["public"]["Enums"]["purchaseOrderType"]
+ | null
+ supplierReference: string | null
+ tags: string[] | null
+ thumbnailPath: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "supplierQuote_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "supplierQuote_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplierQuote_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplierQuote_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "supplierQuote_currencyCode_fkey"
+ columns: ["currencyCode"]
+ isOneToOne: false
+ referencedRelation: "currencyCode"
+ referencedColumns: ["code"]
+ },
+ {
+ foreignKeyName: "supplierQuote_externalLinkId_fkey"
+ columns: ["externalLinkId"]
+ isOneToOne: false
+ referencedRelation: "externalLink"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_supplierContactId_fkey"
+ columns: ["supplierContactId"]
+ isOneToOne: false
+ referencedRelation: "supplierContact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "contractors"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "supplierQuote_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "partners"
+ referencedColumns: ["supplierId"]
+ },
+ {
+ foreignKeyName: "supplierQuote_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "purchaseOrderSuppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "supplier"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_supplierId_fkey"
+ columns: ["supplierId"]
+ isOneToOne: false
+ referencedRelation: "suppliers"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_supplierInteractionId_fkey"
+ columns: ["supplierInteractionId"]
+ isOneToOne: false
+ referencedRelation: "supplierInteraction"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_supplierLocationId_fkey"
+ columns: ["supplierLocationId"]
+ isOneToOne: false
+ referencedRelation: "supplierLocation"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplierQuote_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ suppliers: {
+ Row: {
+ accountManagerId: string | null
+ assignee: string | null
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ currencyCode: string | null
+ customFields: Json | null
+ defaultCc: string[] | null
+ embedding: unknown
+ eori: string | null
+ externalId: Json | null
+ fax: string | null
+ id: string | null
+ logo: string | null
+ name: string | null
+ orderCount: number | null
+ partCount: number | null
+ phone: string | null
+ purchasingContactId: string | null
+ readableId: string | null
+ status: Database["public"]["Enums"]["supplierStatusType"] | null
+ supplierTypeId: string | null
+ tags: string[] | null
+ taxId: string | null
+ taxPercent: number | null
+ type: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ vatNumber: string | null
+ website: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "supplier_accountManagerId_fkey"
+ columns: ["accountManagerId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_accountManagerId_fkey"
+ columns: ["accountManagerId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_accountManagerId_fkey"
+ columns: ["accountManagerId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_accountManagerId_fkey"
+ columns: ["accountManagerId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_accountManagerId_fkey"
+ columns: ["accountManagerId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "supplier_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "supplier_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplier_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "supplier_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "supplier_currencyCode_fkey"
+ columns: ["currencyCode"]
+ isOneToOne: false
+ referencedRelation: "currencyCode"
+ referencedColumns: ["code"]
+ },
+ {
+ foreignKeyName: "supplier_purchasingContactId_fkey"
+ columns: ["purchasingContactId"]
+ isOneToOne: false
+ referencedRelation: "supplierContact"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_supplierTypeId_fkey"
+ columns: ["supplierTypeId"]
+ isOneToOne: false
+ referencedRelation: "supplierType"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "supplier_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ timeCardEntries: {
+ Row: {
+ autoCloseShiftId: string | null
+ avatarUrl: string | null
+ clockIn: string | null
+ clockOut: string | null
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ employeeId: string | null
+ firstName: string | null
+ id: string | null
+ jobTitle: string | null
+ lastName: string | null
+ locationId: string | null
+ locationName: string | null
+ note: string | null
+ shiftId: string | null
+ shiftName: string | null
+ status: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "employeeJob_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeJob_shiftId_fkey"
+ columns: ["shiftId"]
+ isOneToOne: false
+ referencedRelation: "shift"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "employeeJob_shiftId_fkey"
+ columns: ["shiftId"]
+ isOneToOne: false
+ referencedRelation: "shifts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_autoCloseShiftId_fkey"
+ columns: ["autoCloseShiftId"]
+ isOneToOne: false
+ referencedRelation: "shift"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_autoCloseShiftId_fkey"
+ columns: ["autoCloseShiftId"]
+ isOneToOne: false
+ referencedRelation: "shifts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_employeeId_fkey"
+ columns: ["employeeId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "timeCardEntry_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ tools: {
+ Row: {
+ active: boolean | null
+ assignee: string | null
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ customFields: Json | null
+ defaultMethodType: Database["public"]["Enums"]["methodType"] | null
+ description: string | null
+ externalId: Json | null
+ id: string | null
+ itemPostingGroupId: string | null
+ itemTrackingType:
+ | Database["public"]["Enums"]["itemTrackingType"]
+ | null
+ modelName: string | null
+ modelPath: string | null
+ modelSize: number | null
+ name: string | null
+ notes: Json | null
+ readableId: string | null
+ readableIdWithRevision: string | null
+ replenishmentSystem:
+ | Database["public"]["Enums"]["itemReplenishmentSystem"]
+ | null
+ revision: string | null
+ revisions: Json | null
+ supplierIds: string | null
+ tags: string[] | null
+ thumbnailPath: string | null
+ unitOfMeasure: string | null
+ unitOfMeasureCode: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "item_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "item_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "item_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "item_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "item_unitOfMeasureCode_fkey"
+ columns: ["unitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "item_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "item_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "itemCost_itemPostingGroupId_fkey"
+ columns: ["itemPostingGroupId"]
+ isOneToOne: false
+ referencedRelation: "itemPostingGroup"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ trainings: {
+ Row: {
+ assignee: string | null
+ companyId: string | null
+ description: string | null
+ estimatedDuration: string | null
+ frequency: Database["public"]["Enums"]["trainingFrequency"] | null
+ id: string | null
+ name: string | null
+ status: Database["public"]["Enums"]["trainingStatus"] | null
+ tags: string[] | null
+ type: Database["public"]["Enums"]["trainingType"] | null
+ version: number | null
+ versions: Json | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "training_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "training_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "training_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "training_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "training_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "training_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "training_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "training_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "training_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ ]
+ }
+ userDefaults: {
+ Row: {
+ companyId: string | null
+ locationId: string | null
+ userId: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "employeeJob_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "location_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "location_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "location_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "location_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ ]
+ }
+ workCenters: {
+ Row: {
+ active: boolean | null
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ customFields: Json | null
+ defaultStandardFactor: Database["public"]["Enums"]["factor"] | null
+ departmentId: string | null
+ departmentName: string | null
+ description: string | null
+ id: string | null
+ laborRate: number | null
+ locationId: string | null
+ locationName: string | null
+ machineRate: number | null
+ name: string | null
+ overheadRate: number | null
+ processes: string[] | null
+ requiredAbilityId: string | null
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "workCenter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "workCenter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "workCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "workCenter_departmentId_fkey"
+ columns: ["departmentId"]
+ isOneToOne: false
+ referencedRelation: "department"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_requiredAbilityId_fkey"
+ columns: ["requiredAbilityId"]
+ isOneToOne: false
+ referencedRelation: "ability"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ workCentersWithBlockingStatus: {
+ Row: {
+ active: boolean | null
+ blockingDispatchId: string | null
+ blockingDispatchReadableId: string | null
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ customFields: Json | null
+ defaultStandardFactor: Database["public"]["Enums"]["factor"] | null
+ departmentId: string | null
+ description: string | null
+ id: string | null
+ isBlocked: boolean | null
+ laborRate: number | null
+ locationId: string | null
+ locationName: string | null
+ machineRate: number | null
+ name: string | null
+ overheadRate: number | null
+ requiredAbilityId: string | null
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "workCenter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "workCenter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "workCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "workCenter_departmentId_fkey"
+ columns: ["departmentId"]
+ isOneToOne: false
+ referencedRelation: "department"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_requiredAbilityId_fkey"
+ columns: ["requiredAbilityId"]
+ isOneToOne: false
+ referencedRelation: "ability"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ }
+ Functions: {
+ _xid_machine_id: { Args: never; Returns: number }
+ accountTreeBalances: {
+ Args: {
+ from_date?: string
+ p_company_group_id: string
+ to_date?: string
+ }
+ Returns: {
+ accountId: string
+ balance: number
+ balanceAtDate: number
+ netChange: number
+ }[]
+ }
+ accountTreeBalancesByCompany: {
+ Args: {
+ from_date?: string
+ p_company_group_id: string
+ p_company_id?: string
+ to_date?: string
+ }
+ Returns: {
+ accountId: string
+ balance: number
+ balanceAtDate: number
+ netChange: number
+ }[]
+ }
+ attach_event_trigger:
+ | {
+ Args: { sync_functions?: string[]; table_name_text: string }
+ Returns: undefined
+ }
+ | {
+ Args: {
+ after_sync_functions?: string[]
+ sync_functions?: string[]
+ table_name_text: string
+ }
+ Returns: undefined
+ }
+ backflush_job_materials: {
+ Args: {
+ p_company_id: string
+ p_job_id: string
+ p_quantity_complete: number
+ p_user_id: string
+ }
+ Returns: undefined
+ }
+ calculate_quantity_to_order: {
+ Args: {
+ p_demand_accumulation_period: number
+ p_demand_accumulation_safety_stock: number
+ p_lot_size: number
+ p_maximum_inventory_quantity: number
+ p_maximum_order_quantity: number
+ p_minimum_order_quantity: number
+ p_order_multiple: number
+ p_projections: number[]
+ p_reorder_point: number
+ p_reorder_quantity: number
+ p_reordering_policy: Database["public"]["Enums"]["itemReorderingPolicy"]
+ }
+ Returns: number
+ }
+ check_api_key_rate_limit: {
+ Args: { p_api_key_id: string; p_limit: number; p_window: string }
+ Returns: Json
+ }
+ check_operation_dependencies: {
+ Args: { operation_id: string }
+ Returns: boolean
+ }
+ complete_job_to_inventory: {
+ Args: {
+ p_company_id?: string
+ p_job_id: string
+ p_location_id?: string
+ p_quantity_complete: number
+ p_storage_unit_id?: string
+ p_user_id?: string
+ }
+ Returns: undefined
+ }
+ create_audit_log_table: {
+ Args: { p_company_id: string }
+ Returns: undefined
+ }
+ create_company_search_index: {
+ Args: { p_company_id: string }
+ Returns: undefined
+ }
+ create_embedding_subscriptions_for_company: {
+ Args: { p_company_id: string }
+ Returns: undefined
+ }
+ create_event_system_subscription: {
+ Args: {
+ p_active?: boolean
+ p_company_id: string
+ p_config?: Json
+ p_filter?: Json
+ p_handler_type: string
+ p_name: string
+ p_operations: string[]
+ p_table: string
+ }
+ Returns: {
+ handlerType: string
+ id: string
+ name: string
+ table: string
+ }[]
+ }
+ create_rfq_from_model_v1: {
+ Args: {
+ company_id: string
+ customer_part_id: string
+ email: string
+ model_id: string
+ notes?: Json
+ sequence_number: string
+ unit_of_measure: string
+ }
+ Returns: {
+ rfq_id: string
+ rfq_line_id: string
+ rfq_readable_id: string
+ }[]
+ }
+ create_rfq_from_models_v1: {
+ Args: {
+ company_id: string
+ email: string
+ model_data: Json[]
+ sequence_number: string
+ }
+ Returns: {
+ rfq_id: string
+ rfq_line_ids: string[]
+ rfq_readable_id: string
+ }[]
+ }
+ create_rfq_from_models_v2: {
+ Args: {
+ company_id: string
+ email: string
+ model_data: Json[]
+ sequence_number: string
+ }
+ Returns: {
+ rfq_id: string
+ rfq_line_ids: string[]
+ rfq_readable_id: string
+ }[]
+ }
+ create_search_subscriptions_for_company: {
+ Args: { p_company_id: string }
+ Returns: undefined
+ }
+ delete_event_system_subscription: {
+ Args: { p_subscription_id: string }
+ Returns: undefined
+ }
+ delete_event_system_subscriptions_by_name: {
+ Args: { p_company_id: string; p_name: string }
+ Returns: undefined
+ }
+ delete_from_search_index: {
+ Args: {
+ p_company_id: string
+ p_entity_id: string
+ p_entity_type: string
+ }
+ Returns: undefined
+ }
+ delete_old_audit_logs: {
+ Args: { p_company_id: string; p_cutoff_date: string }
+ Returns: number
+ }
+ drop_audit_log_table: {
+ Args: { p_company_id: string }
+ Returns: undefined
+ }
+ drop_company_search_index: {
+ Args: { p_company_id: string }
+ Returns: undefined
+ }
+ employee_requires_period: {
+ Args: { employee_start_date: string; period: string }
+ Returns: boolean
+ }
+ findLowestCommonParent: {
+ Args: { p_company_a: string; p_company_b: string }
+ Returns: string
+ }
+ generateEliminationEntries: {
+ Args: { p_company_group_id: string; p_user_id: string }
+ Returns: number
+ }
+ get_action_tasks_by_item_and_process: {
+ Args: { p_company_id: string; p_item_id: string; p_process_id: string }
+ Returns: {
+ actionTypeName: string
+ assignee: string
+ id: string
+ nonConformanceId: string
+ notes: Json
+ }[]
+ }
+ get_active_job_count: {
+ Args: { company_id: string; employee_id: string }
+ Returns: number
+ }
+ get_active_job_operations_by_employee: {
+ Args: { company_id: string; employee_id: string }
+ Returns: {
+ assignee: string
+ description: string
+ id: string
+ itemDescription: string
+ itemReadableId: string
+ jobCustomerId: string
+ jobDeadlineType: Database["public"]["Enums"]["deadlineType"]
+ jobDueDate: string
+ jobId: string
+ jobReadableId: string
+ jobStatus: Database["public"]["Enums"]["jobStatus"]
+ laborTime: number
+ laborUnit: Database["public"]["Enums"]["factor"]
+ machineTime: number
+ machineUnit: Database["public"]["Enums"]["factor"]
+ operationDueDate: string
+ operationOrder: number
+ operationOrderType: Database["public"]["Enums"]["methodOperationOrder"]
+ operationQuantity: number
+ operationStatus: Database["public"]["Enums"]["jobOperationStatus"]
+ parentMaterialId: string
+ processId: string
+ quantityComplete: number
+ quantityScrapped: number
+ salesOrderId: string
+ salesOrderLineId: string
+ salesOrderReadableId: string
+ setupTime: number
+ setupUnit: Database["public"]["Enums"]["factor"]
+ tags: string[]
+ targetQuantity: number
+ thumbnailPath: string
+ workCenterId: string
+ }[]
+ }
+ get_active_job_operations_by_location: {
+ Args: { location_id: string; work_center_ids: string[] }
+ Returns: {
+ assignee: string
+ customerName: string
+ description: string
+ id: string
+ itemDescription: string
+ itemReadableId: string
+ jobCustomerId: string
+ jobDeadlineType: Database["public"]["Enums"]["deadlineType"]
+ jobDueDate: string
+ jobId: string
+ jobMakeMethodId: string
+ jobReadableId: string
+ jobStatus: Database["public"]["Enums"]["jobStatus"]
+ laborTime: number
+ laborUnit: Database["public"]["Enums"]["factor"]
+ machineTime: number
+ machineUnit: Database["public"]["Enums"]["factor"]
+ operationDueDate: string
+ operationOrder: number
+ operationOrderType: Database["public"]["Enums"]["methodOperationOrder"]
+ operationQuantity: number
+ operationStatus: Database["public"]["Enums"]["jobOperationStatus"]
+ parentMaterialId: string
+ priority: number
+ processId: string
+ quantityComplete: number
+ quantityReworked: number
+ quantityScrapped: number
+ reworkId: string
+ salesOrderId: string
+ salesOrderLineId: string
+ salesOrderReadableId: string
+ setupTime: number
+ setupUnit: Database["public"]["Enums"]["factor"]
+ tags: string[]
+ targetQuantity: number
+ thumbnailPath: string
+ workCenterId: string
+ }[]
+ }
+ get_api_key_scopes: { Args: never; Returns: Json }
+ get_assigned_job_operations: {
+ Args: { company_id: string; user_id: string }
+ Returns: {
+ assignee: string
+ description: string
+ id: string
+ itemDescription: string
+ itemReadableId: string
+ jobCustomerId: string
+ jobDeadlineType: Database["public"]["Enums"]["deadlineType"]
+ jobDueDate: string
+ jobId: string
+ jobReadableId: string
+ jobStatus: Database["public"]["Enums"]["jobStatus"]
+ laborTime: number
+ laborUnit: Database["public"]["Enums"]["factor"]
+ machineTime: number
+ machineUnit: Database["public"]["Enums"]["factor"]
+ operationDueDate: string
+ operationOrder: number
+ operationOrderType: Database["public"]["Enums"]["methodOperationOrder"]
+ operationQuantity: number
+ operationStatus: Database["public"]["Enums"]["jobOperationStatus"]
+ parentMaterialId: string
+ processId: string
+ quantityComplete: number
+ quantityScrapped: number
+ salesOrderId: string
+ salesOrderLineId: string
+ salesOrderReadableId: string
+ setupTime: number
+ setupUnit: Database["public"]["Enums"]["factor"]
+ tags: string[]
+ targetQuantity: number
+ thumbnailPath: string
+ workCenterId: string
+ }[]
+ }
+ get_audit_log: {
+ Args: {
+ p_actor_id?: string
+ p_company_id: string
+ p_end_date?: string
+ p_entity_id?: string
+ p_entity_type?: string
+ p_limit?: number
+ p_offset?: number
+ p_operation?: string
+ p_search?: string
+ p_start_date?: string
+ }
+ Returns: {
+ actorId: string
+ createdAt: string
+ diff: Json
+ entityId: string
+ entityType: string
+ id: string
+ metadata: Json
+ operation: string
+ tableName: string
+ totalCount: number
+ }[]
+ }
+ get_audit_log_count: {
+ Args: {
+ p_actor_id?: string
+ p_company_id: string
+ p_end_date?: string
+ p_entity_type?: string
+ p_operation?: string
+ p_search?: string
+ p_start_date?: string
+ }
+ Returns: number
+ }
+ get_audit_logs_for_archive: {
+ Args: { p_before_date: string; p_company_id: string }
+ Returns: {
+ actorId: string
+ createdAt: string
+ diff: Json
+ entityId: string
+ entityType: string
+ id: string
+ metadata: Json
+ operation: string
+ tableName: string
+ }[]
+ }
+ get_claims: { Args: { company: string; uid: string }; Returns: Json }
+ get_companies_with_any_role: { Args: never; Returns: string[] }
+ get_companies_with_employee_permission: {
+ Args: { permission: string }
+ Returns: string[]
+ }
+ get_companies_with_employee_role: { Args: never; Returns: string[] }
+ get_companies_with_permission: {
+ Args: { permission: string }
+ Returns: string[]
+ }
+ get_company_groups_for_employee: { Args: never; Returns: string[] }
+ get_company_groups_for_root_permission: {
+ Args: { permission: string }
+ Returns: string[]
+ }
+ get_company_id_from_api_key: { Args: never; Returns: string }
+ get_company_id_from_foreign_key: {
+ Args: { foreign_key: string; tbl: string }
+ Returns: string
+ }
+ get_consumable_details: {
+ Args: { item_id: string }
+ Returns: {
+ active: boolean
+ assignee: string
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json
+ defaultMethodType: Database["public"]["Enums"]["methodType"]
+ description: string
+ id: string
+ itemPostingGroupId: string
+ itemTrackingType: Database["public"]["Enums"]["itemTrackingType"]
+ modelName: string
+ modelPath: string
+ modelSize: number
+ modelUploadId: string
+ name: string
+ notes: Json
+ readableId: string
+ readableIdWithRevision: string
+ replenishmentSystem: Database["public"]["Enums"]["itemReplenishmentSystem"]
+ requiresInspection: boolean
+ revision: string
+ revisions: Json
+ supplierIds: string
+ tags: string[]
+ thumbnailPath: string
+ unitOfMeasure: string
+ unitOfMeasureCode: string
+ updatedAt: string
+ updatedBy: string
+ }[]
+ }
+ get_current_training_period: {
+ Args: { frequency: Database["public"]["Enums"]["trainingFrequency"] }
+ Returns: string
+ }
+ get_custom_field_unique_values: {
+ Args: { company_id: string; field_key: string; table_name: string }
+ Returns: {
+ value: Json
+ }[]
+ }
+ get_customer_ids_with_customer_permission: {
+ Args: { permission: string }
+ Returns: string[]
+ }
+ get_direct_ancestors_of_tracked_entities_strict: {
+ Args: { p_tracked_entity_ids: string[] }
+ Returns: {
+ activityAttributes: Json
+ attributes: Json
+ id: string
+ quantity: number
+ readableId: string
+ sourceDocument: string
+ sourceDocumentId: string
+ sourceDocumentReadableId: string
+ sourceEntityId: string
+ status: Database["public"]["Enums"]["trackedEntityStatus"]
+ trackedActivityId: string
+ }[]
+ }
+ get_direct_ancestors_of_tracked_entity: {
+ Args: { p_tracked_entity_id: string }
+ Returns: {
+ activityAttributes: Json
+ attributes: Json
+ id: string
+ quantity: number
+ readableId: string
+ sourceDocument: string
+ sourceDocumentId: string
+ sourceDocumentReadableId: string
+ status: Database["public"]["Enums"]["trackedEntityStatus"]
+ trackedActivityId: string
+ }[]
+ }
+ get_direct_ancestors_of_tracked_entity_strict: {
+ Args: { p_tracked_entity_id: string }
+ Returns: {
+ activityAttributes: Json
+ attributes: Json
+ id: string
+ quantity: number
+ readableId: string
+ sourceDocument: string
+ sourceDocumentId: string
+ sourceDocumentReadableId: string
+ status: Database["public"]["Enums"]["trackedEntityStatus"]
+ trackedActivityId: string
+ }[]
+ }
+ get_direct_descendants_of_tracked_entities_strict: {
+ Args: { p_tracked_entity_ids: string[] }
+ Returns: {
+ activityAttributes: Json
+ attributes: Json
+ id: string
+ quantity: number
+ readableId: string
+ sourceDocument: string
+ sourceDocumentId: string
+ sourceDocumentReadableId: string
+ sourceEntityId: string
+ status: Database["public"]["Enums"]["trackedEntityStatus"]
+ trackedActivityId: string
+ }[]
+ }
+ get_direct_descendants_of_tracked_entity: {
+ Args: { p_tracked_entity_id: string }
+ Returns: {
+ activityAttributes: Json
+ attributes: Json
+ id: string
+ quantity: number
+ readableId: string
+ sourceDocument: string
+ sourceDocumentId: string
+ sourceDocumentReadableId: string
+ status: Database["public"]["Enums"]["trackedEntityStatus"]
+ trackedActivityId: string
+ }[]
+ }
+ get_direct_descendants_of_tracked_entity_strict: {
+ Args: { p_tracked_entity_id: string }
+ Returns: {
+ activityAttributes: Json
+ attributes: Json
+ id: string
+ quantity: number
+ readableId: string
+ sourceDocument: string
+ sourceDocumentId: string
+ sourceDocumentReadableId: string
+ status: Database["public"]["Enums"]["trackedEntityStatus"]
+ trackedActivityId: string
+ }[]
+ }
+ get_entity_audit_log: {
+ Args: {
+ p_company_id: string
+ p_entity_id: string
+ p_entity_type: string
+ p_limit?: number
+ p_offset?: number
+ p_record_id?: string
+ }
+ Returns: {
+ actorId: string
+ createdAt: string
+ diff: Json
+ entityId: string
+ entityType: string
+ id: string
+ metadata: Json
+ operation: string
+ recordId: string
+ tableName: string
+ }[]
+ }
+ get_inventory_quantities: {
+ Args: { company_id: string; location_id: string }
+ Returns: {
+ active: boolean
+ daysRemaining: number
+ demandAccumulationPeriod: number
+ demandAccumulationSafetyStock: number
+ demandForecast: number
+ dimension: string
+ dimensionId: string
+ finish: string
+ finishId: string
+ grade: string
+ gradeId: string
+ id: string
+ itemTrackingType: Database["public"]["Enums"]["itemTrackingType"]
+ leadTime: number
+ lotSize: number
+ materialFormId: string
+ materialSubstanceId: string
+ materialType: string
+ materialTypeId: string
+ maximumInventoryQuantity: number
+ maximumOrderQuantity: number
+ minimumOrderQuantity: number
+ name: string
+ orderMultiple: number
+ quantityOnHand: number
+ quantityOnHold: number
+ quantityOnProductionDemand: number
+ quantityOnProductionOrder: number
+ quantityOnPurchaseOrder: number
+ quantityOnSalesOrder: number
+ quantityRejected: number
+ readableId: string
+ readableIdWithRevision: string
+ reorderingPolicy: Database["public"]["Enums"]["itemReorderingPolicy"]
+ reorderPoint: number
+ reorderQuantity: number
+ replenishmentSystem: Database["public"]["Enums"]["itemReplenishmentSystem"]
+ storageTypeIds: string[]
+ storageUnitIds: string[]
+ thumbnailPath: string
+ type: Database["public"]["Enums"]["itemType"]
+ unitOfMeasureCode: string
+ usageLast30Days: number
+ usageLast90Days: number
+ }[]
+ }
+ get_inventory_value_by_location: {
+ Args: { company_id: string }
+ Returns: {
+ itemName: string
+ itemReadableId: string
+ locationName: string
+ quantityOnHand: number
+ replenishmentSystem: Database["public"]["Enums"]["itemReplenishmentSystem"]
+ totalValue: number
+ unitCost: number
+ unitOfMeasureCode: string
+ }[]
+ }
+ get_item_quantities_by_tracking_id: {
+ Args: { company_id: string; item_id: string; location_id: string }
+ Returns: {
+ itemId: string
+ quantity: number
+ readableId: string
+ storageUnitId: string
+ storageUnitName: string
+ trackedEntityId: string
+ }[]
+ }
+ get_item_storage_unit_requirements_by_location: {
+ Args: { company_id: string; location_id: string }
+ Returns: {
+ description: string
+ isDefaultStorageUnit: boolean
+ itemId: string
+ itemReadableId: string
+ itemTrackingType: Database["public"]["Enums"]["itemTrackingType"]
+ name: string
+ quantityIncoming: number
+ quantityOnHandInStorageUnit: number
+ quantityRequiredByStorageUnit: number
+ storageUnitId: string
+ storageUnitName: string
+ thumbnailPath: string
+ type: Database["public"]["Enums"]["itemType"]
+ unitOfMeasureCode: string
+ }[]
+ }
+ get_item_storage_unit_requirements_by_location_and_item: {
+ Args: { company_id: string; item_id?: string; location_id: string }
+ Returns: {
+ description: string
+ isDefaultStorageUnit: boolean
+ itemId: string
+ itemReadableId: string
+ itemTrackingType: Database["public"]["Enums"]["itemTrackingType"]
+ name: string
+ quantityIncoming: number
+ quantityOnHandInStorageUnit: number
+ quantityRequiredByStorageUnit: number
+ storageUnitId: string
+ storageUnitName: string
+ thumbnailPath: string
+ type: Database["public"]["Enums"]["itemType"]
+ unitOfMeasureCode: string
+ }[]
+ }
+ get_job_method: {
+ Args: { jid: string }
+ Returns: {
+ description: string
+ isRoot: boolean
+ itemId: string
+ itemReadableId: string
+ itemType: string
+ jobId: string
+ jobMakeMethodId: string
+ jobMaterialMakeMethodId: string
+ kit: boolean
+ methodMaterialId: string
+ methodType: Database["public"]["Enums"]["methodType"]
+ order: number
+ parentMaterialId: string
+ quantity: number
+ revision: string
+ storageUnitId: string
+ unitCost: number
+ version: number
+ }[]
+ }
+ get_job_methods_by_method_id: {
+ Args: { mid: string }
+ Returns: {
+ description: string
+ isRoot: boolean
+ itemId: string
+ itemReadableId: string
+ itemType: string
+ jobId: string
+ jobMakeMethodId: string
+ jobMaterialMakeMethodId: string
+ kit: boolean
+ methodMaterialId: string
+ methodType: Database["public"]["Enums"]["methodType"]
+ order: number
+ parentMaterialId: string
+ quantity: number
+ storageUnitId: string
+ unitCost: number
+ unitOfMeasureCode: string
+ }[]
+ }
+ get_job_operation_by_id: {
+ Args: { operation_id: string }
+ Returns: {
+ description: string
+ id: string
+ itemDescription: string
+ itemId: string
+ itemModelId: string
+ itemModelName: string
+ itemModelPath: string
+ itemModelSize: number
+ itemReadableId: string
+ itemUnitOfMeasure: string
+ jobDeadlineType: Database["public"]["Enums"]["deadlineType"]
+ jobDueDate: string
+ jobId: string
+ jobMakeMethodId: string
+ jobReadableId: string
+ jobStatus: Database["public"]["Enums"]["jobStatus"]
+ laborTime: number
+ laborUnit: Database["public"]["Enums"]["factor"]
+ machineTime: number
+ machineUnit: Database["public"]["Enums"]["factor"]
+ operationDueDate: string
+ operationOrder: number
+ operationOrderType: Database["public"]["Enums"]["methodOperationOrder"]
+ operationQuantity: number
+ operationStatus: Database["public"]["Enums"]["jobOperationStatus"]
+ parentMaterialId: string
+ processId: string
+ quantityComplete: number
+ quantityReworked: number
+ quantityScrapped: number
+ reworkId: string
+ setupTime: number
+ setupUnit: Database["public"]["Enums"]["factor"]
+ targetQuantity: number
+ workCenterId: string
+ workInstruction: Json
+ }[]
+ }
+ get_job_operation_step_records: {
+ Args: { p_job_id: string }
+ Returns: {
+ booleanValue: boolean
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ index: number
+ itemId: string
+ itemReadableId: string
+ jobOperationStepId: string
+ maxValue: number
+ minValue: number
+ name: string
+ numericValue: number
+ operationDescription: string
+ operationId: string
+ type: Database["public"]["Enums"]["procedureStepType"]
+ unitOfMeasureCode: string
+ updatedAt: string
+ updatedBy: string
+ userValue: string
+ value: string
+ }[]
+ }
+ get_job_operations_by_work_center: {
+ Args: { location_id: string; work_center_id: string }
+ Returns: {
+ description: string
+ id: string
+ itemReadableId: string
+ jobDeadlineType: Database["public"]["Enums"]["deadlineType"]
+ jobDueDate: string
+ jobId: string
+ jobReadableId: string
+ jobStatus: Database["public"]["Enums"]["jobStatus"]
+ laborTime: number
+ laborUnit: Database["public"]["Enums"]["factor"]
+ machineTime: number
+ machineUnit: Database["public"]["Enums"]["factor"]
+ operationOrder: number
+ operationOrderType: Database["public"]["Enums"]["methodOperationOrder"]
+ operationQuantity: number
+ operationStatus: Database["public"]["Enums"]["jobOperationStatus"]
+ parentMaterialId: string
+ processId: string
+ quantityComplete: number
+ quantityScrapped: number
+ setupTime: number
+ setupUnit: Database["public"]["Enums"]["factor"]
+ workCenterId: string
+ }[]
+ }
+ get_job_quantity_on_hand: {
+ Args: { company_id: string; job_id: string; location_id: string }
+ Returns: {
+ description: string
+ estimatedQuantity: number
+ id: string
+ itemReadableId: string
+ itemTrackingType: Database["public"]["Enums"]["itemTrackingType"]
+ jobMakeMethodId: string
+ jobMaterialItemId: string
+ methodType: Database["public"]["Enums"]["methodType"]
+ name: string
+ quantityFromProductionOrderInStorageUnit: number
+ quantityFromProductionOrderNotInStorageUnit: number
+ quantityInTransitToStorageUnit: number
+ quantityIssued: number
+ quantityOnHandInStorageUnit: number
+ quantityOnHandNotInStorageUnit: number
+ quantityOnProductionOrder: number
+ quantityOnPurchaseOrder: number
+ quantityOnSalesOrder: number
+ quantityPerParent: number
+ storageUnitId: string
+ storageUnitName: string
+ thumbnailPath: string
+ type: Database["public"]["Enums"]["itemType"]
+ unitOfMeasureCode: string
+ }[]
+ }
+ get_jobs_by_date_range: {
+ Args: { end_date: string; location_id: string; start_date: string }
+ Returns: {
+ assignee: string
+ completedDate: string
+ completedOperationCount: number
+ customerId: string
+ customerName: string
+ deadlineType: Database["public"]["Enums"]["deadlineType"]
+ dueDate: string
+ hasConflict: boolean
+ id: string
+ itemDescription: string
+ itemId: string
+ itemReadableId: string
+ jobId: string
+ jobMakeMethodId: string
+ operationCount: number
+ priority: number
+ quantity: number
+ quantityComplete: number
+ quantityShipped: number
+ salesOrderId: string
+ salesOrderLineId: string
+ salesOrderReadableId: string
+ status: Database["public"]["Enums"]["jobStatus"]
+ tags: string[]
+ thumbnailPath: string
+ }[]
+ }
+ get_maintenance_dispatches_by_location: {
+ Args: { p_company_id: string; p_location_id: string }
+ Returns: {
+ actualEndTime: string
+ actualFailureModeId: string
+ actualStartTime: string
+ assignee: string
+ companyId: string
+ completedAt: string
+ content: Json
+ createdAt: string
+ createdBy: string
+ duration: number
+ id: string
+ locationId: string
+ locationName: string
+ maintenanceDispatchId: string
+ maintenanceScheduleId: string
+ nonConformanceId: string
+ oeeImpact: Database["public"]["Enums"]["oeeImpact"]
+ plannedEndTime: string
+ plannedStartTime: string
+ priority: Database["public"]["Enums"]["maintenanceDispatchPriority"]
+ severity: Database["public"]["Enums"]["maintenanceSeverity"]
+ source: Database["public"]["Enums"]["maintenanceSource"]
+ status: Database["public"]["Enums"]["maintenanceDispatchStatus"]
+ suspectedFailureModeId: string
+ updatedAt: string
+ updatedBy: string
+ workCenterId: string
+ workCenterName: string
+ }[]
+ }
+ get_maintenance_schedules_by_location: {
+ Args: { p_company_id: string; p_location_id: string }
+ Returns: {
+ active: boolean
+ companyId: string
+ createdAt: string
+ createdBy: string
+ description: string
+ estimatedDuration: number
+ frequency: Database["public"]["Enums"]["maintenanceFrequency"]
+ friday: boolean
+ id: string
+ lastGeneratedAt: string
+ locationId: string
+ locationName: string
+ monday: boolean
+ name: string
+ nextDueAt: string
+ priority: Database["public"]["Enums"]["maintenanceDispatchPriority"]
+ saturday: boolean
+ sunday: boolean
+ thursday: boolean
+ tuesday: boolean
+ updatedAt: string
+ updatedBy: string
+ wednesday: boolean
+ workCenterId: string
+ workCenterName: string
+ }[]
+ }
+ get_material_details: {
+ Args: { item_id: string }
+ Returns: {
+ active: boolean
+ assignee: string
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json
+ defaultMethodType: Database["public"]["Enums"]["methodType"]
+ description: string
+ dimensionId: string
+ dimensions: string
+ finish: string
+ finishId: string
+ grade: string
+ gradeId: string
+ id: string
+ itemPostingGroupId: string
+ itemTrackingType: Database["public"]["Enums"]["itemTrackingType"]
+ materialForm: string
+ materialFormId: string
+ materialSubstance: string
+ materialSubstanceId: string
+ materialType: string
+ materialTypeId: string
+ modelName: string
+ modelPath: string
+ modelSize: number
+ modelUploadId: string
+ name: string
+ notes: Json
+ readableId: string
+ readableIdWithRevision: string
+ replenishmentSystem: Database["public"]["Enums"]["itemReplenishmentSystem"]
+ requiresInspection: boolean
+ revision: string
+ revisions: Json
+ supplierIds: string
+ tags: string[]
+ thumbnailPath: string
+ unitOfMeasure: string
+ unitOfMeasureCode: string
+ updatedAt: string
+ updatedBy: string
+ }[]
+ }
+ get_material_naming_details: {
+ Args: { readable_id: string }
+ Returns: {
+ dimensions: string
+ finish: string
+ grade: string
+ id: string
+ materialType: string
+ materialTypeCode: string
+ shape: string
+ shapeCode: string
+ substance: string
+ substanceCode: string
+ }[]
+ }
+ get_method_tree: {
+ Args: { uid: string }
+ Returns: {
+ description: string
+ externalId: Json
+ isPickDescendant: boolean
+ isRoot: boolean
+ itemId: string
+ itemReadableId: string
+ itemTrackingType: string
+ itemType: string
+ kit: boolean
+ makeMethodId: string
+ materialMakeMethodId: string
+ methodMaterialId: string
+ methodType: Database["public"]["Enums"]["methodType"]
+ operationId: string
+ order: number
+ parentMaterialId: string
+ quantity: number
+ replenishmentSystem: Database["public"]["Enums"]["itemReplenishmentSystem"]
+ revision: string
+ storageUnitIds: Json
+ unitCost: number
+ unitOfMeasureCode: string
+ version: number
+ }[]
+ }
+ get_my_claim: { Args: { claim: string }; Returns: Json }
+ get_my_permission: { Args: { claim: string }; Returns: Json }
+ get_next_numeric_sequence: {
+ Args: {
+ company_id: string
+ item_type: Database["public"]["Enums"]["itemType"]
+ }
+ Returns: string
+ }
+ get_next_prefixed_sequence: {
+ Args: {
+ company_id: string
+ item_type: Database["public"]["Enums"]["itemType"]
+ prefix: string
+ }
+ Returns: string
+ }
+ get_next_sequence: {
+ Args: { company_id: string; sequence_name: string }
+ Returns: string
+ }
+ get_opportunity_with_related_records: {
+ Args: { opportunity_id: string }
+ Returns: {
+ companyId: string
+ customerId: string
+ id: string
+ purchaseOrderDocumentPath: string
+ quotes: Json
+ requestForQuoteDocumentPath: string
+ salesOrders: Json
+ salesRfqs: Json
+ }[]
+ }
+ get_part_details: {
+ Args: { item_id: string }
+ Returns: {
+ active: boolean
+ assignee: string
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json
+ defaultMethodType: Database["public"]["Enums"]["methodType"]
+ description: string
+ id: string
+ itemPostingGroupId: string
+ itemTrackingType: Database["public"]["Enums"]["itemTrackingType"]
+ modelId: string
+ modelName: string
+ modelPath: string
+ modelSize: number
+ name: string
+ notes: Json
+ readableId: string
+ readableIdWithRevision: string
+ replenishmentSystem: Database["public"]["Enums"]["itemReplenishmentSystem"]
+ requiresInspection: boolean
+ revision: string
+ revisions: Json
+ tags: string[]
+ thumbnailPath: string
+ unitOfMeasure: string
+ unitOfMeasureCode: string
+ updatedAt: string
+ updatedBy: string
+ }[]
+ }
+ get_period_end_date: { Args: { period: string }; Returns: string }
+ get_period_start_date: { Args: { period: string }; Returns: string }
+ get_permission_companies: { Args: { claim: string }; Returns: string[] }
+ get_primary_key_column: {
+ Args: { p_table_name: string }
+ Returns: string
+ }
+ get_production_planning: {
+ Args: { company_id: string; location_id: string; periods: string[] }
+ Returns: {
+ active: boolean
+ demandAccumulationPeriod: number
+ demandAccumulationSafetyStock: number
+ id: string
+ itemTrackingType: Database["public"]["Enums"]["itemTrackingType"]
+ leadTime: number
+ lotSize: number
+ manufacturingBlocked: boolean
+ maximumInventoryQuantity: number
+ maximumOrderQuantity: number
+ minimumOrderQuantity: number
+ name: string
+ orderMultiple: number
+ quantityOnHand: number
+ quantityToOrder: number
+ readableIdWithRevision: string
+ reorderingPolicy: Database["public"]["Enums"]["itemReorderingPolicy"]
+ reorderPoint: number
+ reorderQuantity: number
+ replenishmentSystem: Database["public"]["Enums"]["itemReplenishmentSystem"]
+ thumbnailPath: string
+ type: Database["public"]["Enums"]["itemType"]
+ unitOfMeasureCode: string
+ week1: number
+ week10: number
+ week11: number
+ week12: number
+ week13: number
+ week14: number
+ week15: number
+ week16: number
+ week17: number
+ week18: number
+ week19: number
+ week2: number
+ week20: number
+ week21: number
+ week22: number
+ week23: number
+ week24: number
+ week25: number
+ week26: number
+ week27: number
+ week28: number
+ week29: number
+ week3: number
+ week30: number
+ week31: number
+ week32: number
+ week33: number
+ week34: number
+ week35: number
+ week36: number
+ week37: number
+ week38: number
+ week39: number
+ week4: number
+ week40: number
+ week41: number
+ week42: number
+ week43: number
+ week44: number
+ week45: number
+ week46: number
+ week47: number
+ week48: number
+ week49: number
+ week5: number
+ week50: number
+ week51: number
+ week52: number
+ week6: number
+ week7: number
+ week8: number
+ week9: number
+ }[]
+ }
+ get_production_projections: {
+ Args: { company_id: string; location_id: string; periods: string[] }
+ Returns: {
+ active: boolean
+ demandAccumulationPeriod: number
+ demandAccumulationSafetyStock: number
+ id: string
+ itemTrackingType: Database["public"]["Enums"]["itemTrackingType"]
+ leadTime: number
+ lotSize: number
+ manufacturingBlocked: boolean
+ maximumInventoryQuantity: number
+ maximumOrderQuantity: number
+ minimumOrderQuantity: number
+ name: string
+ orderMultiple: number
+ quantityOnHand: number
+ readableIdWithRevision: string
+ reorderingPolicy: Database["public"]["Enums"]["itemReorderingPolicy"]
+ reorderPoint: number
+ reorderQuantity: number
+ replenishmentSystem: Database["public"]["Enums"]["itemReplenishmentSystem"]
+ thumbnailPath: string
+ type: Database["public"]["Enums"]["itemType"]
+ unitOfMeasureCode: string
+ week1: number
+ week10: number
+ week11: number
+ week12: number
+ week13: number
+ week14: number
+ week15: number
+ week16: number
+ week17: number
+ week18: number
+ week19: number
+ week2: number
+ week20: number
+ week21: number
+ week22: number
+ week23: number
+ week24: number
+ week25: number
+ week26: number
+ week27: number
+ week28: number
+ week29: number
+ week3: number
+ week30: number
+ week31: number
+ week32: number
+ week33: number
+ week34: number
+ week35: number
+ week36: number
+ week37: number
+ week38: number
+ week39: number
+ week4: number
+ week40: number
+ week41: number
+ week42: number
+ week43: number
+ week44: number
+ week45: number
+ week46: number
+ week47: number
+ week48: number
+ week49: number
+ week5: number
+ week50: number
+ week51: number
+ week52: number
+ week6: number
+ week7: number
+ week8: number
+ week9: number
+ }[]
+ }
+ get_purchasing_planning: {
+ Args: { company_id: string; location_id: string; periods: string[] }
+ Returns: {
+ active: boolean
+ conversionFactor: number
+ demandAccumulationPeriod: number
+ demandAccumulationSafetyStock: number
+ id: string
+ itemTrackingType: Database["public"]["Enums"]["itemTrackingType"]
+ leadTime: number
+ lotSize: number
+ maximumInventoryQuantity: number
+ maximumOrderQuantity: number
+ minimumOrderQuantity: number
+ name: string
+ orderMultiple: number
+ preferredSupplierId: string
+ purchasingBlocked: boolean
+ purchasingUnitOfMeasureCode: string
+ quantityOnHand: number
+ quantityToOrder: number
+ readableIdWithRevision: string
+ reorderingPolicy: Database["public"]["Enums"]["itemReorderingPolicy"]
+ reorderPoint: number
+ reorderQuantity: number
+ replenishmentSystem: Database["public"]["Enums"]["itemReplenishmentSystem"]
+ suppliers: Json
+ thumbnailPath: string
+ type: Database["public"]["Enums"]["itemType"]
+ unitOfMeasureCode: string
+ week1: number
+ week10: number
+ week11: number
+ week12: number
+ week13: number
+ week14: number
+ week15: number
+ week16: number
+ week17: number
+ week18: number
+ week19: number
+ week2: number
+ week20: number
+ week21: number
+ week22: number
+ week23: number
+ week24: number
+ week25: number
+ week26: number
+ week27: number
+ week28: number
+ week29: number
+ week3: number
+ week30: number
+ week31: number
+ week32: number
+ week33: number
+ week34: number
+ week35: number
+ week36: number
+ week37: number
+ week38: number
+ week39: number
+ week4: number
+ week40: number
+ week41: number
+ week42: number
+ week43: number
+ week44: number
+ week45: number
+ week46: number
+ week47: number
+ week48: number
+ week49: number
+ week5: number
+ week50: number
+ week51: number
+ week52: number
+ week6: number
+ week7: number
+ week8: number
+ week9: number
+ }[]
+ }
+ get_quote_methods: {
+ Args: { qid: string }
+ Returns: {
+ description: string
+ externalId: Json
+ isRoot: boolean
+ itemId: string
+ itemReadableId: string
+ itemType: string
+ kit: boolean
+ methodMaterialId: string
+ methodType: Database["public"]["Enums"]["methodType"]
+ order: number
+ parentMaterialId: string
+ quantity: number
+ quoteId: string
+ quoteLineId: string
+ quoteMakeMethodId: string
+ quoteMaterialMakeMethodId: string
+ revision: string
+ storageUnitId: string
+ unitCost: number
+ version: number
+ }[]
+ }
+ get_quote_methods_by_method_id: {
+ Args: { mid: string }
+ Returns: {
+ description: string
+ externalId: Json
+ isRoot: boolean
+ itemId: string
+ itemReadableId: string
+ itemTrackingType: string
+ itemType: string
+ kit: boolean
+ methodMaterialId: string
+ methodType: Database["public"]["Enums"]["methodType"]
+ order: number
+ parentMaterialId: string
+ quantity: number
+ quoteId: string
+ quoteLineId: string
+ quoteMakeMethodId: string
+ quoteMaterialMakeMethodId: string
+ revision: string
+ storageUnitId: string
+ unitCost: number
+ unitOfMeasureCode: string
+ version: number
+ }[]
+ }
+ get_radan_v1: {
+ Args: { company_id: string; processes: string[] }
+ Returns: {
+ assignee: string
+ description: string
+ id: string
+ itemDescription: string
+ itemId: string
+ itemReadableId: string
+ jobCustomerId: string
+ jobDeadlineType: Database["public"]["Enums"]["deadlineType"]
+ jobDueDate: string
+ jobId: string
+ jobLocationName: string
+ jobMakeMethodId: string
+ jobReadableId: string
+ jobStatus: Database["public"]["Enums"]["jobStatus"]
+ laborTime: number
+ laborUnit: Database["public"]["Enums"]["factor"]
+ machineTime: number
+ machineUnit: Database["public"]["Enums"]["factor"]
+ materialDimension: string
+ materialFinish: string
+ materialForm: string
+ materialGrade: string
+ materialItemDescription: string
+ materialItemReadableId: string
+ materialSubstance: string
+ operationOrder: number
+ operationOrderType: Database["public"]["Enums"]["methodOperationOrder"]
+ operationQuantity: number
+ operationStatus: Database["public"]["Enums"]["jobOperationStatus"]
+ parentMaterialId: string
+ priority: number
+ processId: string
+ quantityComplete: number
+ quantityScrapped: number
+ salesOrderId: string
+ salesOrderLineId: string
+ salesOrderReadableId: string
+ setupTime: number
+ setupUnit: Database["public"]["Enums"]["factor"]
+ tags: string[]
+ workCenterId: string
+ }[]
+ }
+ get_recent_job_operations_by_employee: {
+ Args: { company_id: string; employee_id: string }
+ Returns: {
+ assignee: string
+ description: string
+ id: string
+ itemDescription: string
+ itemReadableId: string
+ jobCustomerId: string
+ jobDeadlineType: Database["public"]["Enums"]["deadlineType"]
+ jobDueDate: string
+ jobId: string
+ jobReadableId: string
+ jobStatus: Database["public"]["Enums"]["jobStatus"]
+ laborTime: number
+ laborUnit: Database["public"]["Enums"]["factor"]
+ machineTime: number
+ machineUnit: Database["public"]["Enums"]["factor"]
+ operationDueDate: string
+ operationOrder: number
+ operationOrderType: Database["public"]["Enums"]["methodOperationOrder"]
+ operationQuantity: number
+ operationStatus: Database["public"]["Enums"]["jobOperationStatus"]
+ parentMaterialId: string
+ processId: string
+ quantityComplete: number
+ quantityScrapped: number
+ salesOrderId: string
+ salesOrderLineId: string
+ salesOrderReadableId: string
+ setupTime: number
+ setupUnit: Database["public"]["Enums"]["factor"]
+ tags: string[]
+ targetQuantity: number
+ thumbnailPath: string
+ workCenterId: string
+ }[]
+ }
+ get_sales_order_lines_by_customer_id: {
+ Args: { customer_id: string }
+ Returns: {
+ customerContactName: string
+ customerEngineeringContactName: string
+ customerId: string
+ customerReference: string
+ jobOperations: Json
+ jobProductionQuantity: number
+ jobQuantityComplete: number
+ jobQuantityShipped: number
+ jobStatus: Database["public"]["Enums"]["jobStatus"]
+ locationId: string
+ orderDate: string
+ promisedDate: string
+ quantityInvoiced: number
+ quantitySent: number
+ quantityToSend: number
+ readableId: string
+ readableIdWithRevision: string
+ receiptPromisedDate: string
+ receiptRequestedDate: string
+ revision: string
+ saleQuantity: number
+ salesOrderId: string
+ salesOrderStatus: Database["public"]["Enums"]["salesOrderStatus"]
+ thumbnailPath: string
+ unitOfMeasureCode: string
+ unitPrice: number
+ }[]
+ }
+ get_supplier_ids_with_supplier_permission: {
+ Args: { permission: string }
+ Returns: string[]
+ }
+ get_supplier_interaction_with_related_records: {
+ Args: { supplier_interaction_id: string }
+ Returns: {
+ companyId: string
+ id: string
+ purchaseInvoices: Json
+ purchaseOrders: Json
+ purchasingRfq: Json
+ supplierId: string
+ supplierQuotes: Json
+ }[]
+ }
+ get_tool_details: {
+ Args: { item_id: string }
+ Returns: {
+ active: boolean
+ assignee: string
+ companyId: string
+ createdAt: string
+ createdBy: string
+ customFields: Json
+ defaultMethodType: Database["public"]["Enums"]["methodType"]
+ description: string
+ id: string
+ itemPostingGroupId: string
+ itemTrackingType: Database["public"]["Enums"]["itemTrackingType"]
+ modelId: string
+ modelName: string
+ modelPath: string
+ modelSize: number
+ name: string
+ notes: Json
+ readableId: string
+ readableIdWithRevision: string
+ replenishmentSystem: Database["public"]["Enums"]["itemReplenishmentSystem"]
+ requiresInspection: boolean
+ revision: string
+ revisions: Json
+ tags: string[]
+ thumbnailPath: string
+ unitOfMeasure: string
+ unitOfMeasureCode: string
+ updatedAt: string
+ updatedBy: string
+ }[]
+ }
+ get_training_assignment_status: {
+ Args: { p_company_id: string }
+ Returns: {
+ avatarUrl: string
+ companyId: string
+ completedAt: string
+ completionId: number
+ currentPeriod: string
+ employeeId: string
+ employeeName: string
+ employeeStartDate: string
+ frequency: Database["public"]["Enums"]["trainingFrequency"]
+ status: string
+ trainingAssignmentId: string
+ trainingId: string
+ trainingName: string
+ trainingType: Database["public"]["Enums"]["trainingType"]
+ }[]
+ }
+ get_training_assignment_summary: {
+ Args: { p_company_id: string }
+ Returns: {
+ completed: number
+ completionPercent: number
+ currentPeriod: string
+ frequency: Database["public"]["Enums"]["trainingFrequency"]
+ overdue: number
+ pending: number
+ totalAssigned: number
+ trainingId: string
+ trainingName: string
+ }[]
+ }
+ get_training_assignments_by_user: {
+ Args: { user_id: string }
+ Returns: {
+ assignee: string
+ companyId: string
+ content: Json
+ createdAt: string
+ createdBy: string
+ description: string
+ estimatedDuration: string
+ frequency: Database["public"]["Enums"]["trainingFrequency"]
+ name: string
+ status: Database["public"]["Enums"]["trainingStatus"]
+ tags: string[]
+ trainingAssignmentId: number
+ type: Database["public"]["Enums"]["trainingType"]
+ updatedAt: string
+ updatedBy: string
+ version: number
+ }[]
+ }
+ get_unscheduled_jobs: {
+ Args: { location_id: string }
+ Returns: {
+ assignee: string
+ completedDate: string
+ completedOperationCount: number
+ customerId: string
+ customerName: string
+ deadlineType: Database["public"]["Enums"]["deadlineType"]
+ dueDate: string
+ hasConflict: boolean
+ id: string
+ itemDescription: string
+ itemId: string
+ itemReadableId: string
+ jobId: string
+ jobMakeMethodId: string
+ operationCount: number
+ priority: number
+ quantity: number
+ quantityComplete: number
+ quantityShipped: number
+ salesOrderId: string
+ salesOrderLineId: string
+ salesOrderReadableId: string
+ status: Database["public"]["Enums"]["jobStatus"]
+ tags: string[]
+ thumbnailPath: string
+ }[]
+ }
+ getIntercompanyBalance: {
+ Args: { p_company_group_id: string }
+ Returns: {
+ balance: number
+ sourceCompanyId: string
+ sourceCompanyName: string
+ targetCompanyId: string
+ targetCompanyName: string
+ }[]
+ }
+ groups_for_user: { Args: { uid: string }; Returns: string[] }
+ groups_query: {
+ Args: { _name?: string; _uid?: string }
+ Returns: {
+ companyId: string
+ id: string
+ isCustomerOrgGroup: boolean
+ isCustomerTypeGroup: boolean
+ isEmployeeTypeGroup: boolean
+ isSupplierOrgGroup: boolean
+ isSupplierTypeGroup: boolean
+ name: string
+ parentId: string
+ users: Json
+ }[]
+ }
+ has_any_company_permission: { Args: { claim: string }; Returns: boolean }
+ has_company_permission: {
+ Args: { claim: string; company: string }
+ Returns: boolean
+ }
+ has_role: {
+ Args: { company: string; required_role: string }
+ Returns: boolean
+ }
+ has_valid_api_key_for_company: {
+ Args: { company: string }
+ Returns: boolean
+ }
+ id: { Args: { _prefix?: string }; Returns: string }
+ increment_webhook_error: {
+ Args: { webhook_id: string }
+ Returns: undefined
+ }
+ increment_webhook_success: {
+ Args: { webhook_id: string }
+ Returns: undefined
+ }
+ insert_audit_log: {
+ Args: {
+ p_actor_id: string
+ p_actor_name: string
+ p_company_id: string
+ p_diff?: Json
+ p_entity_id: string
+ p_entity_type: string
+ p_metadata?: Json
+ p_operation: string
+ }
+ Returns: string
+ }
+ insert_audit_log_batch: {
+ Args: { p_company_id: string; p_entries: Json[] }
+ Returns: number
+ }
+ is_claims_admin: { Args: never; Returns: boolean }
+ is_last_job_operation: {
+ Args: { operation_id: string }
+ Returns: boolean
+ }
+ items_search: {
+ Args: {
+ match_count: number
+ match_threshold: number
+ p_company_id: string
+ query_embedding: string
+ }
+ Returns: {
+ description: string
+ id: string
+ name: string
+ readableId: string
+ similarity: number
+ }[]
+ }
+ journalLinesByAccountNumber: {
+ Args: { from_date?: string; to_date?: string }
+ Returns: {
+ balance: number
+ balanceAtDate: number
+ companyGroupId: string
+ netChange: number
+ number: string
+ }[]
+ }
+ jsonb_to_text_array: { Args: { "": Json }; Returns: string[] }
+ matchIntercompanyTransactions: {
+ Args: { p_company_group_id: string }
+ Returns: {
+ amount: number
+ id: string
+ matchedWithId: string
+ sourceCompanyId: string
+ status: string
+ targetCompanyId: string
+ }[]
+ }
+ nanoid: {
+ Args: {
+ additionalbytesfactor?: number
+ alphabet?: string
+ prefix?: string
+ size?: number
+ }
+ Returns: string
+ }
+ nanoid_optimized: {
+ Args: { alphabet: string; mask: number; size: number; step: number }
+ Returns: string
+ }
+ populate_company_search_index: {
+ Args: { p_company_id: string }
+ Returns: undefined
+ }
+ populate_sales_search_results: {
+ Args: { p_company_id: string }
+ Returns: undefined
+ }
+ prevent_posted_purchase_invoice_deletion: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ prevent_posted_sales_invoice_deletion: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ resolve_shelf_life_start_for_receipt: {
+ Args: { p_item_id: string; p_receipt_id: string }
+ Returns: string
+ }
+ save_inspection_document_atomic: {
+ Args: {
+ p_balloons?: Json
+ p_company_id: string
+ p_default_page_height?: number
+ p_default_page_width?: number
+ p_features?: Json
+ p_inspection_document_id: string
+ p_page_count?: number
+ p_pdf_url?: string
+ p_user_id: string
+ }
+ Returns: Json
+ }
+ search_company_index: {
+ Args: {
+ p_company_id: string
+ p_entity_types: string[]
+ p_limit?: number
+ p_query: string
+ }
+ Returns: {
+ description: string
+ entityId: string
+ entityType: string
+ id: number
+ link: string
+ metadata: Json
+ tags: string[]
+ title: string
+ }[]
+ }
+ set_shelf_life_for_operation: {
+ Args: {
+ p_event: Database["public"]["Enums"]["shelfLifeTriggerTiming"]
+ p_job_operation_id: string
+ }
+ Returns: undefined
+ }
+ set_shelf_life_on_operation_done: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ set_shelf_life_on_operation_started: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ show_limit: { Args: never; Returns: number }
+ show_trgm: { Args: { "": string }; Returns: string[] }
+ storage_unit_block_location_change_with_children: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ storage_unit_enforce_no_cycle: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ storage_unit_enforce_same_location: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ suppliers_search: {
+ Args: {
+ match_count: number
+ match_threshold: number
+ p_company_id: string
+ query_embedding: string
+ }
+ Returns: {
+ id: string
+ name: string
+ similarity: number
+ }[]
+ }
+ sync_add_customer_account_to_group: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_add_employee_to_type_group: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_add_supplier_account_to_group: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_address_to_parent: {
+ Args: {
+ new_data: Json
+ old_data: Json
+ operation: string
+ table_name: string
+ }
+ Returns: undefined
+ }
+ sync_archive_other_procedures: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_archive_other_quality_documents: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_contact_to_parent: {
+ Args: {
+ new_data: Json
+ old_data: Json
+ operation: string
+ table_name: string
+ }
+ Returns: undefined
+ }
+ sync_create_customer_entries: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_create_customer_org_group: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_create_customer_type_group: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_create_employee_type_group: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_create_item_related_records: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_create_location_related_records: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_create_make_method_related_records: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_create_nc_external_link: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_create_supplier_entries: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_create_supplier_org_group: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_create_supplier_type_group: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_create_user_identity_group: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_delete_tracked_entity_on_job_make_method: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_edit_document_transaction: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_finish_job_operation:
+ | {
+ Args: { p_new: Json; p_old: Json; p_operation: string }
+ Returns: undefined
+ }
+ | {
+ Args: {
+ p_new: Json
+ p_old: Json
+ p_operation: string
+ p_table: string
+ }
+ Returns: undefined
+ }
+ sync_insert_company_related_records: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_insert_job_make_method: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_insert_job_material_make_method: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_insert_quote_line_make_method: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_insert_quote_material_make_method: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_job_complete_or_canceled: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_on_maintenance_dispatch_complete: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_propagate_item_readable_id_to_tracked_entity: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_protect_system_required_actions: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_purchase_invoice_line_price_change: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_set_initial_dependency_status: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_set_job_operation_in_progress: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_update_customer_type_group: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_update_customer_type_group_name: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_update_employee_type_group: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_update_employee_type_membership: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_update_job_material_make_method_item_id: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_update_job_operation_quantities: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_update_quote_exchange_rate: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_update_quote_line_make_method_item_id: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_update_quote_material_make_method_item_id: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_update_sales_order_exchange_rate: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_update_stock_transfer_status: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_update_supplier_type_group: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_update_supplier_type_group_name: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_update_tracked_entity_on_job_make_method: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_update_user_identity_group: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_upload_document_transaction: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ sync_verify_integration: {
+ Args: { p_new: Json; p_old: Json; p_operation: string; p_table: string }
+ Returns: undefined
+ }
+ translateTrialBalance: {
+ Args: {
+ p_company_group_id: string
+ p_company_id: string
+ p_period_end: string
+ p_period_start?: string
+ p_target_currency: string
+ }
+ Returns: {
+ accountId: string
+ exchangeRate: number
+ localBalance: number
+ translatedBalance: number
+ }[]
+ }
+ trialBalance: {
+ Args: {
+ from_date?: string
+ p_company_group_id: string
+ p_company_id?: string
+ to_date?: string
+ }
+ Returns: {
+ accountClass: Database["public"]["Enums"]["glAccountClass"]
+ accountId: string
+ accountName: string
+ accountNumber: string
+ creditBalance: number
+ debitBalance: number
+ incomeBalance: Database["public"]["Enums"]["glIncomeBalance"]
+ netChange: number
+ }[]
+ }
+ update_receipt_line_batch_tracking: {
+ Args: {
+ p_batch_number: string
+ p_properties?: Json
+ p_quantity: number
+ p_receipt_id: string
+ p_receipt_line_id: string
+ p_tracked_entity_id?: string
+ }
+ Returns: undefined
+ }
+ update_receipt_line_serial_tracking: {
+ Args: {
+ p_expiry_date?: string
+ p_index: number
+ p_receipt_id: string
+ p_receipt_line_id: string
+ p_serial_number: string
+ p_tracked_entity_id?: string
+ }
+ Returns: undefined
+ }
+ upsert_to_search_index: {
+ Args: {
+ p_company_id: string
+ p_description: string
+ p_entity_id: string
+ p_entity_type: string
+ p_link: string
+ p_metadata: Json
+ p_tags: string[]
+ p_title: string
+ }
+ Returns: undefined
+ }
+ users_for_groups: { Args: { groups: string[] }; Returns: Json }
+ uuid_generate_v4: { Args: never; Returns: string }
+ uuid_to_base58: { Args: { _uuid: string }; Returns: string }
+ xid: { Args: { _at?: string }; Returns: unknown }
+ xid_counter: { Args: { _xid: unknown }; Returns: number }
+ xid_decode: { Args: { _xid: unknown }; Returns: number[] }
+ xid_encode: { Args: { _id: number[] }; Returns: unknown }
+ xid_machine: { Args: { _xid: unknown }; Returns: number[] }
+ xid_pid: { Args: { _xid: unknown }; Returns: number }
+ xid_time: { Args: { _xid: unknown }; Returns: string }
+ }
+ Enums: {
+ accountingPeriodStatus: "Inactive" | "Active"
+ accountType:
+ | "Bank"
+ | "Cash"
+ | "Accounts Receivable"
+ | "Accounts Payable"
+ | "Inventory"
+ | "Fixed Asset"
+ | "Accumulated Depreciation"
+ | "Other Current Asset"
+ | "Other Asset"
+ | "Other Current Liability"
+ | "Long Term Liability"
+ | "Equity - No Close"
+ | "Equity - Close"
+ | "Retained Earnings"
+ | "Income"
+ | "Cost of Goods Sold"
+ | "Expense"
+ | "Other Income"
+ | "Other Expense"
+ | "Tax"
+ | "Investments"
+ approvalDocumentType: "purchaseOrder" | "qualityDocument" | "supplier"
+ approvalStatus: "Pending" | "Approved" | "Rejected" | "Cancelled"
+ configurationParameterDataType:
+ | "text"
+ | "numeric"
+ | "boolean"
+ | "list"
+ | "date"
+ | "material"
+ costLedgerType:
+ | "Direct Cost"
+ | "Revaluation"
+ | "Rounding"
+ | "Indirect Cost"
+ | "Variance"
+ | "Total"
+ customRuleTargetType: "item" | "storageUnit" | "workCenter"
+ deadlineType: "No Deadline" | "ASAP" | "Soft Deadline" | "Hard Deadline"
+ demandForecastSourceType:
+ | "Job Material"
+ | "Sales Order"
+ | "Demand Projection"
+ demandSourceType: "Sales Order" | "Job Material"
+ depreciationMethod:
+ | "Straight Line"
+ | "Declining Balance"
+ | "Units of Production"
+ dimensionEntityType:
+ | "Custom"
+ | "Location"
+ | "ItemPostingGroup"
+ | "SupplierType"
+ | "CustomerType"
+ | "Department"
+ | "Employee"
+ | "CostCenter"
+ | "WorkCenter"
+ | "Process"
+ | "FixedAssetClass"
+ disposalMethod: "Sale" | "Scrapping"
+ disposition:
+ | "Conditional Acceptance"
+ | "Deviation Accepted"
+ | "Hold"
+ | "No Action Required"
+ | "Pending"
+ | "Quarantine"
+ | "Repair"
+ | "Return to Supplier"
+ | "Rework"
+ | "Scrap"
+ | "Use As Is"
+ documentSourceType:
+ | "Job"
+ | "Part"
+ | "Purchase Order"
+ | "Purchase Invoice"
+ | "Purchase Return Order"
+ | "Quote"
+ | "Receipt"
+ | "Request for Quote"
+ | "Sales Order"
+ | "Sales Invoice"
+ | "Sales Return Order"
+ | "Service"
+ | "Shipment"
+ | "Material"
+ | "Tool"
+ | "Fixture"
+ | "Consumable"
+ | "Issue"
+ | "Gauge Calibration Record"
+ | "Purchasing Request for Quote"
+ | "Supplier Quote"
+ documentthreadtype:
+ | "nonConformance"
+ | "quote"
+ | "salesOrder"
+ | "job"
+ | "purchaseOrder"
+ | "invoice"
+ | "receipt"
+ | "shipment"
+ documentTransactionType:
+ | "Download"
+ | "Edit"
+ | "Favorite"
+ | "Label"
+ | "Unfavorite"
+ | "Upload"
+ documentType:
+ | "Archive"
+ | "Document"
+ | "Presentation"
+ | "PDF"
+ | "Spreadsheet"
+ | "Text"
+ | "Image"
+ | "Video"
+ | "Audio"
+ | "Other"
+ | "Model"
+ employeeTypeSystemType: "Admin" | "Console Operator"
+ externalLinkDocumentType:
+ | "Quote"
+ | "SupplierQuote"
+ | "Customer"
+ | "Non-Conformance Supplier"
+ factor:
+ | "Hours/Piece"
+ | "Hours/100 Pieces"
+ | "Hours/1000 Pieces"
+ | "Minutes/Piece"
+ | "Minutes/100 Pieces"
+ | "Minutes/1000 Pieces"
+ | "Pieces/Hour"
+ | "Pieces/Minute"
+ | "Seconds/Piece"
+ | "Total Hours"
+ | "Total Minutes"
+ fixedAssetStatus: "Draft" | "Active" | "Fully Depreciated" | "Disposed"
+ fulfillmentType: "Inventory" | "Job"
+ gaugeCalibrationStatus:
+ | "Pending"
+ | "In-Calibration"
+ | "Out-of-Calibration"
+ gaugeRole: "Master" | "Standard"
+ gaugeStatus: "Active" | "Inactive"
+ glAccountClass: "Asset" | "Liability" | "Equity" | "Revenue" | "Expense"
+ glConsolidatedRate: "Average" | "Current" | "Historical"
+ glIncomeBalance: "Balance Sheet" | "Income Statement"
+ inboundInspectionSampleStatus: "Pending" | "Passed" | "Failed"
+ inboundInspectionStatus:
+ | "Pending"
+ | "In Progress"
+ | "Passed"
+ | "Failed"
+ | "Partial"
+ incoterm:
+ | "EXW"
+ | "FCA"
+ | "FAS"
+ | "FOB"
+ | "CPT"
+ | "CIP"
+ | "CFR"
+ | "CIF"
+ | "DAP"
+ | "DPU"
+ | "DDP"
+ inspectionLevel: "I" | "II" | "III" | "S1" | "S2" | "S3" | "S4"
+ inspectionSeverity: "Normal" | "Tightened" | "Reduced"
+ inspectionStatus: "Pass" | "Fail"
+ itemCostingMethod: "Standard" | "Average" | "LIFO" | "FIFO"
+ itemLedgerDocumentType:
+ | "Sales Shipment"
+ | "Sales Invoice"
+ | "Sales Return Receipt"
+ | "Sales Credit Memo"
+ | "Purchase Receipt"
+ | "Purchase Invoice"
+ | "Purchase Return Shipment"
+ | "Purchase Credit Memo"
+ | "Transfer Shipment"
+ | "Transfer Receipt"
+ | "Service Shipment"
+ | "Service Invoice"
+ | "Service Credit Memo"
+ | "Posted Assembly"
+ | "Inventory Receipt"
+ | "Inventory Shipment"
+ | "Direct Transfer"
+ | "Job Consumption"
+ | "Job Receipt"
+ | "Batch Split"
+ | "Purchase Order"
+ | "Maintenance Consumption"
+ | "Non-Conformance"
+ itemLedgerType:
+ | "Purchase"
+ | "Sale"
+ | "Positive Adjmt."
+ | "Negative Adjmt."
+ | "Transfer"
+ | "Consumption"
+ | "Output"
+ | "Assembly Consumption"
+ | "Assembly Output"
+ itemReorderingPolicy:
+ | "Manual Reorder"
+ | "Demand-Based Reorder"
+ | "Fixed Reorder Quantity"
+ | "Maximum Quantity"
+ itemReplenishmentSystem: "Buy" | "Make" | "Buy and Make"
+ itemTrackingSourceDocument:
+ | "Receipt"
+ | "Job Production"
+ | "Job Material"
+ | "Shipment"
+ itemTrackingType: "Inventory" | "Non-Inventory" | "Serial" | "Batch"
+ itemType:
+ | "Part"
+ | "Material"
+ | "Tool"
+ | "Service"
+ | "Consumable"
+ | "Fixture"
+ jobOperationStatus:
+ | "Canceled"
+ | "Done"
+ | "In Progress"
+ | "Paused"
+ | "Ready"
+ | "Todo"
+ | "Waiting"
+ jobStatus:
+ | "Draft"
+ | "Ready"
+ | "In Progress"
+ | "Paused"
+ | "Completed"
+ | "Cancelled"
+ | "Overdue"
+ | "Due Today"
+ | "Planned"
+ | "Closed"
+ journalEntrySourceType:
+ | "Manual"
+ | "Purchase Receipt"
+ | "Purchase Invoice"
+ | "Purchase Return"
+ | "Sales Invoice"
+ | "Sales Shipment"
+ | "Sales Return"
+ | "Transfer Receipt"
+ | "Inventory Adjustment"
+ | "Production Order"
+ | "Job Consumption"
+ | "Job Receipt"
+ | "Production Event"
+ | "Job Close"
+ | "Asset Depreciation"
+ | "Asset Disposal"
+ journalEntryStatus: "Draft" | "Posted" | "Reversed"
+ journalLineDocumentType:
+ | "Receipt"
+ | "Invoice"
+ | "Credit Memo"
+ | "Blanket Order"
+ | "Return Order"
+ | "Sales Shipment"
+ | "Transfer Shipment"
+ | "Purchase Receipt"
+ | "Purchase Invoice"
+ | "Job Consumption"
+ | "Job Receipt"
+ | "Batch Split"
+ | "Maintenance Consumption"
+ | "Production Event"
+ | "Job Close"
+ kanbanOutput: "label" | "qrcode" | "url"
+ macrsConvention: "Half-Year" | "Mid-Quarter"
+ macrsPropertyClass: "3" | "5" | "7" | "10" | "15" | "20" | "27.5" | "39"
+ maintenanceDispatchPriority: "Low" | "Medium" | "High" | "Critical"
+ maintenanceDispatchStatus:
+ | "Open"
+ | "Assigned"
+ | "In Progress"
+ | "Completed"
+ | "Cancelled"
+ maintenanceFailureModeType:
+ | "Maintenance"
+ | "Quality"
+ | "Operations"
+ | "Other"
+ maintenanceFrequency:
+ | "Daily"
+ | "Weekly"
+ | "Monthly"
+ | "Quarterly"
+ | "Annual"
+ maintenanceSeverity:
+ | "Preventive"
+ | "Operator Performed"
+ | "Support Required"
+ | "OEM Required"
+ maintenanceSource: "Scheduled" | "Reactive" | "Non-Conformance"
+ makeMethodStatus: "Draft" | "Active" | "Archived"
+ methodOperationOrder: "After Previous" | "With Previous"
+ methodType: "Purchase to Order" | "Pull from Inventory" | "Make to Order"
+ module:
+ | "Accounting"
+ | "Documents"
+ | "Invoicing"
+ | "Inventory"
+ | "Items"
+ | "Messaging"
+ | "Parts"
+ | "People"
+ | "Production"
+ | "Purchasing"
+ | "Resources"
+ | "Sales"
+ | "Settings"
+ | "Users"
+ | "Quality"
+ month:
+ | "January"
+ | "February"
+ | "March"
+ | "April"
+ | "May"
+ | "June"
+ | "July"
+ | "August"
+ | "September"
+ | "October"
+ | "November"
+ | "December"
+ nonConformanceApproval: "MRB"
+ nonConformancePriority: "Low" | "Medium" | "High" | "Critical"
+ nonConformanceSource: "Internal" | "External"
+ nonConformanceStatus: "Registered" | "In Progress" | "Closed"
+ nonConformanceSystemActionType:
+ | "Containment"
+ | "Corrective"
+ | "Preventive"
+ | "Verification"
+ | "Communication"
+ nonConformanceTaskStatus:
+ | "Pending"
+ | "In Progress"
+ | "Completed"
+ | "Skipped"
+ oeeImpact: "Down" | "Planned" | "Impact" | "No Impact"
+ operationType: "Inside" | "Outside"
+ payableLineType:
+ | "Comment"
+ | "G/L Account"
+ | "Fixed Asset"
+ | "Part"
+ | "Material"
+ | "Tool"
+ | "Service"
+ | "Consumable"
+ | "Fixture"
+ paymentTermCalculationMethod: "Net" | "End of Month" | "Day of Month"
+ periodType: "Week" | "Day" | "Month"
+ pricingRuleAmountType: "Percentage" | "Fixed"
+ pricingRuleType: "Discount" | "Markup"
+ procedureStatus: "Draft" | "Active" | "Archived"
+ procedureStepType:
+ | "Value"
+ | "Measurement"
+ | "Checkbox"
+ | "Timestamp"
+ | "Person"
+ | "List"
+ | "File"
+ | "Task"
+ | "Inspection"
+ processType: "Inside" | "Outside" | "Inside and Outside"
+ productionEventType: "Setup" | "Labor" | "Machine"
+ productionQuantityType: "Rework" | "Scrap" | "Production"
+ purchaseInvoiceStatus:
+ | "Draft"
+ | "Pending"
+ | "Open"
+ | "Return"
+ | "Debit Note Issued"
+ | "Paid"
+ | "Partially Paid"
+ | "Overdue"
+ | "Voided"
+ purchaseOrderLineType:
+ | "Comment"
+ | "G/L Account"
+ | "Fixed Asset"
+ | "Part"
+ | "Material"
+ | "Tool"
+ | "Service"
+ | "Consumable"
+ | "Fixture"
+ purchaseOrderStatus:
+ | "Draft"
+ | "To Review"
+ | "Rejected"
+ | "To Receive"
+ | "To Receive and Invoice"
+ | "To Invoice"
+ | "Completed"
+ | "Closed"
+ | "Planned"
+ | "Needs Approval"
+ purchaseOrderTransactionType:
+ | "Edit"
+ | "Favorite"
+ | "Unfavorite"
+ | "Approved"
+ | "Reject"
+ | "Request Approval"
+ purchaseOrderType: "Purchase" | "Return" | "Outside Processing"
+ purchasePriceUpdateTiming:
+ | "Purchase Invoice Post"
+ | "Purchase Order Finalize"
+ purchasingRfqStatus: "Draft" | "Requested" | "Closed"
+ qualityDocumentStatus: "Draft" | "Active" | "Archived"
+ quoteLineStatus: "Not Started" | "In Progress" | "Complete" | "No Quote"
+ quoteStatus:
+ | "Draft"
+ | "Sent"
+ | "Ordered"
+ | "Partial"
+ | "Lost"
+ | "Cancelled"
+ | "Expired"
+ receiptSourceDocument:
+ | "Sales Order"
+ | "Sales Invoice"
+ | "Sales Return Order"
+ | "Purchase Order"
+ | "Purchase Invoice"
+ | "Purchase Return Order"
+ | "Inbound Transfer"
+ | "Outbound Transfer"
+ | "Manufacturing Consumption"
+ | "Manufacturing Output"
+ receiptStatus: "Draft" | "Pending" | "Posted" | "Voided"
+ riskRegisterType: "Risk" | "Opportunity"
+ riskSource:
+ | "Customer"
+ | "General"
+ | "Item"
+ | "Job"
+ | "Quote Line"
+ | "Supplier"
+ | "Work Center"
+ riskStatus: "Open" | "In Review" | "Mitigating" | "Closed" | "Accepted"
+ role: "customer" | "employee" | "supplier"
+ salesInvoiceLineType:
+ | "Comment"
+ | "Part"
+ | "Material"
+ | "Tool"
+ | "Service"
+ | "Consumable"
+ | "Fixture"
+ | "Fixed Asset"
+ salesInvoiceStatus:
+ | "Draft"
+ | "Pending"
+ | "Submitted"
+ | "Return"
+ | "Credit Note Issued"
+ | "Paid"
+ | "Partially Paid"
+ | "Overdue"
+ | "Voided"
+ salesOrderLineStatus: "Ordered" | "In Progress" | "Completed"
+ salesOrderLineType:
+ | "Comment"
+ | "Part"
+ | "Material"
+ | "Tool"
+ | "Service"
+ | "Consumable"
+ | "Fixture"
+ | "Fixed Asset"
+ salesOrderStatus:
+ | "Draft"
+ | "Needs Approval"
+ | "Confirmed"
+ | "In Progress"
+ | "Completed"
+ | "Invoiced"
+ | "Cancelled"
+ | "Closed"
+ | "To Ship and Invoice"
+ | "To Ship"
+ | "To Invoice"
+ salesOrderTransactionType:
+ | "Edit"
+ | "Favorite"
+ | "Unfavorite"
+ | "Approved"
+ | "Reject"
+ | "Request Approval"
+ salesRfqStatus: "Draft" | "Ready for Quote" | "Closed" | "Quoted"
+ samplingPlanType: "All" | "First" | "Percentage" | "AQL"
+ samplingStandard: "ANSI_Z1_4" | "ISO_2859_1"
+ serviceType: "Internal" | "External"
+ shelfLifeMode: "Fixed Duration" | "Calculated" | "Set on Receipt"
+ shelfLifeTriggerTiming: "Before" | "After"
+ shipmentSourceDocument:
+ | "Sales Order"
+ | "Sales Invoice"
+ | "Sales Return Order"
+ | "Purchase Order"
+ | "Purchase Invoice"
+ | "Purchase Return Order"
+ | "Inbound Transfer"
+ | "Outbound Transfer"
+ shipmentStatus: "Draft" | "Pending" | "Posted" | "Voided"
+ shippingCarrier: "UPS" | "FedEx" | "USPS" | "DHL" | "Other"
+ sourcingType: "Specified" | "Drop Ship" | "Ship from Inventory"
+ stockTransferStatus: "Draft" | "Released" | "In Progress" | "Completed"
+ supplierLedgerDocumentType:
+ | "Payment"
+ | "Invoice"
+ | "Credit Memo"
+ | "Finance Charge Memo"
+ | "Reminder"
+ | "Refund"
+ supplierPartPriceSourceType: "Quote" | "Purchase Order" | "Manual Entry"
+ supplierQuoteStatus:
+ | "Active"
+ | "Expired"
+ | "Draft"
+ | "Declined"
+ | "Cancelled"
+ supplierStatusType: "Active" | "Inactive" | "Pending" | "Rejected"
+ supplySourceType: "Purchase Order" | "Production Order"
+ tableViewType: "Public" | "Private"
+ taxDepreciationMethod: "Straight Line" | "Declining Balance" | "MACRS"
+ taxExemptionReason:
+ | "Resale"
+ | "Government"
+ | "Nonprofit"
+ | "Agriculture"
+ | "Industrial"
+ | "Export"
+ | "Medical"
+ | "Educational"
+ | "Religious"
+ | "Other"
+ trackedEntityStatus:
+ | "Available"
+ | "Reserved"
+ | "On Hold"
+ | "Consumed"
+ | "Rejected"
+ trackingSource: "Purchased" | "Manufactured"
+ trainingFrequency: "Once" | "Quarterly" | "Annual"
+ trainingQuestionType:
+ | "MultipleChoice"
+ | "TrueFalse"
+ | "MultipleAnswers"
+ | "MatchingPairs"
+ | "Numerical"
+ trainingStatus: "Draft" | "Active" | "Archived"
+ trainingType: "Mandatory" | "Optional"
+ transactionSurface:
+ | "receipt"
+ | "shipment"
+ | "stockTransfer"
+ | "warehouseTransfer"
+ | "inventoryAdjustment"
+ | "place"
+ | "pick"
+ | "operationStart"
+ | "operationFinish"
+ | "materialIssue"
+ | "materialReceive"
+ warehouseTransferStatus:
+ | "Draft"
+ | "To Ship and Receive"
+ | "To Ship"
+ | "To Receive"
+ | "Completed"
+ | "Cancelled"
+ }
+ CompositeTypes: {
+ [_ in never]: never
+ }
+ }
+ storage: {
+ Tables: {
+ buckets: {
+ Row: {
+ allowed_mime_types: string[] | null
+ avif_autodetection: boolean | null
+ created_at: string | null
+ file_size_limit: number | null
+ id: string
+ name: string
+ owner: string | null
+ owner_id: string | null
+ public: boolean | null
+ type: Database["storage"]["Enums"]["buckettype"]
+ updated_at: string | null
+ }
+ Insert: {
+ allowed_mime_types?: string[] | null
+ avif_autodetection?: boolean | null
+ created_at?: string | null
+ file_size_limit?: number | null
+ id: string
+ name: string
+ owner?: string | null
+ owner_id?: string | null
+ public?: boolean | null
+ type?: Database["storage"]["Enums"]["buckettype"]
+ updated_at?: string | null
+ }
+ Update: {
+ allowed_mime_types?: string[] | null
+ avif_autodetection?: boolean | null
+ created_at?: string | null
+ file_size_limit?: number | null
+ id?: string
+ name?: string
+ owner?: string | null
+ owner_id?: string | null
+ public?: boolean | null
+ type?: Database["storage"]["Enums"]["buckettype"]
+ updated_at?: string | null
+ }
+ Relationships: []
+ }
+ buckets_analytics: {
+ Row: {
+ created_at: string
+ deleted_at: string | null
+ format: string
+ id: string
+ name: string
+ type: Database["storage"]["Enums"]["buckettype"]
+ updated_at: string
+ }
+ Insert: {
+ created_at?: string
+ deleted_at?: string | null
+ format?: string
+ id?: string
+ name: string
+ type?: Database["storage"]["Enums"]["buckettype"]
+ updated_at?: string
+ }
+ Update: {
+ created_at?: string
+ deleted_at?: string | null
+ format?: string
+ id?: string
+ name?: string
+ type?: Database["storage"]["Enums"]["buckettype"]
+ updated_at?: string
+ }
+ Relationships: []
+ }
+ buckets_vectors: {
+ Row: {
+ created_at: string
+ id: string
+ type: Database["storage"]["Enums"]["buckettype"]
+ updated_at: string
+ }
+ Insert: {
+ created_at?: string
+ id: string
+ type?: Database["storage"]["Enums"]["buckettype"]
+ updated_at?: string
+ }
+ Update: {
+ created_at?: string
+ id?: string
+ type?: Database["storage"]["Enums"]["buckettype"]
+ updated_at?: string
+ }
+ Relationships: []
+ }
+ iceberg_namespaces: {
+ Row: {
+ bucket_name: string
+ catalog_id: string
+ created_at: string
+ id: string
+ metadata: Json
+ name: string
+ updated_at: string
+ }
+ Insert: {
+ bucket_name: string
+ catalog_id: string
+ created_at?: string
+ id?: string
+ metadata?: Json
+ name: string
+ updated_at?: string
+ }
+ Update: {
+ bucket_name?: string
+ catalog_id?: string
+ created_at?: string
+ id?: string
+ metadata?: Json
+ name?: string
+ updated_at?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "iceberg_namespaces_catalog_id_fkey"
+ columns: ["catalog_id"]
+ isOneToOne: false
+ referencedRelation: "buckets_analytics"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ iceberg_tables: {
+ Row: {
+ bucket_name: string
+ catalog_id: string
+ created_at: string
+ id: string
+ location: string
+ name: string
+ namespace_id: string
+ remote_table_id: string | null
+ shard_id: string | null
+ shard_key: string | null
+ updated_at: string
+ }
+ Insert: {
+ bucket_name: string
+ catalog_id: string
+ created_at?: string
+ id?: string
+ location: string
+ name: string
+ namespace_id: string
+ remote_table_id?: string | null
+ shard_id?: string | null
+ shard_key?: string | null
+ updated_at?: string
+ }
+ Update: {
+ bucket_name?: string
+ catalog_id?: string
+ created_at?: string
+ id?: string
+ location?: string
+ name?: string
+ namespace_id?: string
+ remote_table_id?: string | null
+ shard_id?: string | null
+ shard_key?: string | null
+ updated_at?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "iceberg_tables_catalog_id_fkey"
+ columns: ["catalog_id"]
+ isOneToOne: false
+ referencedRelation: "buckets_analytics"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "iceberg_tables_namespace_id_fkey"
+ columns: ["namespace_id"]
+ isOneToOne: false
+ referencedRelation: "iceberg_namespaces"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ migrations: {
+ Row: {
+ executed_at: string | null
+ hash: string
+ id: number
+ name: string
+ }
+ Insert: {
+ executed_at?: string | null
+ hash: string
+ id: number
+ name: string
+ }
+ Update: {
+ executed_at?: string | null
+ hash?: string
+ id?: number
+ name?: string
+ }
+ Relationships: []
+ }
+ objects: {
+ Row: {
+ bucket_id: string | null
+ created_at: string | null
+ id: string
+ last_accessed_at: string | null
+ metadata: Json | null
+ name: string | null
+ owner: string | null
+ owner_id: string | null
+ path_tokens: string[] | null
+ updated_at: string | null
+ user_metadata: Json | null
+ version: string | null
+ }
+ Insert: {
+ bucket_id?: string | null
+ created_at?: string | null
+ id?: string
+ last_accessed_at?: string | null
+ metadata?: Json | null
+ name?: string | null
+ owner?: string | null
+ owner_id?: string | null
+ path_tokens?: string[] | null
+ updated_at?: string | null
+ user_metadata?: Json | null
+ version?: string | null
+ }
+ Update: {
+ bucket_id?: string | null
+ created_at?: string | null
+ id?: string
+ last_accessed_at?: string | null
+ metadata?: Json | null
+ name?: string | null
+ owner?: string | null
+ owner_id?: string | null
+ path_tokens?: string[] | null
+ updated_at?: string | null
+ user_metadata?: Json | null
+ version?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "objects_bucketId_fkey"
+ columns: ["bucket_id"]
+ isOneToOne: false
+ referencedRelation: "buckets"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ s3_multipart_uploads: {
+ Row: {
+ bucket_id: string
+ created_at: string
+ id: string
+ in_progress_size: number
+ key: string
+ metadata: Json | null
+ owner_id: string | null
+ upload_signature: string
+ user_metadata: Json | null
+ version: string
+ }
+ Insert: {
+ bucket_id: string
+ created_at?: string
+ id: string
+ in_progress_size?: number
+ key: string
+ metadata?: Json | null
+ owner_id?: string | null
+ upload_signature: string
+ user_metadata?: Json | null
+ version: string
+ }
+ Update: {
+ bucket_id?: string
+ created_at?: string
+ id?: string
+ in_progress_size?: number
+ key?: string
+ metadata?: Json | null
+ owner_id?: string | null
+ upload_signature?: string
+ user_metadata?: Json | null
+ version?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "s3_multipart_uploads_bucket_id_fkey"
+ columns: ["bucket_id"]
+ isOneToOne: false
+ referencedRelation: "buckets"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ s3_multipart_uploads_parts: {
+ Row: {
+ bucket_id: string
+ created_at: string
+ etag: string
+ id: string
+ key: string
+ owner_id: string | null
+ part_number: number
+ size: number
+ upload_id: string
+ version: string
+ }
+ Insert: {
+ bucket_id: string
+ created_at?: string
+ etag: string
+ id?: string
+ key: string
+ owner_id?: string | null
+ part_number: number
+ size?: number
+ upload_id: string
+ version: string
+ }
+ Update: {
+ bucket_id?: string
+ created_at?: string
+ etag?: string
+ id?: string
+ key?: string
+ owner_id?: string | null
+ part_number?: number
+ size?: number
+ upload_id?: string
+ version?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "s3_multipart_uploads_parts_bucket_id_fkey"
+ columns: ["bucket_id"]
+ isOneToOne: false
+ referencedRelation: "buckets"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "s3_multipart_uploads_parts_upload_id_fkey"
+ columns: ["upload_id"]
+ isOneToOne: false
+ referencedRelation: "s3_multipart_uploads"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ vector_indexes: {
+ Row: {
+ bucket_id: string
+ created_at: string
+ data_type: string
+ dimension: number
+ distance_metric: string
+ id: string
+ metadata_configuration: Json | null
+ name: string
+ updated_at: string
+ }
+ Insert: {
+ bucket_id: string
+ created_at?: string
+ data_type: string
+ dimension: number
+ distance_metric: string
+ id?: string
+ metadata_configuration?: Json | null
+ name: string
+ updated_at?: string
+ }
+ Update: {
+ bucket_id?: string
+ created_at?: string
+ data_type?: string
+ dimension?: number
+ distance_metric?: string
+ id?: string
+ metadata_configuration?: Json | null
+ name?: string
+ updated_at?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "vector_indexes_bucket_id_fkey"
+ columns: ["bucket_id"]
+ isOneToOne: false
+ referencedRelation: "buckets_vectors"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ }
+ Views: {
+ [_ in never]: never
+ }
+ Functions: {
+ allow_any_operation: {
+ Args: { expected_operations: string[] }
+ Returns: boolean
+ }
+ allow_only_operation: {
+ Args: { expected_operation: string }
+ Returns: boolean
+ }
+ can_insert_object: {
+ Args: { bucketid: string; metadata: Json; name: string; owner: string }
+ Returns: undefined
+ }
+ extension: { Args: { name: string }; Returns: string }
+ filename: { Args: { name: string }; Returns: string }
+ foldername: { Args: { name: string }; Returns: string[] }
+ get_common_prefix: {
+ Args: { p_delimiter: string; p_key: string; p_prefix: string }
+ Returns: string
+ }
+ get_size_by_bucket: {
+ Args: never
+ Returns: {
+ bucket_id: string
+ size: number
+ }[]
+ }
+ list_multipart_uploads_with_delimiter: {
+ Args: {
+ bucket_id: string
+ delimiter_param: string
+ max_keys?: number
+ next_key_token?: string
+ next_upload_token?: string
+ prefix_param: string
+ }
+ Returns: {
+ created_at: string
+ id: string
+ key: string
+ }[]
+ }
+ list_objects_with_delimiter: {
+ Args: {
+ _bucket_id: string
+ delimiter_param: string
+ max_keys?: number
+ next_token?: string
+ prefix_param: string
+ sort_order?: string
+ start_after?: string
+ }
+ Returns: {
+ created_at: string
+ id: string
+ last_accessed_at: string
+ metadata: Json
+ name: string
+ updated_at: string
+ }[]
+ }
+ operation: { Args: never; Returns: string }
+ search: {
+ Args: {
+ bucketname: string
+ levels?: number
+ limits?: number
+ offsets?: number
+ prefix: string
+ search?: string
+ sortcolumn?: string
+ sortorder?: string
+ }
+ Returns: {
+ created_at: string
+ id: string
+ last_accessed_at: string
+ metadata: Json
+ name: string
+ updated_at: string
+ }[]
+ }
+ search_by_timestamp: {
+ Args: {
+ p_bucket_id: string
+ p_level: number
+ p_limit: number
+ p_prefix: string
+ p_sort_column: string
+ p_sort_column_after: string
+ p_sort_order: string
+ p_start_after: string
+ }
+ Returns: {
+ created_at: string
+ id: string
+ key: string
+ last_accessed_at: string
+ metadata: Json
+ name: string
+ updated_at: string
+ }[]
+ }
+ search_v2: {
+ Args: {
+ bucket_name: string
+ levels?: number
+ limits?: number
+ prefix: string
+ sort_column?: string
+ sort_column_after?: string
+ sort_order?: string
+ start_after?: string
+ }
+ Returns: {
+ created_at: string
+ id: string
+ key: string
+ last_accessed_at: string
+ metadata: Json
+ name: string
+ updated_at: string
+ }[]
+ }
+ }
+ Enums: {
+ buckettype: "STANDARD" | "ANALYTICS" | "VECTOR"
+ }
+ CompositeTypes: {
+ [_ in never]: never
+ }
+ }
+}
+
+type DatabaseWithoutInternals = Omit<Database, "__InternalSupabase">
+
+type DefaultSchema = DatabaseWithoutInternals[Extract<keyof Database, "public">]
+
+export type Tables<
+ DefaultSchemaTableNameOrOptions extends
+ | keyof (DefaultSchema["Tables"] & DefaultSchema["Views"])
+ | { schema: keyof DatabaseWithoutInternals },
+ TableName extends DefaultSchemaTableNameOrOptions extends {
+ schema: keyof DatabaseWithoutInternals
+ }
+ ? keyof (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] &
+ DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])
+ : never = never,
+> = DefaultSchemaTableNameOrOptions extends {
+ schema: keyof DatabaseWithoutInternals
+}
+ ? (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] &
+ DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])[TableName] extends {
+ Row: infer R
+ }
+ ? R
+ : never
+ : DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] &
+ DefaultSchema["Views"])
+ ? (DefaultSchema["Tables"] &
+ DefaultSchema["Views"])[DefaultSchemaTableNameOrOptions] extends {
+ Row: infer R
+ }
+ ? R
+ : never
+ : never
+
+export type TablesInsert<
+ DefaultSchemaTableNameOrOptions extends
+ | keyof DefaultSchema["Tables"]
+ | { schema: keyof DatabaseWithoutInternals },
+ TableName extends DefaultSchemaTableNameOrOptions extends {
+ schema: keyof DatabaseWithoutInternals
+ }
+ ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"]
+ : never = never,
+> = DefaultSchemaTableNameOrOptions extends {
+ schema: keyof DatabaseWithoutInternals
+}
+ ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends {
+ Insert: infer I
+ }
+ ? I
+ : never
+ : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"]
+ ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends {
+ Insert: infer I
+ }
+ ? I
+ : never
+ : never
+
+export type TablesUpdate<
+ DefaultSchemaTableNameOrOptions extends
+ | keyof DefaultSchema["Tables"]
+ | { schema: keyof DatabaseWithoutInternals },
+ TableName extends DefaultSchemaTableNameOrOptions extends {
+ schema: keyof DatabaseWithoutInternals
+ }
+ ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"]
+ : never = never,
+> = DefaultSchemaTableNameOrOptions extends {
+ schema: keyof DatabaseWithoutInternals
+}
+ ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends {
+ Update: infer U
+ }
+ ? U
+ : never
+ : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"]
+ ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends {
+ Update: infer U
+ }
+ ? U
+ : never
+ : never
+
+export type Enums<
+ DefaultSchemaEnumNameOrOptions extends
+ | keyof DefaultSchema["Enums"]
+ | { schema: keyof DatabaseWithoutInternals },
+ EnumName extends DefaultSchemaEnumNameOrOptions extends {
+ schema: keyof DatabaseWithoutInternals
+ }
+ ? keyof DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"]
+ : never = never,
+> = DefaultSchemaEnumNameOrOptions extends {
+ schema: keyof DatabaseWithoutInternals
+}
+ ? DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"][EnumName]
+ : DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema["Enums"]
+ ? DefaultSchema["Enums"][DefaultSchemaEnumNameOrOptions]
+ : never
+
+export type CompositeTypes<
+ PublicCompositeTypeNameOrOptions extends
+ | keyof DefaultSchema["CompositeTypes"]
+ | { schema: keyof DatabaseWithoutInternals },
+ CompositeTypeName extends PublicCompositeTypeNameOrOptions extends {
+ schema: keyof DatabaseWithoutInternals
+ }
+ ? keyof DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"]
+ : never = never,
+> = PublicCompositeTypeNameOrOptions extends {
+ schema: keyof DatabaseWithoutInternals
+}
+ ? DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"][CompositeTypeName]
+ : PublicCompositeTypeNameOrOptions extends keyof DefaultSchema["CompositeTypes"]
+ ? DefaultSchema["CompositeTypes"][PublicCompositeTypeNameOrOptions]
+ : never
+
+export const Constants = {
+ graphql_public: {
+ Enums: {},
+ },
+ public: {
+ Enums: {
+ accountingPeriodStatus: ["Inactive", "Active"],
+ accountType: [
+ "Bank",
+ "Cash",
+ "Accounts Receivable",
+ "Accounts Payable",
+ "Inventory",
+ "Fixed Asset",
+ "Accumulated Depreciation",
+ "Other Current Asset",
+ "Other Asset",
+ "Other Current Liability",
+ "Long Term Liability",
+ "Equity - No Close",
+ "Equity - Close",
+ "Retained Earnings",
+ "Income",
+ "Cost of Goods Sold",
+ "Expense",
+ "Other Income",
+ "Other Expense",
+ "Tax",
+ "Investments",
+ ],
+ approvalDocumentType: ["purchaseOrder", "qualityDocument", "supplier"],
+ approvalStatus: ["Pending", "Approved", "Rejected", "Cancelled"],
+ configurationParameterDataType: [
+ "text",
+ "numeric",
+ "boolean",
+ "list",
+ "date",
+ "material",
+ ],
+ costLedgerType: [
+ "Direct Cost",
+ "Revaluation",
+ "Rounding",
+ "Indirect Cost",
+ "Variance",
+ "Total",
+ ],
+ customRuleTargetType: ["item", "storageUnit", "workCenter"],
+ deadlineType: ["No Deadline", "ASAP", "Soft Deadline", "Hard Deadline"],
+ demandForecastSourceType: [
+ "Job Material",
+ "Sales Order",
+ "Demand Projection",
+ ],
+ demandSourceType: ["Sales Order", "Job Material"],
+ depreciationMethod: [
+ "Straight Line",
+ "Declining Balance",
+ "Units of Production",
+ ],
+ dimensionEntityType: [
+ "Custom",
+ "Location",
+ "ItemPostingGroup",
+ "SupplierType",
+ "CustomerType",
+ "Department",
+ "Employee",
+ "CostCenter",
+ "WorkCenter",
+ "Process",
+ "FixedAssetClass",
+ ],
+ disposalMethod: ["Sale", "Scrapping"],
+ disposition: [
+ "Conditional Acceptance",
+ "Deviation Accepted",
+ "Hold",
+ "No Action Required",
+ "Pending",
+ "Quarantine",
+ "Repair",
+ "Return to Supplier",
+ "Rework",
+ "Scrap",
+ "Use As Is",
+ ],
+ documentSourceType: [
+ "Job",
+ "Part",
+ "Purchase Order",
+ "Purchase Invoice",
+ "Purchase Return Order",
+ "Quote",
+ "Receipt",
+ "Request for Quote",
+ "Sales Order",
+ "Sales Invoice",
+ "Sales Return Order",
+ "Service",
+ "Shipment",
+ "Material",
+ "Tool",
+ "Fixture",
+ "Consumable",
+ "Issue",
+ "Gauge Calibration Record",
+ "Purchasing Request for Quote",
+ "Supplier Quote",
+ ],
+ documentthreadtype: [
+ "nonConformance",
+ "quote",
+ "salesOrder",
+ "job",
+ "purchaseOrder",
+ "invoice",
+ "receipt",
+ "shipment",
+ ],
+ documentTransactionType: [
+ "Download",
+ "Edit",
+ "Favorite",
+ "Label",
+ "Unfavorite",
+ "Upload",
+ ],
+ documentType: [
+ "Archive",
+ "Document",
+ "Presentation",
+ "PDF",
+ "Spreadsheet",
+ "Text",
+ "Image",
+ "Video",
+ "Audio",
+ "Other",
+ "Model",
+ ],
+ employeeTypeSystemType: ["Admin", "Console Operator"],
+ externalLinkDocumentType: [
+ "Quote",
+ "SupplierQuote",
+ "Customer",
+ "Non-Conformance Supplier",
+ ],
+ factor: [
+ "Hours/Piece",
+ "Hours/100 Pieces",
+ "Hours/1000 Pieces",
+ "Minutes/Piece",
+ "Minutes/100 Pieces",
+ "Minutes/1000 Pieces",
+ "Pieces/Hour",
+ "Pieces/Minute",
+ "Seconds/Piece",
+ "Total Hours",
+ "Total Minutes",
+ ],
+ fixedAssetStatus: ["Draft", "Active", "Fully Depreciated", "Disposed"],
+ fulfillmentType: ["Inventory", "Job"],
+ gaugeCalibrationStatus: [
+ "Pending",
+ "In-Calibration",
+ "Out-of-Calibration",
+ ],
+ gaugeRole: ["Master", "Standard"],
+ gaugeStatus: ["Active", "Inactive"],
+ glAccountClass: ["Asset", "Liability", "Equity", "Revenue", "Expense"],
+ glConsolidatedRate: ["Average", "Current", "Historical"],
+ glIncomeBalance: ["Balance Sheet", "Income Statement"],
+ inboundInspectionSampleStatus: ["Pending", "Passed", "Failed"],
+ inboundInspectionStatus: [
+ "Pending",
+ "In Progress",
+ "Passed",
+ "Failed",
+ "Partial",
+ ],
+ incoterm: [
+ "EXW",
+ "FCA",
+ "FAS",
+ "FOB",
+ "CPT",
+ "CIP",
+ "CFR",
+ "CIF",
+ "DAP",
+ "DPU",
+ "DDP",
+ ],
+ inspectionLevel: ["I", "II", "III", "S1", "S2", "S3", "S4"],
+ inspectionSeverity: ["Normal", "Tightened", "Reduced"],
+ inspectionStatus: ["Pass", "Fail"],
+ itemCostingMethod: ["Standard", "Average", "LIFO", "FIFO"],
+ itemLedgerDocumentType: [
+ "Sales Shipment",
+ "Sales Invoice",
+ "Sales Return Receipt",
+ "Sales Credit Memo",
+ "Purchase Receipt",
+ "Purchase Invoice",
+ "Purchase Return Shipment",
+ "Purchase Credit Memo",
+ "Transfer Shipment",
+ "Transfer Receipt",
+ "Service Shipment",
+ "Service Invoice",
+ "Service Credit Memo",
+ "Posted Assembly",
+ "Inventory Receipt",
+ "Inventory Shipment",
+ "Direct Transfer",
+ "Job Consumption",
+ "Job Receipt",
+ "Batch Split",
+ "Purchase Order",
+ "Maintenance Consumption",
+ "Non-Conformance",
+ ],
+ itemLedgerType: [
+ "Purchase",
+ "Sale",
+ "Positive Adjmt.",
+ "Negative Adjmt.",
+ "Transfer",
+ "Consumption",
+ "Output",
+ "Assembly Consumption",
+ "Assembly Output",
+ ],
+ itemReorderingPolicy: [
+ "Manual Reorder",
+ "Demand-Based Reorder",
+ "Fixed Reorder Quantity",
+ "Maximum Quantity",
+ ],
+ itemReplenishmentSystem: ["Buy", "Make", "Buy and Make"],
+ itemTrackingSourceDocument: [
+ "Receipt",
+ "Job Production",
+ "Job Material",
+ "Shipment",
+ ],
+ itemTrackingType: ["Inventory", "Non-Inventory", "Serial", "Batch"],
+ itemType: [
+ "Part",
+ "Material",
+ "Tool",
+ "Service",
+ "Consumable",
+ "Fixture",
+ ],
+ jobOperationStatus: [
+ "Canceled",
+ "Done",
+ "In Progress",
+ "Paused",
+ "Ready",
+ "Todo",
+ "Waiting",
+ ],
+ jobStatus: [
+ "Draft",
+ "Ready",
+ "In Progress",
+ "Paused",
+ "Completed",
+ "Cancelled",
+ "Overdue",
+ "Due Today",
+ "Planned",
+ "Closed",
+ ],
+ journalEntrySourceType: [
+ "Manual",
+ "Purchase Receipt",
+ "Purchase Invoice",
+ "Purchase Return",
+ "Sales Invoice",
+ "Sales Shipment",
+ "Sales Return",
+ "Transfer Receipt",
+ "Inventory Adjustment",
+ "Production Order",
+ "Job Consumption",
+ "Job Receipt",
+ "Production Event",
+ "Job Close",
+ "Asset Depreciation",
+ "Asset Disposal",
+ ],
+ journalEntryStatus: ["Draft", "Posted", "Reversed"],
+ journalLineDocumentType: [
+ "Receipt",
+ "Invoice",
+ "Credit Memo",
+ "Blanket Order",
+ "Return Order",
+ "Sales Shipment",
+ "Transfer Shipment",
+ "Purchase Receipt",
+ "Purchase Invoice",
+ "Job Consumption",
+ "Job Receipt",
+ "Batch Split",
+ "Maintenance Consumption",
+ "Production Event",
+ "Job Close",
+ ],
+ kanbanOutput: ["label", "qrcode", "url"],
+ macrsConvention: ["Half-Year", "Mid-Quarter"],
+ macrsPropertyClass: ["3", "5", "7", "10", "15", "20", "27.5", "39"],
+ maintenanceDispatchPriority: ["Low", "Medium", "High", "Critical"],
+ maintenanceDispatchStatus: [
+ "Open",
+ "Assigned",
+ "In Progress",
+ "Completed",
+ "Cancelled",
+ ],
+ maintenanceFailureModeType: [
+ "Maintenance",
+ "Quality",
+ "Operations",
+ "Other",
+ ],
+ maintenanceFrequency: [
+ "Daily",
+ "Weekly",
+ "Monthly",
+ "Quarterly",
+ "Annual",
+ ],
+ maintenanceSeverity: [
+ "Preventive",
+ "Operator Performed",
+ "Support Required",
+ "OEM Required",
+ ],
+ maintenanceSource: ["Scheduled", "Reactive", "Non-Conformance"],
+ makeMethodStatus: ["Draft", "Active", "Archived"],
+ methodOperationOrder: ["After Previous", "With Previous"],
+ methodType: ["Purchase to Order", "Pull from Inventory", "Make to Order"],
+ module: [
+ "Accounting",
+ "Documents",
+ "Invoicing",
+ "Inventory",
+ "Items",
+ "Messaging",
+ "Parts",
+ "People",
+ "Production",
+ "Purchasing",
+ "Resources",
+ "Sales",
+ "Settings",
+ "Users",
+ "Quality",
+ ],
+ month: [
+ "January",
+ "February",
+ "March",
+ "April",
+ "May",
+ "June",
+ "July",
+ "August",
+ "September",
+ "October",
+ "November",
+ "December",
+ ],
+ nonConformanceApproval: ["MRB"],
+ nonConformancePriority: ["Low", "Medium", "High", "Critical"],
+ nonConformanceSource: ["Internal", "External"],
+ nonConformanceStatus: ["Registered", "In Progress", "Closed"],
+ nonConformanceSystemActionType: [
+ "Containment",
+ "Corrective",
+ "Preventive",
+ "Verification",
+ "Communication",
+ ],
+ nonConformanceTaskStatus: [
+ "Pending",
+ "In Progress",
+ "Completed",
+ "Skipped",
+ ],
+ oeeImpact: ["Down", "Planned", "Impact", "No Impact"],
+ operationType: ["Inside", "Outside"],
+ payableLineType: [
+ "Comment",
+ "G/L Account",
+ "Fixed Asset",
+ "Part",
+ "Material",
+ "Tool",
+ "Service",
+ "Consumable",
+ "Fixture",
+ ],
+ paymentTermCalculationMethod: ["Net", "End of Month", "Day of Month"],
+ periodType: ["Week", "Day", "Month"],
+ pricingRuleAmountType: ["Percentage", "Fixed"],
+ pricingRuleType: ["Discount", "Markup"],
+ procedureStatus: ["Draft", "Active", "Archived"],
+ procedureStepType: [
+ "Value",
+ "Measurement",
+ "Checkbox",
+ "Timestamp",
+ "Person",
+ "List",
+ "File",
+ "Task",
+ "Inspection",
+ ],
+ processType: ["Inside", "Outside", "Inside and Outside"],
+ productionEventType: ["Setup", "Labor", "Machine"],
+ productionQuantityType: ["Rework", "Scrap", "Production"],
+ purchaseInvoiceStatus: [
+ "Draft",
+ "Pending",
+ "Open",
+ "Return",
+ "Debit Note Issued",
+ "Paid",
+ "Partially Paid",
+ "Overdue",
+ "Voided",
+ ],
+ purchaseOrderLineType: [
+ "Comment",
+ "G/L Account",
+ "Fixed Asset",
+ "Part",
+ "Material",
+ "Tool",
+ "Service",
+ "Consumable",
+ "Fixture",
+ ],
+ purchaseOrderStatus: [
+ "Draft",
+ "To Review",
+ "Rejected",
+ "To Receive",
+ "To Receive and Invoice",
+ "To Invoice",
+ "Completed",
+ "Closed",
+ "Planned",
+ "Needs Approval",
+ ],
+ purchaseOrderTransactionType: [
+ "Edit",
+ "Favorite",
+ "Unfavorite",
+ "Approved",
+ "Reject",
+ "Request Approval",
+ ],
+ purchaseOrderType: ["Purchase", "Return", "Outside Processing"],
+ purchasePriceUpdateTiming: [
+ "Purchase Invoice Post",
+ "Purchase Order Finalize",
+ ],
+ purchasingRfqStatus: ["Draft", "Requested", "Closed"],
+ qualityDocumentStatus: ["Draft", "Active", "Archived"],
+ quoteLineStatus: ["Not Started", "In Progress", "Complete", "No Quote"],
+ quoteStatus: [
+ "Draft",
+ "Sent",
+ "Ordered",
+ "Partial",
+ "Lost",
+ "Cancelled",
+ "Expired",
+ ],
+ receiptSourceDocument: [
+ "Sales Order",
+ "Sales Invoice",
+ "Sales Return Order",
+ "Purchase Order",
+ "Purchase Invoice",
+ "Purchase Return Order",
+ "Inbound Transfer",
+ "Outbound Transfer",
+ "Manufacturing Consumption",
+ "Manufacturing Output",
+ ],
+ receiptStatus: ["Draft", "Pending", "Posted", "Voided"],
+ riskRegisterType: ["Risk", "Opportunity"],
+ riskSource: [
+ "Customer",
+ "General",
+ "Item",
+ "Job",
+ "Quote Line",
+ "Supplier",
+ "Work Center",
+ ],
+ riskStatus: ["Open", "In Review", "Mitigating", "Closed", "Accepted"],
+ role: ["customer", "employee", "supplier"],
+ salesInvoiceLineType: [
+ "Comment",
+ "Part",
+ "Material",
+ "Tool",
+ "Service",
+ "Consumable",
+ "Fixture",
+ "Fixed Asset",
+ ],
+ salesInvoiceStatus: [
+ "Draft",
+ "Pending",
+ "Submitted",
+ "Return",
+ "Credit Note Issued",
+ "Paid",
+ "Partially Paid",
+ "Overdue",
+ "Voided",
+ ],
+ salesOrderLineStatus: ["Ordered", "In Progress", "Completed"],
+ salesOrderLineType: [
+ "Comment",
+ "Part",
+ "Material",
+ "Tool",
+ "Service",
+ "Consumable",
+ "Fixture",
+ "Fixed Asset",
+ ],
+ salesOrderStatus: [
+ "Draft",
+ "Needs Approval",
+ "Confirmed",
+ "In Progress",
+ "Completed",
+ "Invoiced",
+ "Cancelled",
+ "Closed",
+ "To Ship and Invoice",
+ "To Ship",
+ "To Invoice",
+ ],
+ salesOrderTransactionType: [
+ "Edit",
+ "Favorite",
+ "Unfavorite",
+ "Approved",
+ "Reject",
+ "Request Approval",
+ ],
+ salesRfqStatus: ["Draft", "Ready for Quote", "Closed", "Quoted"],
+ samplingPlanType: ["All", "First", "Percentage", "AQL"],
+ samplingStandard: ["ANSI_Z1_4", "ISO_2859_1"],
+ serviceType: ["Internal", "External"],
+ shelfLifeMode: ["Fixed Duration", "Calculated", "Set on Receipt"],
+ shelfLifeTriggerTiming: ["Before", "After"],
+ shipmentSourceDocument: [
+ "Sales Order",
+ "Sales Invoice",
+ "Sales Return Order",
+ "Purchase Order",
+ "Purchase Invoice",
+ "Purchase Return Order",
+ "Inbound Transfer",
+ "Outbound Transfer",
+ ],
+ shipmentStatus: ["Draft", "Pending", "Posted", "Voided"],
+ shippingCarrier: ["UPS", "FedEx", "USPS", "DHL", "Other"],
+ sourcingType: ["Specified", "Drop Ship", "Ship from Inventory"],
+ stockTransferStatus: ["Draft", "Released", "In Progress", "Completed"],
+ supplierLedgerDocumentType: [
+ "Payment",
+ "Invoice",
+ "Credit Memo",
+ "Finance Charge Memo",
+ "Reminder",
+ "Refund",
+ ],
+ supplierPartPriceSourceType: ["Quote", "Purchase Order", "Manual Entry"],
+ supplierQuoteStatus: [
+ "Active",
+ "Expired",
+ "Draft",
+ "Declined",
+ "Cancelled",
+ ],
+ supplierStatusType: ["Active", "Inactive", "Pending", "Rejected"],
+ supplySourceType: ["Purchase Order", "Production Order"],
+ tableViewType: ["Public", "Private"],
+ taxDepreciationMethod: ["Straight Line", "Declining Balance", "MACRS"],
+ taxExemptionReason: [
+ "Resale",
+ "Government",
+ "Nonprofit",
+ "Agriculture",
+ "Industrial",
+ "Export",
+ "Medical",
+ "Educational",
+ "Religious",
+ "Other",
+ ],
+ trackedEntityStatus: [
+ "Available",
+ "Reserved",
+ "On Hold",
+ "Consumed",
+ "Rejected",
+ ],
+ trackingSource: ["Purchased", "Manufactured"],
+ trainingFrequency: ["Once", "Quarterly", "Annual"],
+ trainingQuestionType: [
+ "MultipleChoice",
+ "TrueFalse",
+ "MultipleAnswers",
+ "MatchingPairs",
+ "Numerical",
+ ],
+ trainingStatus: ["Draft", "Active", "Archived"],
+ trainingType: ["Mandatory", "Optional"],
+ transactionSurface: [
+ "receipt",
+ "shipment",
+ "stockTransfer",
+ "warehouseTransfer",
+ "inventoryAdjustment",
+ "place",
+ "pick",
+ "operationStart",
+ "operationFinish",
+ "materialIssue",
+ "materialReceive",
+ ],
+ warehouseTransferStatus: [
+ "Draft",
+ "To Ship and Receive",
+ "To Ship",
+ "To Receive",
+ "Completed",
+ "Cancelled",
+ ],
+ },
+ },
+ storage: {
+ Enums: {
+ buckettype: ["STANDARD", "ANALYTICS", "VECTOR"],
+ },
+ },
+} as const
+
diff --git a/packages/database/supabase/functions/lib/types.ts b/packages/database/supabase/functions/lib/types.ts
index af44039a42..fc4823c4b6 100644
--- a/packages/database/supabase/functions/lib/types.ts
+++ b/packages/database/supabase/functions/lib/types.ts
@@ -6625,6 +6625,9 @@ export type Database = {
createdBy: string
customFields: Json | null
description: string | null
+ filteredItemGroupIds: string[]
+ filteredItemMatchAll: boolean
+ filteredItemTypes: string[]
id: string
message: string
name: string
@@ -6643,6 +6646,9 @@ export type Database = {
createdBy: string
customFields?: Json | null
description?: string | null
+ filteredItemGroupIds?: string[]
+ filteredItemMatchAll?: boolean
+ filteredItemTypes?: string[]
id?: string
message: string
name: string
@@ -6661,6 +6667,9 @@ export type Database = {
createdBy?: string
customFields?: Json | null
description?: string | null
+ filteredItemGroupIds?: string[]
+ filteredItemMatchAll?: boolean
+ filteredItemTypes?: string[]
id?: string
message?: string
name?: string
@@ -30121,6 +30130,7 @@ export type Database = {
sortOrder: number
storageUnitId: string | null
supplierExtendedPrice: number | null
+ supplierPartId: string | null
supplierShippingCost: number
supplierTaxAmount: number
supplierUnitPrice: number | null
@@ -30173,6 +30183,7 @@ export type Database = {
sortOrder?: number
storageUnitId?: string | null
supplierExtendedPrice?: number | null
+ supplierPartId?: string | null
supplierShippingCost?: number
supplierTaxAmount?: number
supplierUnitPrice?: number | null
@@ -30225,6 +30236,7 @@ export type Database = {
sortOrder?: number
storageUnitId?: string | null
supplierExtendedPrice?: number | null
+ supplierPartId?: string | null
supplierShippingCost?: number
supplierTaxAmount?: number
supplierUnitPrice?: number | null
@@ -38702,48 +38714,6 @@ export type Database = {
},
]
}
- searchIndex_HbxJR5a29zNzUNDsXv9coo: {
- Row: {
- createdAt: string
- description: string | null
- entityId: string
- entityType: string
- id: number
- link: string
- metadata: Json | null
- searchVector: unknown
- tags: string[] | null
- title: string
- updatedAt: string | null
- }
- Insert: {
- createdAt?: string
- description?: string | null
- entityId: string
- entityType: string
- id?: number
- link: string
- metadata?: Json | null
- searchVector?: unknown
- tags?: string[] | null
- title: string
- updatedAt?: string | null
- }
- Update: {
- createdAt?: string
- description?: string | null
- entityId?: string
- entityType?: string
- id?: number
- link?: string
- metadata?: Json | null
- searchVector?: unknown
- tags?: string[] | null
- title?: string
- updatedAt?: string | null
- }
- Relationships: []
- }
searchIndexRegistry: {
Row: {
companyId: string
@@ -54367,14 +54337,14 @@ export type Database = {
},
{
foreignKeyName: "partner_id_fkey"
- columns: ["id"]
+ columns: ["supplierLocationId"]
isOneToOne: false
referencedRelation: "supplierLocation"
referencedColumns: ["id"]
},
{
foreignKeyName: "partner_id_fkey"
- columns: ["supplierLocationId"]
+ columns: ["id"]
isOneToOne: false
referencedRelation: "supplierLocation"
referencedColumns: ["id"]
@@ -55535,6 +55505,7 @@ export type Database = {
storageUnitId: string | null
supplierExtendedPrice: number | null
supplierPartId: string | null
+ supplierPartIdFromSupplier: string | null
supplierShippingCost: number | null
supplierTaxAmount: number | null
supplierUnitPrice: number | null
@@ -55869,14 +55840,14 @@ export type Database = {
Relationships: [
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["customerCountryCode"]
+ columns: ["supplierCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
},
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["supplierCountryCode"]
+ columns: ["customerCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
@@ -59302,7 +59273,7 @@ export type Database = {
Relationships: [
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["invoiceCountryCode"]
+ columns: ["shipmentCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
@@ -59316,7 +59287,7 @@ export type Database = {
},
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["shipmentCountryCode"]
+ columns: ["invoiceCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
@@ -59883,14 +59854,14 @@ export type Database = {
Relationships: [
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["paymentCountryCode"]
+ columns: ["customerCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
},
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["customerCountryCode"]
+ columns: ["paymentCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
diff --git a/packages/database/supabase/migrations/20260515_custom_rule_item_filters.sql b/packages/database/supabase/migrations/20260515_custom_rule_item_filters.sql
new file mode 100644
index 0000000000..5fc1748f32
--- /dev/null
+++ b/packages/database/supabase/migrations/20260515_custom_rule_item_filters.sql
@@ -0,0 +1,12 @@
+-- Item-target rules: scope by item type and/or item group instead of the blunt
+-- "applies to all items" broadcast.
+--
+-- `appliesToAll` is RETAINED — it still governs broadcast for storageUnit /
+-- workCenter rules (which have no type/group concept). For item rules the form
+-- drops the toggle and uses these filters instead: empty arrays = every item;
+-- otherwise the rule fires on items matching the selected types and/or groups
+-- (`filteredItemMatchAll` chooses OR vs AND between the two dimensions).
+ALTER TABLE "customRule"
+ ADD COLUMN "filteredItemTypes" TEXT[] NOT NULL DEFAULT '{}',
+ ADD COLUMN "filteredItemGroupIds" TEXT[] NOT NULL DEFAULT '{}',
+ ADD COLUMN "filteredItemMatchAll" BOOLEAN NOT NULL DEFAULT false; -- false = OR (any), true = AND (all)
diff --git a/packages/ee/src/customRules/context.test.ts b/packages/ee/src/customRules/context.test.ts
new file mode 100644
index 0000000000..831d3d75cb
--- /dev/null
+++ b/packages/ee/src/customRules/context.test.ts
@@ -0,0 +1,139 @@
+// Anti-drift contract test. Locks the registry (what the builder offers) to the
+// runtime code path (what `buildLineContext` actually populates) per surface.
+//
+// If someone adds a field to FIELD_REGISTRY without populating it in
+// `buildLineContext`/the server SELECTs, or renames a ctx key (e.g. the
+// `storageTypeIds` → `storageTypeId` mapping), or edits
+// SURFACE_CONTEXT_AVAILABILITY out of sync — one of these assertions fails.
+
+import {
+ buildResolver,
+ FIELD_REGISTRY,
+ type FieldContext,
+ getFieldsForTargetTypeAndSurfaces,
+ SURFACE_CONTEXT_AVAILABILITY,
+ SURFACES_BY_TARGET_TYPE,
+ TARGET_TYPES,
+ type TargetType,
+ TRANSACTION_SURFACES,
+ type TransactionSurface
+} from "@carbon/utils";
+import { describe, expect, it } from "vitest";
+import { buildLineContext, type RuleLineInput } from "./context";
+
+// Fully-populated rows mirroring the shape `evaluateLinesForSurface` builds
+// AFTER its post-query flattening (itemPostingGroupId off itemCost; storageTypeId
+// unioned from storageTypeIds). Every registry-referenced key is present.
+const ITEM_ROW = {
+ id: "ITEM-1",
+ type: "Part",
+ replenishmentSystem: "Buy",
+ itemTrackingType: "Inventory",
+ itemPostingGroupId: "ipg_1"
+};
+const STORAGE_ROW = {
+ id: "su_1",
+ storageTypeId: ["st_1"],
+ locationId: "loc_1",
+ warehouseId: "wh_1",
+ name: "Bin A"
+};
+const WORKCENTER_ROW = { id: "wc_1", locationId: "loc_1", active: true };
+
+// FieldContext value → RuleContext root key (only "storage" differs).
+const ctxRootKeyFor = (context: FieldContext): string =>
+ context === "storage" ? "storageUnit" : context;
+
+// targetTypes a surface belongs to (a surface can serve several, e.g.
+// stockTransfer → item + storageUnit).
+const targetTypesForSurface = (surface: TransactionSurface): TargetType[] =>
+ TARGET_TYPES.filter((tt) => SURFACES_BY_TARGET_TYPE[tt].includes(surface));
+
+// Build a representative line carrying exactly the ids the availability map says
+// the surface populates — mirroring what real trigger call sites pass.
+const lineForSurface = (surface: TransactionSurface): RuleLineInput => {
+ const contexts = SURFACE_CONTEXT_AVAILABILITY[surface];
+ return {
+ lineId: "line_1",
+ quantity: 5,
+ locationId: "loc_1",
+ itemId: contexts.includes("item") ? ITEM_ROW.id : null,
+ storageUnitId: contexts.includes("storage") ? STORAGE_ROW.id : null,
+ workCenterId: contexts.includes("workCenter") ? WORKCENTER_ROW.id : null,
+ operation: contexts.includes("operation")
+ ? {
+ id: "op_1",
+ itemId: ITEM_ROW.id,
+ quantity: 5,
+ workInstructionId: "wi_1"
+ }
+ : undefined
+ };
+};
+
+const ctxFor = (surface: TransactionSurface) =>
+ buildLineContext({
+ line: lineForSurface(surface),
+ surface,
+ userId: "user_1",
+ item: ITEM_ROW,
+ storageUnit: STORAGE_ROW,
+ workCenter: WORKCENTER_ROW
+ });
+
+describe("registry ↔ runtime ctx contract", () => {
+ for (const surface of TRANSACTION_SURFACES) {
+ it(`every field offered on "${surface}" resolves in the runtime ctx`, () => {
+ const ctx = ctxFor(surface);
+ const offered = new Map<string, ReturnType<typeof buildResolver>>();
+ for (const tt of targetTypesForSurface(surface)) {
+ for (const f of getFieldsForTargetTypeAndSurfaces(tt, [surface])) {
+ offered.set(f.path, buildResolver(f.path));
+ }
+ }
+ expect(offered.size).toBeGreaterThan(0);
+ for (const [path, resolve] of offered) {
+ expect(
+ resolve(ctx),
+ `"${path}" offered on "${surface}" but resolved to undefined`
+ ).not.toBeUndefined();
+ }
+ });
+
+ it(`ctx for "${surface}" populates exactly the declared contexts`, () => {
+ const ctx = ctxFor(surface) as Record<string, unknown>;
+ for (const context of SURFACE_CONTEXT_AVAILABILITY[surface]) {
+ expect(
+ ctx[ctxRootKeyFor(context)],
+ `context "${context}" declared available on "${surface}" but not built`
+ ).not.toBeUndefined();
+ }
+ });
+ }
+});
+
+describe("registry coverage by availability map", () => {
+ // Every registry field's context must be declared available on every surface
+ // of its valid targetType(s) — otherwise the builder could offer a field the
+ // map silently excludes (or, worse, a field with no surface at all).
+ it("every field is available on at least one surface of its targetType", () => {
+ for (const f of FIELD_REGISTRY) {
+ const targets: TargetType[] =
+ f.targetType === "shared"
+ ? [...TARGET_TYPES]
+ : Array.isArray(f.targetType)
+ ? [...f.targetType]
+ : [f.targetType];
+ const surfaces = new Set<TransactionSurface>();
+ for (const tt of targets)
+ for (const s of SURFACES_BY_TARGET_TYPE[tt]) surfaces.add(s);
+ const covered = Array.from(surfaces).some((s) =>
+ SURFACE_CONTEXT_AVAILABILITY[s].includes(f.context)
+ );
+ expect(
+ covered,
+ `field "${f.path}" (context "${f.context}") is offered on no surface`
+ ).toBe(true);
+ }
+ });
+});
diff --git a/packages/ee/src/customRules/context.ts b/packages/ee/src/customRules/context.ts
new file mode 100644
index 0000000000..c97dcee094
--- /dev/null
+++ b/packages/ee/src/customRules/context.ts
@@ -0,0 +1,99 @@
+// Pure RuleContext assembly for custom-rules evaluation. Deliberately
+// side-effect-free (no auth/env/DB imports) so the registry↔code-path contract
+// can be unit-tested without booting the server environment. `server.ts` owns
+// the DB I/O and calls `buildLineContext` with the rows it loaded.
+
+import type { RuleContext, TransactionSurface } from "@carbon/utils";
+
+export type RuleLineInput = {
+ /** Diagnostic identifier — not used in eval. */
+ lineId: string;
+ /**
+ * Item the line operates on. Required when `targetType === "item"`.
+ * Available for context in storageUnit/workCenter passes too.
+ */
+ itemId?: string | null;
+ /** Storage unit being interacted with. */
+ storageUnitId?: string | null;
+ /** Work center being operated. Required when `targetType === "workCenter"`. */
+ workCenterId?: string | null;
+ /** Operation context for workCenter passes. */
+ operation?: {
+ id?: string | null;
+ itemId?: string | null;
+ quantity?: number | null;
+ workInstructionId?: string | null;
+ };
+ /** Quantity for `transaction.quantity` predicates. */
+ quantity: number;
+ locationId?: string | null;
+};
+
+export type ItemCtxRow = Record<string, unknown> & {
+ customFields?: Record<string, unknown>;
+};
+
+/**
+ * `itemPostingGroupId` lives on the 1:1 `itemCost` row, which PostgREST embeds
+ * as a (typed one-to-many) array. Pull the value off the embed regardless of
+ * array/object shape. Returns null when absent — callers coalesce to undefined
+ * if their context prefers it.
+ */
+export const itemPostingGroupIdFromEmbed = (
+ itemCost: unknown
+): string | null => {
+ const cost = Array.isArray(itemCost) ? itemCost[0] : itemCost;
+ return (
+ (cost as { itemPostingGroupId?: string | null } | undefined)
+ ?.itemPostingGroupId ?? null
+ );
+};
+export type StorageUnitCtxRow = Record<string, unknown> & {
+ locationId?: string | null;
+};
+export type WorkCenterCtxRow = Record<string, unknown>;
+
+/**
+ * Assemble the `RuleContext` for a single line. Pure — so the registry↔code-path
+ * contract (which root contexts get populated per surface) can be unit-tested
+ * without a DB client. See the anti-drift test in `server.test.ts` and
+ * `SURFACE_CONTEXT_AVAILABILITY` in `@carbon/utils`.
+ *
+ * `item`/`storageUnit`/`workCenter` are the rows loaded from the DB (or
+ * undefined when the lookup missed); the id-only fallback keeps token
+ * interpolation working when a join didn't materialize (RLS, late insert).
+ */
+export const buildLineContext = (args: {
+ line: RuleLineInput;
+ surface: TransactionSurface;
+ userId: string;
+ item?: ItemCtxRow;
+ storageUnit?: StorageUnitCtxRow;
+ workCenter?: WorkCenterCtxRow;
+}): RuleContext => {
+ const { line, surface, userId } = args;
+ const storageUnit = line.storageUnitId
+ ? (args.storageUnit ?? { id: line.storageUnitId })
+ : undefined;
+ return {
+ item: line.itemId ? (args.item ?? { id: line.itemId }) : undefined,
+ storageUnit,
+ workCenter: line.workCenterId
+ ? (args.workCenter ?? { id: line.workCenterId })
+ : undefined,
+ operation: line.operation
+ ? {
+ id: line.operation.id ?? undefined,
+ itemId: line.operation.itemId ?? undefined,
+ quantity: line.operation.quantity ?? undefined,
+ workInstructionId: line.operation.workInstructionId ?? undefined
+ }
+ : undefined,
+ transaction: {
+ kind: surface,
+ locationId: line.locationId ?? storageUnit?.locationId ?? null,
+ quantity: line.quantity,
+ userId
+ }
+ };
+};
diff --git a/packages/ee/src/customRules/server.ts b/packages/ee/src/customRules/server.ts
index a3c803a029..a34cb82e97 100644
--- a/packages/ee/src/customRules/server.ts
+++ b/packages/ee/src/customRules/server.ts
@@ -12,7 +12,8 @@ import {
compileWithCache,
evaluateRules,
getFieldDef,
- type RuleContext,
+ type ItemRuleFilter,
+ itemRuleAppliesToItem,
type Severity,
type TargetType,
type TransactionSurface,
@@ -21,6 +22,14 @@ import {
} from "@carbon/utils";
import type { SupabaseClient } from "@supabase/supabase-js";
import { companyHasPlan } from "../plan.server";
+import {
+ buildLineContext,
+ type ItemCtxRow,
+ itemPostingGroupIdFromEmbed,
+ type RuleLineInput,
+ type StorageUnitCtxRow,
+ type WorkCenterCtxRow
+} from "./context";
import {
getActiveRulesForTargets,
getCustomRulesList,
@@ -131,10 +140,14 @@ async function loadCompiledRulesForTargets(
): Promise<{
byTarget: Map<string, CompiledRule[]>;
broadcasts: CompiledRule[];
+ broadcastFilters: Map<string, ItemRuleFilter>;
}> {
const byTarget = new Map<string, CompiledRule[]>();
- const { data, broadcasts } = await getActiveRulesForTargets(client, args);
+ const { data, broadcasts, broadcastFilters } = await getActiveRulesForTargets(
+ client,
+ args
+ );
for (const [targetId, rows] of data) {
const compiled = new Array<CompiledRule>(rows.length);
for (let i = 0; i < rows.length; i++) {
@@ -156,7 +169,7 @@ async function loadCompiledRulesForTargets(
});
}
- return { byTarget, broadcasts: compiledBroadcasts };
+ return { byTarget, broadcasts: compiledBroadcasts, broadcastFilters };
}
// ---------------------------------------------------------------------------
@@ -262,30 +275,6 @@ async function buildConditionValueResolver(
// Per-line evaluator — single entry point trigger handlers call
// ---------------------------------------------------------------------------
-export type RuleLineInput = {
- /** Diagnostic identifier — not used in eval. */
- lineId: string;
- /**
- * Item the line operates on. Required when `targetType === "item"`.
- * Available for context in storageUnit/workCenter passes too.
- */
- itemId?: string | null;
- /** Storage unit being interacted with. */
- storageUnitId?: string | null;
- /** Work center being operated. Required when `targetType === "workCenter"`. */
- workCenterId?: string | null;
- /** Operation context for workCenter passes. */
- operation?: {
- id?: string | null;
- itemId?: string | null;
- quantity?: number | null;
- workInstructionId?: string | null;
- };
- /** Quantity for `transaction.quantity` predicates. */
- quantity: number;
- locationId?: string | null;
-};
-
export type EvaluateLinesForSurfaceArgs = {
client: Client;
companyId: string;
@@ -310,14 +299,6 @@ const EMPTY_RESULT: EvaluateLinesForSurfaceResult = {
ruleNames: {}
};
-type ItemCtxRow = Record<string, unknown> & {
- customFields?: Record<string, unknown>;
-};
-type StorageUnitCtxRow = Record<string, unknown> & {
- locationId?: string | null;
-};
-type WorkCenterCtxRow = Record<string, unknown>;
-
const lineTargetIdFor = (
line: RuleLineInput,
targetType: TargetType
@@ -356,9 +337,10 @@ export async function evaluateLinesForSurface({
if (line.workCenterId) workCenterIds.add(line.workCenterId);
if (line.operation?.itemId) itemIds.add(line.operation.itemId);
}
- // No early-return on empty targetIds — `appliesToAll` broadcasts must still
- // fire against every line. Explicit-assignment lookup short-circuits inside
- // `getActiveRulesForTargets` when targetIds is empty.
+ // No early-return on empty targetIds — broadcasts (all active item rules, or
+ // appliesToAll rules for non-item targets) must still fire against every line.
+ // Explicit-assignment lookup short-circuits inside `getActiveRulesForTargets`
+ // when targetIds is empty.
// Walk the storage-unit tree for every line that carries a bin id. Two
// inheritance behaviours hang off this fetch:
@@ -464,6 +446,7 @@ export async function evaluateLinesForSurface({
const compiledByTarget = compiled.byTarget;
const broadcastCompiled = compiled.broadcasts;
+ const broadcastFilters = compiled.broadcastFilters;
// If neither explicit assignments nor broadcasts exist, nothing can fire.
if (compiledByTarget.size === 0 && broadcastCompiled.length === 0)
@@ -473,17 +456,13 @@ export async function evaluateLinesForSurface({
for (const it of itemsRes.data ?? []) {
const row = it as unknown as Record<string, unknown>;
const readable = row.readableId as string | undefined;
- // `itemCost` embeds as an array (typed one-to-many even though it's 1:1).
- // Flatten its `itemPostingGroupId` onto the item ctx; drop the nested obj.
+ // Flatten the 1:1 `itemCost` embed's posting group onto the item ctx; drop
+ // the nested object.
const { itemCost, ...rest } = row;
- const cost = Array.isArray(itemCost) ? itemCost[0] : itemCost;
- const itemPostingGroupId =
- (cost as { itemPostingGroupId?: string | null } | undefined)
- ?.itemPostingGroupId ?? undefined;
itemsById.set(row.id as string, {
...rest,
id: readable ?? (row.id as string),
- itemPostingGroupId
+ itemPostingGroupId: itemPostingGroupIdFromEmbed(itemCost) ?? undefined
});
}
@@ -557,8 +536,20 @@ export async function evaluateLinesForSurface({
}
}
+ // Item broadcasts are gated per item by the rule's type/group filters
+ // (empty filters = every item). A line with no itemId can't match an item
+ // rule. Non-item broadcasts (appliesToAll) fire on every line.
+ const itemForLine =
+ targetType === "item" && line.itemId
+ ? itemsById.get(line.itemId)
+ : undefined;
for (const r of broadcastCompiled) {
if (seen.has(r.id)) continue;
+ if (targetType === "item") {
+ if (!itemForLine) continue;
+ const filter: ItemRuleFilter = broadcastFilters.get(r.id) ?? {};
+ if (!itemRuleAppliesToItem(itemForLine, filter)) continue;
+ }
seen.add(r.id);
compiledForLine.push(r);
}
@@ -566,36 +557,18 @@ export async function evaluateLinesForSurface({
if (compiledForLine.length === 0) continue;
// Fallback id-only ctx objects when the DB lookup misses the row (RLS,
- // missing record, late insert). Keeps `{item.id}` / `{storageUnit.id}` /
- // `{workCenter.id}` token interpolation working — the violation modal
- // shouldn't render "—" just because the join didn't materialize.
- const storageUnit = line.storageUnitId
- ? (unitsById.get(line.storageUnitId) ?? { id: line.storageUnitId })
- : undefined;
-
- const ctx: RuleContext = {
- item: line.itemId
- ? (itemsById.get(line.itemId) ?? { id: line.itemId })
- : undefined,
- storageUnit,
- workCenter: line.workCenterId
- ? (wcById.get(line.workCenterId) ?? { id: line.workCenterId })
+ // missing record, late insert) are handled inside `buildLineContext` so the
+ // `{item.id}` / `{storageUnit.id}` / `{workCenter.id}` tokens still resolve.
+ const ctx = buildLineContext({
+ line,
+ surface,
+ userId,
+ item: line.itemId ? itemsById.get(line.itemId) : undefined,
+ storageUnit: line.storageUnitId
+ ? unitsById.get(line.storageUnitId)
: undefined,
- operation: line.operation
- ? {
- id: line.operation.id ?? undefined,
- itemId: line.operation.itemId ?? undefined,
- quantity: line.operation.quantity ?? undefined,
- workInstructionId: line.operation.workInstructionId ?? undefined
- }
- : undefined,
- transaction: {
- kind: surface,
- locationId: line.locationId ?? storageUnit?.locationId ?? null,
- quantity: line.quantity,
- userId
- }
- };
+ workCenter: line.workCenterId ? wcById.get(line.workCenterId) : undefined
+ });
const ruleViolations = evaluateRules(compiledForLine, ctx, surface, {
resolveConditionValue
diff --git a/packages/ee/src/customRules/service.ts b/packages/ee/src/customRules/service.ts
index 89c4d6e76a..7eccc7a7d7 100644
--- a/packages/ee/src/customRules/service.ts
+++ b/packages/ee/src/customRules/service.ts
@@ -7,13 +7,30 @@
import type { Database } from "@carbon/database";
import { fetchAllFromTable } from "@carbon/database";
-import type {
- CustomRuleRow,
- Severity,
- TargetType,
- TransactionSurface
+import {
+ type CustomRuleRow,
+ type ItemRuleFilter,
+ itemRuleAppliesToItem,
+ type Severity,
+ type TargetType,
+ type TransactionSurface,
+ toItemRuleFilter
} from "@carbon/utils";
import type { SupabaseClient } from "@supabase/supabase-js";
+import { itemPostingGroupIdFromEmbed } from "./context";
+
+// Nullable filter columns appended to broadcast selects for item-target rules.
+const ITEM_RULE_FILTER_COLUMNS =
+ "filteredItemTypes, filteredItemGroupIds, filteredItemMatchAll";
+
+// Filter columns carried on broadcast item rules. PostgREST's typed-select
+// parser can't narrow our dynamically-built select string, so broadcast queries
+// type their rows explicitly via this shape rather than the generated Row type.
+type ItemFilterColumns = {
+ filteredItemTypes?: string[] | null;
+ filteredItemGroupIds?: string[] | null;
+ filteredItemMatchAll?: boolean | null;
+};
const assignmentTableFor = (
targetType: TargetType
@@ -60,12 +77,18 @@ type RuleRowSelect = Pick<
* Loads active rules applicable to a set of targets of one targetType.
*
* `data` keys are targetIds (explicit-assignment rules only).
- * `broadcasts` carries rules with `appliesToAll = TRUE` — caller merges them
- * into every line, including lines that carry no targetId of this targetType.
+ * `broadcasts` carries rules that fire beyond explicit assignments — caller
+ * merges them into every line:
+ * - item targets: EVERY active item rule broadcasts, then the caller gates it
+ * per line via the rule's `filteredItem*` filters (see `broadcastFilters`);
+ * empty filters = every item.
+ * - storageUnit / workCenter targets: rules with `appliesToAll = TRUE` only.
+ *
+ * `broadcastFilters` maps ruleId → item type/group filter (item targets only).
*
- * Two round-trips: explicit-assignments + appliesToAll-broadcast. Broadcast
- * fetch always runs, even when `targetIds` is empty, so a request with no
- * explicit target still sees broadcasts.
+ * Two round-trips: explicit-assignments + broadcast. Broadcast fetch always
+ * runs, even when `targetIds` is empty, so a request with no explicit target
+ * still sees broadcasts.
*/
export async function getActiveRulesForTargets(
client: SupabaseClient<Database>,
@@ -77,16 +100,32 @@ export async function getActiveRulesForTargets(
): Promise<{
data: Map<string, CustomRuleRow[]>;
broadcasts: CustomRuleRow[];
+ broadcastFilters: Map<string, ItemRuleFilter>;
error: unknown;
}> {
const out = new Map<string, CustomRuleRow[]>();
+ const broadcastFilters = new Map<string, ItemRuleFilter>();
const ruleCols =
"id, targetType, severity, message, conditionAst, surfaces, updatedAt, active";
+ const isItem = args.targetType === "item";
+ // Item broadcasts carry their filters so the caller can gate per item.
+ // Annotated `string` so PostgREST yields generically-typed rows (the dynamic
+ // select string can't be statically parsed); rows are cast explicitly below.
+ const broadcastCols: string = isItem
+ ? `${ruleCols}, ${ITEM_RULE_FILTER_COLUMNS}`
+ : ruleCols;
const table = assignmentTableFor(args.targetType);
const idCol = targetIdColumnFor(args.targetType);
+ const broadcastBase = client
+ .from("customRule")
+ .select(broadcastCols)
+ .eq("companyId", args.companyId)
+ .eq("targetType", args.targetType)
+ .eq("active", true);
+
const [explicit, broadcast] = await Promise.all([
args.targetIds.length > 0
? (client as SupabaseClient<Database>)
@@ -95,19 +134,24 @@ export async function getActiveRulesForTargets(
.in(idCol, args.targetIds)
.eq("companyId", args.companyId)
: Promise.resolve({ data: [], error: null }),
- client
- .from("customRule")
- .select(ruleCols)
- .eq("companyId", args.companyId)
- .eq("targetType", args.targetType)
- .eq("appliesToAll", true)
- .eq("active", true)
+ // Item rules all broadcast (filtered per item); non-item only when appliesToAll.
+ isItem ? broadcastBase : broadcastBase.eq("appliesToAll", true)
]);
if (explicit.error)
- return { data: out, broadcasts: [], error: explicit.error };
+ return {
+ data: out,
+ broadcasts: [],
+ broadcastFilters,
+ error: explicit.error
+ };
if (broadcast.error)
- return { data: out, broadcasts: [], error: broadcast.error };
+ return {
+ data: out,
+ broadcasts: [],
+ broadcastFilters,
+ error: broadcast.error
+ };
for (const r of explicit.data ?? []) {
const row = r as unknown as {
@@ -125,9 +169,18 @@ export async function getActiveRulesForTargets(
else out.set(targetId, [node as CustomRuleRow]);
}
- const broadcasts = (broadcast.data ?? []) as unknown as CustomRuleRow[];
+ // `as unknown as` is required: a dynamic select string degrades PostgREST's
+ // row type to `GenericStringError`, which doesn't overlap our explicit shape.
+ const broadcasts = (broadcast.data ?? []) as unknown as (CustomRuleRow &
+ ItemFilterColumns)[];
+
+ if (isItem) {
+ for (const row of broadcasts) {
+ broadcastFilters.set(row.id, toItemRuleFilter(row));
+ }
+ }
- return { data: out, broadcasts, error: null };
+ return { data: out, broadcasts, broadcastFilters, error: null };
}
/**
@@ -167,11 +220,27 @@ export async function getRuleAssignmentsForTarget(
// Item / workCenter targets are flat — keep the simple direct query.
const lookupIds = await resolveLookupIds(client, args);
- // Broadcast (`appliesToAll`) rules govern every target of this targetType.
- // Surface them alongside explicit + inherited rows so the drawer shows the
- // full set the evaluator will fire (was previously hidden — drawer showed
- // "0 assignments" while broadcasts still triggered).
- const [res, broadcastsRes] = await Promise.all([
+ // Broadcast rules govern targets beyond explicit assignments. Surface them
+ // alongside explicit + inherited rows so the drawer shows the full set the
+ // evaluator will fire (was previously hidden — drawer showed "0 assignments"
+ // while broadcasts still triggered).
+ // - item: EVERY active item rule broadcasts, gated per item by its
+ // type/group filters (empty = all items) — mirrors the evaluator.
+ // - storageUnit / workCenter: rules with `appliesToAll = TRUE`.
+ const isItem = args.targetType === "item";
+ const baseBroadcastCols =
+ "id, name, targetType, severity, message, active, surfaces, appliesToAll, createdAt";
+ // `string` so PostgREST yields generic rows; cast explicitly at the loop.
+ const broadcastCols: string = isItem
+ ? `${baseBroadcastCols}, ${ITEM_RULE_FILTER_COLUMNS}`
+ : baseBroadcastCols;
+ const broadcastBase = client
+ .from("customRule")
+ .select(broadcastCols)
+ .eq("companyId", args.companyId)
+ .eq("targetType", args.targetType);
+
+ const [res, broadcastsRes, itemCtxRes] = await Promise.all([
(client as SupabaseClient<Database>)
.from(table)
.select(
@@ -179,18 +248,35 @@ export async function getRuleAssignmentsForTarget(
)
.in(idCol, lookupIds)
.eq("companyId", args.companyId),
- client
- .from("customRule")
- .select(
- "id, name, targetType, severity, message, active, surfaces, appliesToAll, createdAt"
- )
- .eq("companyId", args.companyId)
- .eq("targetType", args.targetType)
- .eq("appliesToAll", true)
+ isItem ? broadcastBase : broadcastBase.eq("appliesToAll", true),
+ // Item type/group for this target so we can gate item broadcasts the same
+ // way the evaluator does.
+ isItem
+ ? client
+ .from("item")
+ .select("type, itemCost(itemPostingGroupId)")
+ .eq("id", args.targetId)
+ .eq("companyId", args.companyId)
+ .maybeSingle()
+ : Promise.resolve({ data: null, error: null })
]);
if (res.error) return { data: [], error: res.error };
if (broadcastsRes.error) return { data: [], error: broadcastsRes.error };
+ if (itemCtxRes.error) return { data: [], error: itemCtxRes.error };
+
+ // Flatten itemPostingGroupId off the 1:1 itemCost embed for filter matching.
+ const itemCtx = (() => {
+ const row = itemCtxRes.data as {
+ type?: unknown;
+ itemCost?: unknown;
+ } | null;
+ if (!row) return null;
+ return {
+ type: row.type,
+ itemPostingGroupId: itemPostingGroupIdFromEmbed(row.itemCost)
+ };
+ })();
// Resolve ancestor names in one extra query so the UI doesn't need to
// re-fetch. Only the storageUnit case can yield non-self owner ids.
@@ -259,19 +345,35 @@ export async function getRuleAssignmentsForTarget(
// or the rule's `appliesToAll` flag to render the "Applies to all" badge and
// suppress unassign. Skip when already present as an explicit row (shouldn't
// happen in practice — broadcast rules can't be assigned — but be defensive).
- for (const b of (broadcastsRes.data ?? []) as Array<{
- id: string;
- name: string;
- targetType: TargetType;
- severity: Severity;
- message: string;
- active: boolean;
- surfaces: TransactionSurface[];
- appliesToAll: boolean;
- createdAt: string | null;
- }>) {
+ // `as unknown as`: dynamic select → PostgREST `GenericStringError` row type.
+ for (const b of (broadcastsRes.data ?? []) as unknown as Array<
+ {
+ id: string;
+ name: string;
+ targetType: TargetType;
+ severity: Severity;
+ message: string;
+ active: boolean;
+ surfaces: TransactionSurface[];
+ appliesToAll: boolean;
+ createdAt: string | null;
+ } & ItemFilterColumns
+ >) {
if (b.active === false) continue;
if (byRuleId.has(b.id)) continue;
+
+ // Item rules: only surface those whose filter matches this item. Label by
+ // reach so the drawer reads "All items" vs a filtered match.
+ let label = "Applies to all";
+ if (isItem) {
+ const filter = toItemRuleFilter(b);
+ if (itemCtx && !itemRuleAppliesToItem(itemCtx, filter)) continue;
+ const filterless =
+ (filter.filteredItemTypes?.length ?? 0) === 0 &&
+ (filter.filteredItemGroupIds?.length ?? 0) === 0;
+ label = filterless ? "All items" : "Matches item filters";
+ }
+
byRuleId.set(b.id, {
ownerId: "__all__",
ruleId: b.id,
@@ -287,7 +389,7 @@ export async function getRuleAssignmentsForTarget(
appliesToAll: b.appliesToAll
},
inheritedFromId: "__all__",
- inheritedFromName: "Applies to all"
+ inheritedFromName: label
});
}
diff --git a/packages/locale/locales/de/erp.po b/packages/locale/locales/de/erp.po
index df2b4d7fe6..c0593c20f7 100644
--- a/packages/locale/locales/de/erp.po
+++ b/packages/locale/locales/de/erp.po
@@ -15,6 +15,10 @@ msgstr ""
msgid " A supplier is a business or person who sells you parts or services."
msgstr "Ein Lieferant ist ein Unternehmen oder eine Person, die dir Teile oder Dienstleistungen verkauft."
+#. placeholder {0}: fieldDef?.label ?? condition.field
+msgid "\"{0}\" isn't available on the selected surface(s). Pick another field."
+msgstr ""
+
msgid "\"{storageUnitName}\" has {childCount} direct nested storage units. Deleting it will also delete them and anything underneath them. This cannot be undone."
msgstr "„${storageUnitName}\" hat ${childCount} direkt verschachtelte Speichereinheiten. Das Löschen führt auch zum Löschen dieser und aller darunter liegenden Einheiten. Dies kann nicht rückgängig gemacht werden."
@@ -464,6 +468,9 @@ msgstr "Betragtyp"
msgid "An item cannot be added to itself."
msgstr "Ein Element kann nicht zu sich selbst hinzugefügt werden."
+msgid "AND"
+msgstr ""
+
msgid "and {remaining} more"
msgstr "und {remaining} weitere"
@@ -482,6 +489,12 @@ msgstr "Annotationstext ist erforderlich"
msgid "Annotation updated"
msgstr "Anmerkung aktualisiert"
+msgid "Any item group"
+msgstr ""
+
+msgid "Any item type"
+msgstr ""
+
msgid "API and Webhooks"
msgstr "API und Webhooks"
@@ -506,9 +519,6 @@ msgstr "Gilt für"
msgid "Applies to all"
msgstr "Gilt für alle"
-msgid "Applies to all items"
-msgstr "Gilt für alle Artikel"
-
msgid "Applies to all storage units"
msgstr "Gilt für alle Lagereinheiten"
@@ -1392,6 +1402,9 @@ msgstr "Spaltensichtbarkeit und -reihenfolge"
msgid "Columns"
msgstr "Spalten"
+msgid "Combine filters"
+msgstr ""
+
msgid "Coming soon"
msgstr "Demnächst verfügbar"
@@ -2978,6 +2991,9 @@ msgstr "Mitarbeitertypen"
msgid "Employees"
msgstr "Mitarbeiter"
+msgid "Empty = match every item"
+msgstr ""
+
msgid "Empty work centers"
msgstr "Leere Arbeitszentren"
@@ -4151,9 +4167,15 @@ msgstr "Artikel"
msgid "Item {scannedItem} is not the same as the item {expectedItem}"
msgstr "Artikel {scannedItem} ist nicht derselbe wie der Artikel {expectedItem}"
+msgid "Item filters"
+msgstr ""
+
msgid "Item Group"
msgstr "Artikelgruppe"
+msgid "Item groups"
+msgstr ""
+
msgid "Item Groups"
msgstr "Artikelgruppen"
@@ -4163,12 +4185,21 @@ msgstr "Artikel-ID"
msgid "Item Master"
msgstr "Artikelstamm"
+msgid "Item must match a selected type AND a selected group"
+msgstr ""
+
+msgid "Item must match a selected type OR a selected group"
+msgstr ""
+
msgid "Item Scope"
msgstr "Artikelbereich"
msgid "Item Type"
msgstr "Artikeltyp"
+msgid "Item types"
+msgstr ""
+
msgid "items"
msgstr "Artikel"
@@ -4585,9 +4616,15 @@ msgstr "Übereinstimmung"
msgid "Match all"
msgstr "Alle abgleichen"
+msgid "Match all (AND)"
+msgstr ""
+
msgid "Match any"
msgstr "Beliebige abgleichen"
+msgid "Match any (OR)"
+msgstr ""
+
msgid "Match none"
msgstr "Keine Übereinstimmung"
@@ -5519,6 +5556,9 @@ msgstr "Optionaler Kontext für diese Regel"
msgid "Options"
msgstr "Optionen"
+msgid "OR"
+msgstr ""
+
msgid "Order"
msgstr "Bestellung"
diff --git a/packages/locale/locales/en/erp.po b/packages/locale/locales/en/erp.po
index 3acac68ad9..4ec19272bf 100644
--- a/packages/locale/locales/en/erp.po
+++ b/packages/locale/locales/en/erp.po
@@ -15,6 +15,10 @@ msgstr ""
msgid " A supplier is a business or person who sells you parts or services."
msgstr " A supplier is a business or person who sells you parts or services."
+#. placeholder {0}: fieldDef?.label ?? condition.field
+msgid "\"{0}\" isn't available on the selected surface(s). Pick another field."
+msgstr "\"{0}\" isn't available on the selected surface(s). Pick another field."
+
msgid "\"{storageUnitName}\" has {childCount} direct nested storage units. Deleting it will also delete them and anything underneath them. This cannot be undone."
msgstr "\"{storageUnitName}\" has {childCount} direct nested storage units. Deleting it will also delete them and anything underneath them. This cannot be undone."
@@ -464,6 +468,9 @@ msgstr "Amount Type"
msgid "An item cannot be added to itself."
msgstr "An item cannot be added to itself."
+msgid "AND"
+msgstr "AND"
+
msgid "and {remaining} more"
msgstr "and {remaining} more"
@@ -482,6 +489,12 @@ msgstr "Annotation text is required"
msgid "Annotation updated"
msgstr "Annotation updated"
+msgid "Any item group"
+msgstr "Any item group"
+
+msgid "Any item type"
+msgstr "Any item type"
+
msgid "API and Webhooks"
msgstr "API and Webhooks"
@@ -506,9 +519,6 @@ msgstr "Applies to"
msgid "Applies to all"
msgstr "Applies to all"
-msgid "Applies to all items"
-msgstr "Applies to all items"
-
msgid "Applies to all storage units"
msgstr "Applies to all storage units"
@@ -1392,6 +1402,9 @@ msgstr "Column visibility and order"
msgid "Columns"
msgstr "Columns"
+msgid "Combine filters"
+msgstr "Combine filters"
+
msgid "Coming soon"
msgstr "Coming soon"
@@ -2978,6 +2991,9 @@ msgstr "Employee Types"
msgid "Employees"
msgstr "Employees"
+msgid "Empty = match every item"
+msgstr "Empty = match every item"
+
msgid "Empty work centers"
msgstr "Empty work centers"
@@ -4151,9 +4167,15 @@ msgstr "Item"
msgid "Item {scannedItem} is not the same as the item {expectedItem}"
msgstr "Item {scannedItem} is not the same as the item {expectedItem}"
+msgid "Item filters"
+msgstr "Item filters"
+
msgid "Item Group"
msgstr "Item Group"
+msgid "Item groups"
+msgstr "Item groups"
+
msgid "Item Groups"
msgstr "Item Groups"
@@ -4163,12 +4185,21 @@ msgstr "Item ID"
msgid "Item Master"
msgstr "Item Master"
+msgid "Item must match a selected type AND a selected group"
+msgstr "Item must match a selected type AND a selected group"
+
+msgid "Item must match a selected type OR a selected group"
+msgstr "Item must match a selected type OR a selected group"
+
msgid "Item Scope"
msgstr "Item Scope"
msgid "Item Type"
msgstr "Item Type"
+msgid "Item types"
+msgstr "Item types"
+
msgid "items"
msgstr "items"
@@ -4585,9 +4616,15 @@ msgstr "Match"
msgid "Match all"
msgstr "Match all"
+msgid "Match all (AND)"
+msgstr "Match all (AND)"
+
msgid "Match any"
msgstr "Match any"
+msgid "Match any (OR)"
+msgstr "Match any (OR)"
+
msgid "Match none"
msgstr "Match none"
@@ -5519,6 +5556,9 @@ msgstr "Optional context for this rule"
msgid "Options"
msgstr "Options"
+msgid "OR"
+msgstr "OR"
+
msgid "Order"
msgstr "Order"
diff --git a/packages/locale/locales/es/erp.po b/packages/locale/locales/es/erp.po
index 8f23d5b9ce..ba844c863e 100644
--- a/packages/locale/locales/es/erp.po
+++ b/packages/locale/locales/es/erp.po
@@ -15,6 +15,10 @@ msgstr ""
msgid " A supplier is a business or person who sells you parts or services."
msgstr "Un proveedor es una empresa o persona que te vende piezas o servicios."
+#. placeholder {0}: fieldDef?.label ?? condition.field
+msgid "\"{0}\" isn't available on the selected surface(s). Pick another field."
+msgstr ""
+
msgid "\"{storageUnitName}\" has {childCount} direct nested storage units. Deleting it will also delete them and anything underneath them. This cannot be undone."
msgstr "\"{storageUnitName}\" tiene {childCount} unidades de almacenamiento anidadas directas. Eliminarla también eliminará estas unidades y todo lo que hay debajo de ellas. Esto no se puede deshacer."
@@ -464,6 +468,9 @@ msgstr "Tipo de Cantidad"
msgid "An item cannot be added to itself."
msgstr "Un elemento no puede agregarse a sí mismo."
+msgid "AND"
+msgstr ""
+
msgid "and {remaining} more"
msgstr "y {remaining} más"
@@ -482,6 +489,12 @@ msgstr "El texto de la anotación es obligatorio"
msgid "Annotation updated"
msgstr "Anotación actualizada"
+msgid "Any item group"
+msgstr ""
+
+msgid "Any item type"
+msgstr ""
+
msgid "API and Webhooks"
msgstr "API y Webhooks"
@@ -506,9 +519,6 @@ msgstr "Se aplica a"
msgid "Applies to all"
msgstr "Se aplica a todos"
-msgid "Applies to all items"
-msgstr "Se aplica a todos los artículos"
-
msgid "Applies to all storage units"
msgstr "Se aplica a todas las unidades de almacenamiento"
@@ -1392,6 +1402,9 @@ msgstr "Visibilidad y orden de columnas"
msgid "Columns"
msgstr "Columnas"
+msgid "Combine filters"
+msgstr ""
+
msgid "Coming soon"
msgstr "Próximamente"
@@ -2978,6 +2991,9 @@ msgstr "Tipos de Empleados"
msgid "Employees"
msgstr "Empleados"
+msgid "Empty = match every item"
+msgstr ""
+
msgid "Empty work centers"
msgstr "Centros de trabajo vacíos"
@@ -4151,9 +4167,15 @@ msgstr "Artículo"
msgid "Item {scannedItem} is not the same as the item {expectedItem}"
msgstr "El artículo {scannedItem} no es el mismo que el artículo {expectedItem}"
+msgid "Item filters"
+msgstr ""
+
msgid "Item Group"
msgstr "Grupo de Artículos"
+msgid "Item groups"
+msgstr ""
+
msgid "Item Groups"
msgstr "Grupos de Artículos"
@@ -4163,12 +4185,21 @@ msgstr "ID de Artículo"
msgid "Item Master"
msgstr "Maestro de Artículos"
+msgid "Item must match a selected type AND a selected group"
+msgstr ""
+
+msgid "Item must match a selected type OR a selected group"
+msgstr ""
+
msgid "Item Scope"
msgstr "Alcance de Artículos"
msgid "Item Type"
msgstr "Tipo de Artículo"
+msgid "Item types"
+msgstr ""
+
msgid "items"
msgstr "artículos"
@@ -4585,9 +4616,15 @@ msgstr "Coincidir"
msgid "Match all"
msgstr "Coincidir todos"
+msgid "Match all (AND)"
+msgstr ""
+
msgid "Match any"
msgstr "Coincidir con cualquiera"
+msgid "Match any (OR)"
+msgstr ""
+
msgid "Match none"
msgstr "No coincide ninguno"
@@ -5519,6 +5556,9 @@ msgstr "Contexto opcional para esta regla"
msgid "Options"
msgstr "Opciones"
+msgid "OR"
+msgstr ""
+
msgid "Order"
msgstr "Pedido"
diff --git a/packages/locale/locales/fr/erp.po b/packages/locale/locales/fr/erp.po
index a71181dac9..74fb893cdf 100644
--- a/packages/locale/locales/fr/erp.po
+++ b/packages/locale/locales/fr/erp.po
@@ -15,6 +15,10 @@ msgstr ""
msgid " A supplier is a business or person who sells you parts or services."
msgstr "Un fournisseur est une entreprise ou une personne qui vous vend des pièces ou des services."
+#. placeholder {0}: fieldDef?.label ?? condition.field
+msgid "\"{0}\" isn't available on the selected surface(s). Pick another field."
+msgstr ""
+
msgid "\"{storageUnitName}\" has {childCount} direct nested storage units. Deleting it will also delete them and anything underneath them. This cannot be undone."
msgstr "« ${storageUnitName} » possède ${childCount} unités de stockage imbriquées directes. La supprimer supprimera également ces unités et tout ce qui se trouve en dessous. Cette action ne peut pas être annulée."
@@ -464,6 +468,9 @@ msgstr "Type de montant"
msgid "An item cannot be added to itself."
msgstr "Un article ne peut pas être ajouté à lui-même."
+msgid "AND"
+msgstr ""
+
msgid "and {remaining} more"
msgstr "et {remaining} autres"
@@ -482,6 +489,12 @@ msgstr "Le texte d'annotation est requis"
msgid "Annotation updated"
msgstr "Annotation mise à jour"
+msgid "Any item group"
+msgstr ""
+
+msgid "Any item type"
+msgstr ""
+
msgid "API and Webhooks"
msgstr "API et Webhooks"
@@ -506,9 +519,6 @@ msgstr "S'applique à"
msgid "Applies to all"
msgstr "S'applique à tous"
-msgid "Applies to all items"
-msgstr "S'applique à tous les articles"
-
msgid "Applies to all storage units"
msgstr "S'applique à toutes les unités de stockage"
@@ -1392,6 +1402,9 @@ msgstr "Visibilité et ordre des colonnes"
msgid "Columns"
msgstr "Colonnes"
+msgid "Combine filters"
+msgstr ""
+
msgid "Coming soon"
msgstr "Bientôt disponible"
@@ -2978,6 +2991,9 @@ msgstr "Types d'employés"
msgid "Employees"
msgstr "Employés"
+msgid "Empty = match every item"
+msgstr ""
+
msgid "Empty work centers"
msgstr "Centres de travail vides"
@@ -4151,9 +4167,15 @@ msgstr "Article"
msgid "Item {scannedItem} is not the same as the item {expectedItem}"
msgstr "L'article {scannedItem} n'est pas le même que l'article {expectedItem}"
+msgid "Item filters"
+msgstr ""
+
msgid "Item Group"
msgstr "Groupe d'articles"
+msgid "Item groups"
+msgstr ""
+
msgid "Item Groups"
msgstr "Groupes d'articles"
@@ -4163,12 +4185,21 @@ msgstr "ID Article"
msgid "Item Master"
msgstr "Maître d'article"
+msgid "Item must match a selected type AND a selected group"
+msgstr ""
+
+msgid "Item must match a selected type OR a selected group"
+msgstr ""
+
msgid "Item Scope"
msgstr "Portée des articles"
msgid "Item Type"
msgstr "Type d'article"
+msgid "Item types"
+msgstr ""
+
msgid "items"
msgstr "articles"
@@ -4585,9 +4616,15 @@ msgstr "Correspondance"
msgid "Match all"
msgstr "Correspondre à tous"
+msgid "Match all (AND)"
+msgstr ""
+
msgid "Match any"
msgstr "Correspondre à au moins un"
+msgid "Match any (OR)"
+msgstr ""
+
msgid "Match none"
msgstr "Ne correspond à aucun"
@@ -5519,6 +5556,9 @@ msgstr "Contexte optionnel pour cette règle"
msgid "Options"
msgstr "Options"
+msgid "OR"
+msgstr ""
+
msgid "Order"
msgstr "Commande"
diff --git a/packages/locale/locales/hi/erp.po b/packages/locale/locales/hi/erp.po
index 83a8c080a3..3cd1e6f71b 100644
--- a/packages/locale/locales/hi/erp.po
+++ b/packages/locale/locales/hi/erp.po
@@ -15,6 +15,10 @@ msgstr ""
msgid " A supplier is a business or person who sells you parts or services."
msgstr "एक आपूर्तिकर्ता एक व्यवसाय या व्यक्ति है जो आपको पार्ट्स या सेवाएं बेचता है।"
+#. placeholder {0}: fieldDef?.label ?? condition.field
+msgid "\"{0}\" isn't available on the selected surface(s). Pick another field."
+msgstr ""
+
msgid "\"{storageUnitName}\" has {childCount} direct nested storage units. Deleting it will also delete them and anything underneath them. This cannot be undone."
msgstr "\"{storageUnitName}\" के {childCount} सीधे नेस्टेड स्टोरेज यूनिट हैं। इसे हटाने से वे और उनके अंदर की सभी चीजें भी हट जाएंगी। यह पूर्ववत नहीं किया जा सकता।"
@@ -464,6 +468,9 @@ msgstr "राशि प्रकार"
msgid "An item cannot be added to itself."
msgstr "एक आइटम को स्वयं में नहीं जोड़ा जा सकता।"
+msgid "AND"
+msgstr ""
+
msgid "and {remaining} more"
msgstr "और {remaining} अधिक"
@@ -482,6 +489,12 @@ msgstr "एनोटेशन टेक्स्ट आवश्यक है"
msgid "Annotation updated"
msgstr "एनोटेशन अपडेट किया गया"
+msgid "Any item group"
+msgstr ""
+
+msgid "Any item type"
+msgstr ""
+
msgid "API and Webhooks"
msgstr "API और Webhooks"
@@ -506,9 +519,6 @@ msgstr "लागू होता है"
msgid "Applies to all"
msgstr "सभी पर लागू होता है"
-msgid "Applies to all items"
-msgstr "सभी आइटम पर लागू होता है"
-
msgid "Applies to all storage units"
msgstr "सभी स्टोरेज यूनिट्स पर लागू होता है"
@@ -1392,6 +1402,9 @@ msgstr "कॉलम दृश्यता और क्रम"
msgid "Columns"
msgstr "कॉलम"
+msgid "Combine filters"
+msgstr ""
+
msgid "Coming soon"
msgstr "जल्द ही आ रहा है"
@@ -2978,6 +2991,9 @@ msgstr "कर्मचारी प्रकार"
msgid "Employees"
msgstr "कर्मचारी"
+msgid "Empty = match every item"
+msgstr ""
+
msgid "Empty work centers"
msgstr "खाली कार्य केंद्र"
@@ -4151,9 +4167,15 @@ msgstr "आइटम"
msgid "Item {scannedItem} is not the same as the item {expectedItem}"
msgstr "आइटम {scannedItem} आइटम {expectedItem} के समान नहीं है"
+msgid "Item filters"
+msgstr ""
+
msgid "Item Group"
msgstr "आइटम समूह"
+msgid "Item groups"
+msgstr ""
+
msgid "Item Groups"
msgstr "आइटम समूह"
@@ -4163,12 +4185,21 @@ msgstr "आइटम आईडी"
msgid "Item Master"
msgstr "आइटम मास्टर"
+msgid "Item must match a selected type AND a selected group"
+msgstr ""
+
+msgid "Item must match a selected type OR a selected group"
+msgstr ""
+
msgid "Item Scope"
msgstr "आइटम स्कोप"
msgid "Item Type"
msgstr "आइटम प्रकार"
+msgid "Item types"
+msgstr ""
+
msgid "items"
msgstr "आइटम"
@@ -4585,9 +4616,15 @@ msgstr "मेल खाएं"
msgid "Match all"
msgstr "सभी से मेल खाएं"
+msgid "Match all (AND)"
+msgstr ""
+
msgid "Match any"
msgstr "किसी भी को मिलाएं"
+msgid "Match any (OR)"
+msgstr ""
+
msgid "Match none"
msgstr "कोई भी मेल न खाएं"
@@ -5519,6 +5556,9 @@ msgstr "इस नियम के लिए वैकल्पिक संद
msgid "Options"
msgstr "विकल्प"
+msgid "OR"
+msgstr ""
+
msgid "Order"
msgstr "आदेश"
diff --git a/packages/locale/locales/it/erp.po b/packages/locale/locales/it/erp.po
index 8154088f42..c37af9afce 100644
--- a/packages/locale/locales/it/erp.po
+++ b/packages/locale/locales/it/erp.po
@@ -15,6 +15,10 @@ msgstr ""
msgid " A supplier is a business or person who sells you parts or services."
msgstr "Un fornitore è un'azienda o una persona che ti vende parti o servizi."
+#. placeholder {0}: fieldDef?.label ?? condition.field
+msgid "\"{0}\" isn't available on the selected surface(s). Pick another field."
+msgstr ""
+
msgid "\"{storageUnitName}\" has {childCount} direct nested storage units. Deleting it will also delete them and anything underneath them. This cannot be undone."
msgstr "\"{storageUnitName}\" ha {childCount} unità di archiviazione nidificate dirette. L'eliminazione comporterà anche l'eliminazione di queste e di tutto ciò che si trova al di sotto. Questa azione non può essere annullata."
@@ -464,6 +468,9 @@ msgstr "Tipo di Importo"
msgid "An item cannot be added to itself."
msgstr "Un articolo non può essere aggiunto a se stesso."
+msgid "AND"
+msgstr ""
+
msgid "and {remaining} more"
msgstr "e {remaining} altri"
@@ -482,6 +489,12 @@ msgstr "Il testo dell'annotazione è obbligatorio"
msgid "Annotation updated"
msgstr "Annotazione aggiornata"
+msgid "Any item group"
+msgstr ""
+
+msgid "Any item type"
+msgstr ""
+
msgid "API and Webhooks"
msgstr "API e Webhook"
@@ -506,9 +519,6 @@ msgstr "Si applica a"
msgid "Applies to all"
msgstr "Si applica a tutti"
-msgid "Applies to all items"
-msgstr "Si applica a tutti gli articoli"
-
msgid "Applies to all storage units"
msgstr "Si applica a tutte le unità di stoccaggio"
@@ -1392,6 +1402,9 @@ msgstr "Visibilità e ordine delle colonne"
msgid "Columns"
msgstr "Colonne"
+msgid "Combine filters"
+msgstr ""
+
msgid "Coming soon"
msgstr "Disponibile presto"
@@ -2978,6 +2991,9 @@ msgstr "Tipi di Dipendenti"
msgid "Employees"
msgstr "Dipendenti"
+msgid "Empty = match every item"
+msgstr ""
+
msgid "Empty work centers"
msgstr "Centri di lavoro vuoti"
@@ -4151,9 +4167,15 @@ msgstr "Articolo"
msgid "Item {scannedItem} is not the same as the item {expectedItem}"
msgstr "L'articolo {scannedItem} non è lo stesso dell'articolo {expectedItem}"
+msgid "Item filters"
+msgstr ""
+
msgid "Item Group"
msgstr "Gruppo Articoli"
+msgid "Item groups"
+msgstr ""
+
msgid "Item Groups"
msgstr "Gruppi di articoli"
@@ -4163,12 +4185,21 @@ msgstr "ID Articolo"
msgid "Item Master"
msgstr "Anagrafica Articolo"
+msgid "Item must match a selected type AND a selected group"
+msgstr ""
+
+msgid "Item must match a selected type OR a selected group"
+msgstr ""
+
msgid "Item Scope"
msgstr "Ambito Articolo"
msgid "Item Type"
msgstr "Tipo di articolo"
+msgid "Item types"
+msgstr ""
+
msgid "items"
msgstr "articoli"
@@ -4585,9 +4616,15 @@ msgstr "Corrispondenza"
msgid "Match all"
msgstr "Corrisponde a tutti"
+msgid "Match all (AND)"
+msgstr ""
+
msgid "Match any"
msgstr "Corrisponde a uno qualsiasi"
+msgid "Match any (OR)"
+msgstr ""
+
msgid "Match none"
msgstr "Non corrispondere a nessuno"
@@ -5519,6 +5556,9 @@ msgstr "Contesto facoltativo per questa regola"
msgid "Options"
msgstr "Opzioni"
+msgid "OR"
+msgstr ""
+
msgid "Order"
msgstr "Ordine"
diff --git a/packages/locale/locales/ja/erp.po b/packages/locale/locales/ja/erp.po
index db05de6780..34bff97898 100644
--- a/packages/locale/locales/ja/erp.po
+++ b/packages/locale/locales/ja/erp.po
@@ -15,6 +15,10 @@ msgstr ""
msgid " A supplier is a business or person who sells you parts or services."
msgstr "サプライヤーは、あなたに部品またはサービスを販売する企業または個人です。"
+#. placeholder {0}: fieldDef?.label ?? condition.field
+msgid "\"{0}\" isn't available on the selected surface(s). Pick another field."
+msgstr ""
+
msgid "\"{storageUnitName}\" has {childCount} direct nested storage units. Deleting it will also delete them and anything underneath them. This cannot be undone."
msgstr "「{storageUnitName}」には{childCount}個の直下の階層化されたストレージユニットがあります。これを削除すると、それらとその下にあるすべてのものも削除されます。この操作は取り消せません。"
@@ -464,6 +468,9 @@ msgstr "金額タイプ"
msgid "An item cannot be added to itself."
msgstr "アイテムをそれ自体に追加することはできません。"
+msgid "AND"
+msgstr ""
+
msgid "and {remaining} more"
msgstr "そして{remaining}件以上"
@@ -482,6 +489,12 @@ msgstr "注釈テキストが必要です"
msgid "Annotation updated"
msgstr "注釈が更新されました"
+msgid "Any item group"
+msgstr ""
+
+msgid "Any item type"
+msgstr ""
+
msgid "API and Webhooks"
msgstr "APIとWebhooks"
@@ -506,9 +519,6 @@ msgstr "適用対象"
msgid "Applies to all"
msgstr "すべてに適用"
-msgid "Applies to all items"
-msgstr "すべてのアイテムに適用"
-
msgid "Applies to all storage units"
msgstr "すべての保管ユニットに適用"
@@ -1392,6 +1402,9 @@ msgstr "列の表示と順序"
msgid "Columns"
msgstr "列"
+msgid "Combine filters"
+msgstr ""
+
msgid "Coming soon"
msgstr "近日公開予定"
@@ -2978,6 +2991,9 @@ msgstr "従業員タイプ"
msgid "Employees"
msgstr "従業員"
+msgid "Empty = match every item"
+msgstr ""
+
msgid "Empty work centers"
msgstr "空の作業センター"
@@ -4151,9 +4167,15 @@ msgstr "アイテム"
msgid "Item {scannedItem} is not the same as the item {expectedItem}"
msgstr "アイテム {scannedItem} は、アイテム {expectedItem} と同じではありません"
+msgid "Item filters"
+msgstr ""
+
msgid "Item Group"
msgstr "品目グループ"
+msgid "Item groups"
+msgstr ""
+
msgid "Item Groups"
msgstr "アイテムグループ"
@@ -4163,12 +4185,21 @@ msgstr "アイテムID"
msgid "Item Master"
msgstr "アイテムマスター"
+msgid "Item must match a selected type AND a selected group"
+msgstr ""
+
+msgid "Item must match a selected type OR a selected group"
+msgstr ""
+
msgid "Item Scope"
msgstr "アイテムスコープ"
msgid "Item Type"
msgstr "アイテムタイプ"
+msgid "Item types"
+msgstr ""
+
msgid "items"
msgstr "アイテム"
@@ -4585,9 +4616,15 @@ msgstr "マッチ"
msgid "Match all"
msgstr "すべてに一致"
+msgid "Match all (AND)"
+msgstr ""
+
msgid "Match any"
msgstr "いずれかに一致"
+msgid "Match any (OR)"
+msgstr ""
+
msgid "Match none"
msgstr "いずれにも一致しない"
@@ -5519,6 +5556,9 @@ msgstr "このルールのオプションコンテキスト"
msgid "Options"
msgstr "オプション"
+msgid "OR"
+msgstr ""
+
msgid "Order"
msgstr "注文"
diff --git a/packages/locale/locales/pl/erp.po b/packages/locale/locales/pl/erp.po
index 4cdf4c0f0b..efcab8cca7 100644
--- a/packages/locale/locales/pl/erp.po
+++ b/packages/locale/locales/pl/erp.po
@@ -15,6 +15,10 @@ msgstr ""
msgid " A supplier is a business or person who sells you parts or services."
msgstr "Dostawca to firma lub osoba, która sprzedaje Ci części lub usługi."
+#. placeholder {0}: fieldDef?.label ?? condition.field
+msgid "\"{0}\" isn't available on the selected surface(s). Pick another field."
+msgstr ""
+
msgid "\"{storageUnitName}\" has {childCount} direct nested storage units. Deleting it will also delete them and anything underneath them. This cannot be undone."
msgstr "„{storageUnitName}\" ma {childCount} bezpośrednio zagnieżdżonych jednostek magazynowych. Usunięcie go spowoduje również usunięcie ich i wszystkiego pod nimi. Tej operacji nie można cofnąć."
@@ -464,6 +468,9 @@ msgstr "Typ kwoty"
msgid "An item cannot be added to itself."
msgstr "Przedmiot nie może być dodany do siebie."
+msgid "AND"
+msgstr ""
+
msgid "and {remaining} more"
msgstr "i {remaining} więcej"
@@ -482,6 +489,12 @@ msgstr "Tekst adnotacji jest wymagany"
msgid "Annotation updated"
msgstr "Adnotacja zaktualizowana"
+msgid "Any item group"
+msgstr ""
+
+msgid "Any item type"
+msgstr ""
+
msgid "API and Webhooks"
msgstr "API i Webhooks"
@@ -506,9 +519,6 @@ msgstr "Dotyczy"
msgid "Applies to all"
msgstr "Dotyczy wszystkich"
-msgid "Applies to all items"
-msgstr "Dotyczy wszystkich pozycji"
-
msgid "Applies to all storage units"
msgstr "Dotyczy wszystkich jednostek magazynowych"
@@ -1392,6 +1402,9 @@ msgstr "Widoczność i kolejność kolumn"
msgid "Columns"
msgstr "Kolumny"
+msgid "Combine filters"
+msgstr ""
+
msgid "Coming soon"
msgstr "Wkrótce"
@@ -2978,6 +2991,9 @@ msgstr "Typy pracowników"
msgid "Employees"
msgstr "Pracownicy"
+msgid "Empty = match every item"
+msgstr ""
+
msgid "Empty work centers"
msgstr "Puste centra pracy"
@@ -4151,9 +4167,15 @@ msgstr "Przedmiot"
msgid "Item {scannedItem} is not the same as the item {expectedItem}"
msgstr "Pozycja {scannedItem} nie jest taka sama jak pozycja {expectedItem}"
+msgid "Item filters"
+msgstr ""
+
msgid "Item Group"
msgstr "Grupa Pozycji"
+msgid "Item groups"
+msgstr ""
+
msgid "Item Groups"
msgstr "Grupy Pozycji"
@@ -4163,12 +4185,21 @@ msgstr "ID Przedmiotu"
msgid "Item Master"
msgstr "Główny element"
+msgid "Item must match a selected type AND a selected group"
+msgstr ""
+
+msgid "Item must match a selected type OR a selected group"
+msgstr ""
+
msgid "Item Scope"
msgstr "Zakres Pozycji"
msgid "Item Type"
msgstr "Typ przedmiotu"
+msgid "Item types"
+msgstr ""
+
msgid "items"
msgstr "elementy"
@@ -4585,9 +4616,15 @@ msgstr "Dopasuj"
msgid "Match all"
msgstr "Dopasuj wszystkie"
+msgid "Match all (AND)"
+msgstr ""
+
msgid "Match any"
msgstr "Dopasuj dowolny"
+msgid "Match any (OR)"
+msgstr ""
+
msgid "Match none"
msgstr "Nie dopasuj żaden"
@@ -5519,6 +5556,9 @@ msgstr "Opcjonalny kontekst dla tej reguły"
msgid "Options"
msgstr "Opcje"
+msgid "OR"
+msgstr ""
+
msgid "Order"
msgstr "Zamówienie"
diff --git a/packages/locale/locales/pt/erp.po b/packages/locale/locales/pt/erp.po
index 5964917fd9..6ab9756a75 100644
--- a/packages/locale/locales/pt/erp.po
+++ b/packages/locale/locales/pt/erp.po
@@ -15,6 +15,10 @@ msgstr ""
msgid " A supplier is a business or person who sells you parts or services."
msgstr "Um fornecedor é uma empresa ou pessoa que vende peças ou serviços para você."
+#. placeholder {0}: fieldDef?.label ?? condition.field
+msgid "\"{0}\" isn't available on the selected surface(s). Pick another field."
+msgstr ""
+
msgid "\"{storageUnitName}\" has {childCount} direct nested storage units. Deleting it will also delete them and anything underneath them. This cannot be undone."
msgstr "\"{storageUnitName}\" tem {childCount} unidades de armazenamento aninhadas diretas. Deletá-la também excluirá essas unidades e tudo que está abaixo delas. Isso não pode ser desfeito."
@@ -464,6 +468,9 @@ msgstr "Tipo de Valor"
msgid "An item cannot be added to itself."
msgstr "Um item não pode ser adicionado a si mesmo."
+msgid "AND"
+msgstr ""
+
msgid "and {remaining} more"
msgstr "e {remaining} mais"
@@ -482,6 +489,12 @@ msgstr "O texto da anotação é obrigatório"
msgid "Annotation updated"
msgstr "Anotação atualizada"
+msgid "Any item group"
+msgstr ""
+
+msgid "Any item type"
+msgstr ""
+
msgid "API and Webhooks"
msgstr "API e Webhooks"
@@ -506,9 +519,6 @@ msgstr "Aplica-se a"
msgid "Applies to all"
msgstr "Aplica-se a todos"
-msgid "Applies to all items"
-msgstr "Aplica-se a todos os itens"
-
msgid "Applies to all storage units"
msgstr "Aplica-se a todas as unidades de armazenamento"
@@ -1392,6 +1402,9 @@ msgstr "Visibilidade e ordem das colunas"
msgid "Columns"
msgstr "Colunas"
+msgid "Combine filters"
+msgstr ""
+
msgid "Coming soon"
msgstr "Em breve"
@@ -2978,6 +2991,9 @@ msgstr "Tipos de Funcionários"
msgid "Employees"
msgstr "Funcionários"
+msgid "Empty = match every item"
+msgstr ""
+
msgid "Empty work centers"
msgstr "Centros de trabalho vazios"
@@ -4151,9 +4167,15 @@ msgstr "Item"
msgid "Item {scannedItem} is not the same as the item {expectedItem}"
msgstr "Item {scannedItem} não é o mesmo que o item {expectedItem}"
+msgid "Item filters"
+msgstr ""
+
msgid "Item Group"
msgstr "Grupo de Itens"
+msgid "Item groups"
+msgstr ""
+
msgid "Item Groups"
msgstr "Grupos de Itens"
@@ -4163,12 +4185,21 @@ msgstr "ID do Item"
msgid "Item Master"
msgstr "Mestre de Item"
+msgid "Item must match a selected type AND a selected group"
+msgstr ""
+
+msgid "Item must match a selected type OR a selected group"
+msgstr ""
+
msgid "Item Scope"
msgstr "Escopo do Item"
msgid "Item Type"
msgstr "Tipo de Item"
+msgid "Item types"
+msgstr ""
+
msgid "items"
msgstr "itens"
@@ -4585,9 +4616,15 @@ msgstr "Corresponder"
msgid "Match all"
msgstr "Corresponder a todos"
+msgid "Match all (AND)"
+msgstr ""
+
msgid "Match any"
msgstr "Corresponder a qualquer"
+msgid "Match any (OR)"
+msgstr ""
+
msgid "Match none"
msgstr "Não corresponder a nenhum"
@@ -5519,6 +5556,9 @@ msgstr "Contexto opcional para esta regra"
msgid "Options"
msgstr "Opções"
+msgid "OR"
+msgstr ""
+
msgid "Order"
msgstr "Pedido"
diff --git a/packages/locale/locales/ru/erp.po b/packages/locale/locales/ru/erp.po
index 562e8b68de..ab2dada459 100644
--- a/packages/locale/locales/ru/erp.po
+++ b/packages/locale/locales/ru/erp.po
@@ -15,6 +15,10 @@ msgstr ""
msgid " A supplier is a business or person who sells you parts or services."
msgstr "Поставщик — это компания или лицо, которое продает вам детали или услуги."
+#. placeholder {0}: fieldDef?.label ?? condition.field
+msgid "\"{0}\" isn't available on the selected surface(s). Pick another field."
+msgstr ""
+
msgid "\"{storageUnitName}\" has {childCount} direct nested storage units. Deleting it will also delete them and anything underneath them. This cannot be undone."
msgstr "«{storageUnitName}» содержит {childCount} прямых вложенных единиц хранения. Удаление приведет к удалению этих единиц и всего, что находится под ними. Это действие невозможно отменить."
@@ -464,6 +468,9 @@ msgstr "Тип суммы"
msgid "An item cannot be added to itself."
msgstr "Элемент не может быть добавлен к самому себе."
+msgid "AND"
+msgstr ""
+
msgid "and {remaining} more"
msgstr "и ещё {remaining}"
@@ -482,6 +489,12 @@ msgstr "Текст аннотации обязателен"
msgid "Annotation updated"
msgstr "Аннотация обновлена"
+msgid "Any item group"
+msgstr ""
+
+msgid "Any item type"
+msgstr ""
+
msgid "API and Webhooks"
msgstr "API и Webhooks"
@@ -506,9 +519,6 @@ msgstr "Применяется к"
msgid "Applies to all"
msgstr "Применяется ко всем"
-msgid "Applies to all items"
-msgstr "Применяется ко всем товарам"
-
msgid "Applies to all storage units"
msgstr "Применяется ко всем складским единицам"
@@ -1392,6 +1402,9 @@ msgstr "Видимость и порядок столбцов"
msgid "Columns"
msgstr "Столбцы"
+msgid "Combine filters"
+msgstr ""
+
msgid "Coming soon"
msgstr "Скоро"
@@ -2978,6 +2991,9 @@ msgstr "Типы сотрудников"
msgid "Employees"
msgstr "Сотрудники"
+msgid "Empty = match every item"
+msgstr ""
+
msgid "Empty work centers"
msgstr "Пустые рабочие центры"
@@ -4151,9 +4167,15 @@ msgstr "Товар"
msgid "Item {scannedItem} is not the same as the item {expectedItem}"
msgstr "Товар {scannedItem} не совпадает с товаром {expectedItem}"
+msgid "Item filters"
+msgstr ""
+
msgid "Item Group"
msgstr "Группа товаров"
+msgid "Item groups"
+msgstr ""
+
msgid "Item Groups"
msgstr "Группы товаров"
@@ -4163,12 +4185,21 @@ msgstr "ID товара"
msgid "Item Master"
msgstr "Мастер элемента"
+msgid "Item must match a selected type AND a selected group"
+msgstr ""
+
+msgid "Item must match a selected type OR a selected group"
+msgstr ""
+
msgid "Item Scope"
msgstr "Область применения товара"
msgid "Item Type"
msgstr "Тип товара"
+msgid "Item types"
+msgstr ""
+
msgid "items"
msgstr "элементы"
@@ -4585,9 +4616,15 @@ msgstr "Совпадение"
msgid "Match all"
msgstr "Совпадают все"
+msgid "Match all (AND)"
+msgstr ""
+
msgid "Match any"
msgstr "Совпадает с любым"
+msgid "Match any (OR)"
+msgstr ""
+
msgid "Match none"
msgstr "Не совпадает ни одно"
@@ -5519,6 +5556,9 @@ msgstr "Дополнительный контекст для этого прав
msgid "Options"
msgstr "Параметры"
+msgid "OR"
+msgstr ""
+
msgid "Order"
msgstr "Заказ"
diff --git a/packages/locale/locales/zh/erp.po b/packages/locale/locales/zh/erp.po
index 4c26701c8f..5bd030218a 100644
--- a/packages/locale/locales/zh/erp.po
+++ b/packages/locale/locales/zh/erp.po
@@ -15,6 +15,10 @@ msgstr ""
msgid " A supplier is a business or person who sells you parts or services."
msgstr "供应商是向您销售零件或服务的企业或个人。"
+#. placeholder {0}: fieldDef?.label ?? condition.field
+msgid "\"{0}\" isn't available on the selected surface(s). Pick another field."
+msgstr ""
+
msgid "\"{storageUnitName}\" has {childCount} direct nested storage units. Deleting it will also delete them and anything underneath them. This cannot be undone."
msgstr "\"{storageUnitName}\"有{childCount}个直接嵌套的存储单元。删除它也会删除它们及其下面的所有内容。此操作无法撤销。"
@@ -464,6 +468,9 @@ msgstr "金额类型"
msgid "An item cannot be added to itself."
msgstr "一个项目不能添加到自身。"
+msgid "AND"
+msgstr ""
+
msgid "and {remaining} more"
msgstr "和 {remaining} 个更多"
@@ -482,6 +489,12 @@ msgstr "注释文本是必需的"
msgid "Annotation updated"
msgstr "注释已更新"
+msgid "Any item group"
+msgstr ""
+
+msgid "Any item type"
+msgstr ""
+
msgid "API and Webhooks"
msgstr "API 和 Webhooks"
@@ -506,9 +519,6 @@ msgstr "适用于"
msgid "Applies to all"
msgstr "适用于全部"
-msgid "Applies to all items"
-msgstr "适用于所有项目"
-
msgid "Applies to all storage units"
msgstr "适用于所有存储单位"
@@ -1392,6 +1402,9 @@ msgstr "列的可见性和顺序"
msgid "Columns"
msgstr "列"
+msgid "Combine filters"
+msgstr ""
+
msgid "Coming soon"
msgstr "即将推出"
@@ -2978,6 +2991,9 @@ msgstr "员工类型"
msgid "Employees"
msgstr "员工"
+msgid "Empty = match every item"
+msgstr ""
+
msgid "Empty work centers"
msgstr "空的工作中心"
@@ -4151,9 +4167,15 @@ msgstr "物品"
msgid "Item {scannedItem} is not the same as the item {expectedItem}"
msgstr "项目 {scannedItem} 与项目 {expectedItem} 不相同"
+msgid "Item filters"
+msgstr ""
+
msgid "Item Group"
msgstr "物品组"
+msgid "Item groups"
+msgstr ""
+
msgid "Item Groups"
msgstr "物品组"
@@ -4163,12 +4185,21 @@ msgstr "物品ID"
msgid "Item Master"
msgstr "物料主数据"
+msgid "Item must match a selected type AND a selected group"
+msgstr ""
+
+msgid "Item must match a selected type OR a selected group"
+msgstr ""
+
msgid "Item Scope"
msgstr "物品范围"
msgid "Item Type"
msgstr "物品类型"
+msgid "Item types"
+msgstr ""
+
msgid "items"
msgstr "项目"
@@ -4585,9 +4616,15 @@ msgstr "匹配"
msgid "Match all"
msgstr "全部匹配"
+msgid "Match all (AND)"
+msgstr ""
+
msgid "Match any"
msgstr "匹配任意"
+msgid "Match any (OR)"
+msgstr ""
+
msgid "Match none"
msgstr "不匹配任何条件"
@@ -5519,6 +5556,9 @@ msgstr "此规则的可选上下文"
msgid "Options"
msgstr "选项"
+msgid "OR"
+msgstr ""
+
msgid "Order"
msgstr "订单"
diff --git a/packages/react/src/ChoiceSelect.tsx b/packages/react/src/ChoiceSelect.tsx
index e835f130b6..5cb36e3b51 100644
--- a/packages/react/src/ChoiceSelect.tsx
+++ b/packages/react/src/ChoiceSelect.tsx
@@ -134,9 +134,19 @@ function ChoiceSelectSingle<V extends string>({
disabled={opt.disabled}
className="py-2 pr-8"
>
- <span className="flex items-start gap-3">
+ <span
+ className={cn(
+ "flex gap-3",
+ opt.description ? "items-start" : "items-center"
+ )}
+ >
{opt.icon && (
- <span className="flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground mt-0.5">
+ <span
+ className={cn(
+ "flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground",
+ opt.description && "mt-0.5"
+ )}
+ >
{opt.icon}
</span>
)}
@@ -237,13 +247,19 @@ function ChoiceSelectMulti<V extends string>({
disabled={opt.disabled}
onClick={() => toggle(opt.value)}
className={cn(
- "flex w-full items-start gap-3 rounded-md px-2 py-2 text-left",
+ "flex w-full gap-3 rounded-md px-2 py-2 text-left",
+ opt.description ? "items-start" : "items-center",
"hover:bg-accent focus-visible:bg-accent focus-visible:outline-none",
opt.disabled && "cursor-not-allowed opacity-50"
)}
>
{opt.icon && (
- <span className="flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground mt-0.5">
+ <span
+ className={cn(
+ "flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground",
+ opt.description && "mt-0.5"
+ )}
+ >
{opt.icon}
</span>
)}
@@ -258,7 +274,10 @@ function ChoiceSelectMulti<V extends string>({
<Checkbox
isChecked={isSelected}
disabled={opt.disabled}
- className="mt-1 shrink-0 pointer-events-none"
+ className={cn(
+ "shrink-0 pointer-events-none",
+ opt.description && "mt-1"
+ )}
tabIndex={-1}
/>
<LuCheck className="hidden" aria-hidden />
diff --git a/packages/utils/src/customRules.test.ts b/packages/utils/src/customRules.test.ts
index 87bb3ca32c..aca62cf00c 100644
--- a/packages/utils/src/customRules.test.ts
+++ b/packages/utils/src/customRules.test.ts
@@ -6,11 +6,19 @@ import {
compileRule,
compileWithCache,
evaluateRules,
- getFieldDef,
- getFieldsForTargetType,
+ getFieldsForTargetTypeAndSurfaces,
interpolateMessage,
- type RuleContext
+ isFieldAvailableOnSurfaces,
+ itemRuleAppliesToItem,
+ type RuleContext,
+ SURFACE_CONTEXT_AVAILABILITY,
+ TRANSACTION_SURFACES
} from "./customRules";
+import {
+ FIELD_REGISTRY,
+ getFieldDef,
+ getFieldsForTargetType
+} from "./field-registry";
const ruleOf = (
conditions: Array<{ field: string; op: string; value?: unknown }>,
@@ -553,3 +561,128 @@ describe("required-field pre-check", () => {
expect(violations).toEqual([]);
});
});
+
+describe("per-surface field availability", () => {
+ it("every surface has an availability entry", () => {
+ for (const s of TRANSACTION_SURFACES) {
+ expect(SURFACE_CONTEXT_AVAILABILITY[s]?.length ?? 0).toBeGreaterThan(0);
+ }
+ });
+
+ it("isFieldAvailableOnSurfaces defers to targetType when no surfaces given", () => {
+ const itemTypeDef = getFieldDef("item.type")!;
+ expect(isFieldAvailableOnSurfaces(itemTypeDef, [])).toBe(true);
+ });
+
+ it("storage fields are not offered on operation (workCenter) surfaces", () => {
+ const wcFields = getFieldsForTargetTypeAndSurfaces("workCenter", [
+ "operationStart"
+ ]);
+ expect(wcFields.some((f) => f.context === "storage")).toBe(false);
+ // transaction.quantity (shared) stays available everywhere.
+ expect(wcFields.some((f) => f.path === "transaction.quantity")).toBe(true);
+ });
+
+ it("item-surface fields stay offered for item rules", () => {
+ const itemFields = getFieldsForTargetTypeAndSurfaces("item", ["receipt"]);
+ expect(itemFields.some((f) => f.path === "item.type")).toBe(true);
+ expect(itemFields.some((f) => f.context === "storage")).toBe(true);
+ });
+
+ it("narrowed set is a subset of the targetType set", () => {
+ const all = getFieldsForTargetType("item");
+ const narrowed = getFieldsForTargetTypeAndSurfaces("item", ["receipt"]);
+ expect(narrowed.length).toBeLessThanOrEqual(all.length);
+ for (const f of narrowed) {
+ expect(all).toContain(f);
+ }
+ });
+
+ it("every registry field is offered on at least one surface of its targetType", () => {
+ for (const f of FIELD_REGISTRY) {
+ const someSurface = TRANSACTION_SURFACES.some((s) =>
+ SURFACE_CONTEXT_AVAILABILITY[s].includes(f.context)
+ );
+ expect(someSurface, `field "${f.path}" offered on no surface`).toBe(true);
+ }
+ });
+});
+
+describe("itemRuleAppliesToItem", () => {
+ const part = { type: "Part", itemPostingGroupId: "grp_a" };
+
+ it("empty filters → applies to all items", () => {
+ expect(itemRuleAppliesToItem(part, {})).toBe(true);
+ expect(
+ itemRuleAppliesToItem(part, {
+ filteredItemTypes: [],
+ filteredItemGroupIds: []
+ })
+ ).toBe(true);
+ });
+
+ it("single dimension (type) — OR and AND behave the same", () => {
+ expect(
+ itemRuleAppliesToItem(part, { filteredItemTypes: ["Part", "Material"] })
+ ).toBe(true);
+ expect(
+ itemRuleAppliesToItem(part, { filteredItemTypes: ["Material"] })
+ ).toBe(false);
+ expect(
+ itemRuleAppliesToItem(part, {
+ filteredItemTypes: ["Material"],
+ filteredItemMatchAll: true
+ })
+ ).toBe(false);
+ });
+
+ it("single dimension (group)", () => {
+ expect(
+ itemRuleAppliesToItem(part, { filteredItemGroupIds: ["grp_a"] })
+ ).toBe(true);
+ expect(
+ itemRuleAppliesToItem(part, { filteredItemGroupIds: ["grp_b"] })
+ ).toBe(false);
+ });
+
+ it("OR (default) — either dimension matches", () => {
+ expect(
+ itemRuleAppliesToItem(part, {
+ filteredItemTypes: ["Material"],
+ filteredItemGroupIds: ["grp_a"]
+ })
+ ).toBe(true);
+ expect(
+ itemRuleAppliesToItem(part, {
+ filteredItemTypes: ["Material"],
+ filteredItemGroupIds: ["grp_b"]
+ })
+ ).toBe(false);
+ });
+
+ it("AND — both dimensions must match", () => {
+ expect(
+ itemRuleAppliesToItem(part, {
+ filteredItemTypes: ["Part"],
+ filteredItemGroupIds: ["grp_a"],
+ filteredItemMatchAll: true
+ })
+ ).toBe(true);
+ expect(
+ itemRuleAppliesToItem(part, {
+ filteredItemTypes: ["Part"],
+ filteredItemGroupIds: ["grp_b"],
+ filteredItemMatchAll: true
+ })
+ ).toBe(false);
+ });
+
+ it("null/absent posting group never matches a group filter", () => {
+ expect(
+ itemRuleAppliesToItem(
+ { type: "Part", itemPostingGroupId: null },
+ { filteredItemGroupIds: ["grp_a"] }
+ )
+ ).toBe(false);
+ });
+});
diff --git a/packages/utils/src/customRules.ts b/packages/utils/src/customRules.ts
index e0faa66c7b..b595bbd338 100644
--- a/packages/utils/src/customRules.ts
+++ b/packages/utils/src/customRules.ts
@@ -4,8 +4,14 @@
// issue/receive) to enforce per-entity validation/guideline rules.
//
// Each rule binds to a single `TargetType` (`item`, `storageUnit`, or
-// `workCenter`). The field registry is partitioned by `targetType` so the
-// builder UI only surfaces fields valid for the chosen target.
+// `workCenter`). The field registry lives in `./field-registry`.
+
+import {
+ type FieldContext,
+ type FieldDef,
+ getFieldDef,
+ getFieldsForTargetType
+} from "./field-registry";
export type Operator =
| "eq"
@@ -160,7 +166,7 @@ const ROOT_KEYS = new Set([
"transaction"
]);
-const buildResolver = (path: string): Resolver => {
+export const buildResolver = (path: string): Resolver => {
const segments = path.split(".");
if (segments.length < 2 || !ROOT_KEYS.has(segments[0]!)) {
return () => undefined;
@@ -476,336 +482,119 @@ export const evaluateRules = (
};
// ---------------------------------------------------------------------------
-// Field resolver registry — single source of truth for builder UI + evaluator
+// Item-target rule filtering — which items a broadcast item rule fires on
// ---------------------------------------------------------------------------
+//
+// Item rules no longer use the blunt `appliesToAll` broadcast. Instead they
+// carry optional type/group filters; empty filters = every item. `server.ts`
+// gates each item broadcast through this before adding the rule to a line.
+
+export type ItemRuleFilter = {
+ filteredItemTypes?: string[];
+ filteredItemGroupIds?: string[];
+ /** false → OR across the two dimensions (any); true → AND (all). */
+ filteredItemMatchAll?: boolean;
+};
-import type { Database } from "@carbon/database";
-
-type Tables = Database["public"]["Tables"];
+/**
+ * Minimal item shape the filter matcher reads. The index signature keeps it
+ * structurally compatible with the looser item-context records the evaluator
+ * and loaders build (no cast needed at call sites).
+ */
+export type ItemCtx = Record<string, unknown> & {
+ type?: unknown;
+ itemPostingGroupId?: unknown;
+};
-type IsNullable<T> = null extends T ? true : false;
+export const itemRuleAppliesToItem = (
+ item: ItemCtx,
+ f: ItemRuleFilter
+): boolean => {
+ const types = f.filteredItemTypes ?? [];
+ const groups = f.filteredItemGroupIds ?? [];
+ if (types.length === 0 && groups.length === 0) return true; // empty = all
+ // `null` = dimension not constrained; it drops out of the combination so a
+ // single set dimension behaves identically under OR and AND.
+ const typeMatch = types.length ? types.includes(item.type as string) : null;
+ const groupMatch = groups.length
+ ? item.itemPostingGroupId != null &&
+ groups.includes(item.itemPostingGroupId as string)
+ : null;
+ return f.filteredItemMatchAll
+ ? (typeMatch ?? true) && (groupMatch ?? true)
+ : (typeMatch ?? false) || (groupMatch ?? false);
+};
-type ExpectedNullable<
- T extends keyof Tables,
- C extends keyof Tables[T]["Row"]
-> = IsNullable<Tables[T]["Row"][C]>;
+/** Normalize a raw `customRule` row's nullable filter columns into a filter. */
+export const toItemRuleFilter = (row: {
+ filteredItemTypes?: string[] | null;
+ filteredItemGroupIds?: string[] | null;
+ filteredItemMatchAll?: boolean | null;
+}): ItemRuleFilter => ({
+ filteredItemTypes: row.filteredItemTypes ?? [],
+ filteredItemGroupIds: row.filteredItemGroupIds ?? [],
+ filteredItemMatchAll: row.filteredItemMatchAll ?? false
+});
-export type FieldType =
- | "string"
- | "number"
- | "enum"
- | "id"
- /**
- * Special-cased id picker: the rule builder renders a hierarchical
- * (location → drill-down) storage-unit selector instead of a flat combobox.
- * Values stored as the chosen storage unit's UUID.
- */
- | "storageUnit";
-
-export type ValueOptionsLoader =
- | "locations"
- | "storageTypes"
- | "itemTypes"
- | "replenishmentSystems"
- | "itemTrackingTypes"
- | "itemPostingGroups";
-
-export type FieldContext =
- | "item"
- | "storage"
- | "workCenter"
- | "operation"
- | "transaction";
-
-export type FieldDef = {
- path: string;
- label: string;
- type: FieldType;
- operators: Operator[];
- context: FieldContext;
- /**
- * Which rule `targetType`(s) may reference this field.
- * - `"shared"` → visible to every targetType (e.g. `transaction.*`)
- * - `TargetType` → visible only to that one targetType
- * - `readonly TargetType[]` → visible to each targetType in the list (e.g.
- * `["item", "storageUnit"]` for storage-unit fields that make sense on
- * both item-target and storageUnit-target rules)
- */
- targetType: TargetType | "shared" | readonly TargetType[];
- valueOptionsLoader?: ValueOptionsLoader;
- /**
- * `true` (default) — column is nullable; `isSet`/`isNotSet` are valid.
- * `false` — column is NOT NULL at the DB level; presence ops are
- * stripped from the available operator list.
- */
- nullable?: boolean;
- /**
- * Human-readable note on where this field's value originates. Surfaced in
- * the rule-builder UI under the field selector so authors understand what
- * they're testing against. Synthetic fields receive their `derivedFrom`
- * string here automatically.
- */
- description?: string;
-};
-
-const PRESENCE_OPS = new Set<Operator>(["isSet", "isNotSet"]);
-
-const SCALAR_OPS: Operator[] = ["eq", "neq", "isSet", "isNotSet"];
-const ENUM_OPS: Operator[] = ["eq", "neq", "in", "notIn", "isSet", "isNotSet"];
-const ID_OPS: Operator[] = ["eq", "neq", "in", "notIn", "isSet", "isNotSet"];
-const NUMBER_OPS: Operator[] = ["eq", "neq", "gt", "lt", "isSet", "isNotSet"];
-const BOOL_OPS: Operator[] = ["eq", "neq"];
-
-export const availableOperators = (def: FieldDef): Operator[] =>
- def.nullable === false
- ? def.operators.filter((op) => !PRESENCE_OPS.has(op))
- : def.operators;
-
-export const isOperatorAllowed = (def: FieldDef, op: Operator): boolean =>
- availableOperators(def).includes(op);
-
-const fields = {
- database: <
- T extends keyof Tables,
- C extends Extract<keyof Tables[T]["Row"], string>,
- N extends ExpectedNullable<T, C>
- >(args: {
- table: T;
- column: C;
- nullable: N;
- label: string;
- type: FieldType;
- operators: Operator[];
- context: FieldContext;
- targetType: FieldDef["targetType"];
- ctxKey?: string;
- valueOptionsLoader?: ValueOptionsLoader;
- description?: string;
- }): FieldDef => ({
- path: `${args.ctxKey ?? args.table}.${args.column}`,
- label: args.label,
- type: args.type,
- operators: args.operators,
- context: args.context,
- targetType: args.targetType,
- valueOptionsLoader: args.valueOptionsLoader,
- nullable: args.nullable,
- description: args.description
- }),
-
- synthetic: (args: {
- path: string;
- derivedFrom: string;
- nullable: boolean;
- label: string;
- type: FieldType;
- operators: Operator[];
- context: FieldContext;
- targetType: FieldDef["targetType"];
- valueOptionsLoader?: ValueOptionsLoader;
- }): FieldDef => ({
- path: args.path,
- label: args.label,
- type: args.type,
- operators: args.operators,
- context: args.context,
- targetType: args.targetType,
- valueOptionsLoader: args.valueOptionsLoader,
- nullable: args.nullable,
- description: args.derivedFrom
- })
-};
-
-// FIELD_REGISTRY holds ONLY fields the evaluator guarantees in ctx for every
-// surface within a given targetType. Fields that may be null or are only
-// populated for a subset of surfaces are intentionally excluded — rule
-// authors should never write a predicate that silently no-ops on some surface.
+// ---------------------------------------------------------------------------
+// Per-surface context availability — single source of truth for "which field
+// may a rule reference given the surfaces it subscribes to"
+// ---------------------------------------------------------------------------
//
-// Cross-target fields (e.g. storageUnit.* visible to both item + storageUnit
-// rules) use the array form of `targetType`. For item-target surfaces the
-// storageUnit ctx may be undefined when `line.storageUnitId` is null
-// (inventoryAdjustment without a bin, warehouseTransfer with no destination
-// yet); we mark such fields `nullable: true` so `availableOperators` exposes
-// `isSet`/`isNotSet` and authors can guard explicitly.
+// Declares which root `FieldContext`s the evaluator STRUCTURALLY builds in
+// `RuleContext` for each surface. "Structurally" = the evaluator constructs that
+// root context for the surface at all; whether a given line's value is null is a
+// separate, allowed concern handled by `isSet`/`isNotSet` (see `nullable`). This
+// turns the prose in `STORAGE_UNIT_NOTES` / "Not populated" into enforced data so
+// the builder/validator can never offer or accept a field that won't resolve.
//
-// Dropped vs. earlier drafts (kept here as audit trail):
-// - shelf.locationId → `shelf` is not a RuleContext root key
-// - transaction.locationId → sometimes null per surface
-// - operation.itemId → null at operationStart (no item bound yet)
-// - operation.workInstructionId → may be null on operations
+// Note `"storage"` is the `FieldContext` value; it maps to the `storageUnit`
+// RuleContext root key.
//
-// Re-added: `item.itemPostingGroupId` — the evaluator now embeds the 1:1
-// `itemCost` row and flattens its `itemPostingGroupId` onto the item ctx, so
-// the value is guaranteed for every item-target surface (all carry an itemId).
-export const FIELD_REGISTRY: FieldDef[] = [
- // ── Item context (item + storageUnit targets) ─────────────────────────────
- // All storageUnit-target surfaces (place, pick, stockTransfer,
- // warehouseTransfer) carry a `line.itemId`, so the evaluator loads item
- // ctx and these fields resolve. Item DB columns are NOT NULL so no
- // nullable change.
- fields.database({
- table: "item",
- column: "type",
- nullable: false,
- label: "Item type",
- type: "enum",
- operators: ENUM_OPS,
- context: "item",
- targetType: ["item", "storageUnit"],
- valueOptionsLoader: "itemTypes"
- }),
- fields.database({
- table: "item",
- column: "replenishmentSystem",
- nullable: false,
- label: "Replenishment system",
- type: "enum",
- operators: ENUM_OPS,
- context: "item",
- targetType: ["item", "storageUnit"],
- valueOptionsLoader: "replenishmentSystems"
- }),
- fields.database({
- table: "item",
- column: "itemTrackingType",
- nullable: false,
- label: "Item tracking type",
- type: "enum",
- operators: ENUM_OPS,
- context: "item",
- targetType: ["item", "storageUnit"],
- valueOptionsLoader: "itemTrackingTypes"
- }),
- // Posting group lives on the 1:1 `itemCost` row, not `item`. The evaluator
- // embeds it (see server.ts item SELECT) and flattens it onto the item ctx.
- // Nullable because an item may have no posting group assigned.
- fields.synthetic({
- path: "item.itemPostingGroupId",
- derivedFrom: "The item's posting group (from its itemCost row).",
- nullable: true,
- label: "Item posting group",
- type: "id",
- operators: ID_OPS,
- context: "item",
- targetType: ["item", "storageUnit"],
- valueOptionsLoader: "itemPostingGroups"
- }),
-
- // ── StorageUnit context (item + storageUnit targets) ──────────────────────
- // Always loaded by the evaluator for storageUnit-target rules; loaded when
- // `line.storageUnitId` is set for item-target rules. `nullable: true` on
- // every entry so item rules can guard with `isSet`/`isNotSet`.
- fields.synthetic({
- path: "storageUnit.id",
- derivedFrom: "The bin chosen on this transaction line.",
- nullable: true,
- label: "Storage unit",
- // `"storageUnit"` triggers the hierarchical drill-down picker in the
- // rule-builder UI (Location → drilldown). No flat loader needed.
- type: "storageUnit",
- // Drill picker selects a single bin — `in`/`notIn` would require a
- // multi-select UI that doesn't exist. Restrict to scalar ops.
- operators: SCALAR_OPS,
- context: "storage",
- targetType: ["item", "storageUnit"]
- }),
- fields.synthetic({
- path: "storageUnit.storageTypeId",
- derivedFrom: "The bin's primary storage type (e.g. cold, hazmat, dry).",
- nullable: true,
- label: "Storage type",
- type: "id",
- operators: ID_OPS,
- context: "storage",
- targetType: ["item", "storageUnit"],
- valueOptionsLoader: "storageTypes"
- }),
- // Useful for `appliesToAll` rules that want to scope by physical location —
- // e.g. "block pick from any unit in the quarantine warehouse". Declared as
- // synthetic (not database) so `nullable: true` overrides the DB NOT NULL —
- // ctx itself can be undefined for item-target rules when `line.storageUnitId`
- // is null.
- fields.synthetic({
- path: "storageUnit.locationId",
- derivedFrom:
- "Physical location (warehouse or site) holding the chosen bin.",
- nullable: true,
- label: "Storage unit location",
- type: "id",
- operators: ID_OPS,
- context: "storage",
- targetType: ["item", "storageUnit"],
- valueOptionsLoader: "locations"
- }),
-
- // ── WorkCenter target ─────────────────────────────────────────────────────
- // workCenter is the target — always loaded by the evaluator.
- fields.database({
- table: "workCenter",
- column: "locationId",
- nullable: true,
- label: "Work center location",
- type: "id",
- operators: ID_OPS,
- context: "workCenter",
- targetType: "workCenter",
- valueOptionsLoader: "locations"
- }),
- fields.database({
- table: "workCenter",
- column: "active",
- nullable: false,
- label: "Work center active",
- type: "enum",
- operators: BOOL_OPS,
- context: "workCenter",
- targetType: "workCenter"
- }),
-
- // ── Transaction (shared across all targets) ───────────────────────────────
- // transaction.quantity is set by every trigger handler. No other transaction
- // field is guaranteed across all surfaces.
- fields.synthetic({
- path: "transaction.quantity",
- derivedFrom:
- "Quantity moved or applied by this transaction. Meaning shifts per surface — see per-surface notes below.",
- nullable: false,
- label: "Transaction quantity",
- type: "number",
- operators: NUMBER_OPS,
- context: "transaction",
- targetType: "shared"
- })
-];
+// Locked by the anti-drift test in `packages/ee/src/customRules/server.test.ts`,
+// which asserts the ctx `evaluateLinesForSurface` builds for each surface
+// populates exactly these contexts.
+export const SURFACE_CONTEXT_AVAILABILITY: Record<
+ TransactionSurface,
+ readonly FieldContext[]
+> = {
+ receipt: ["item", "storage", "transaction"],
+ shipment: ["item", "storage", "transaction"],
+ stockTransfer: ["item", "storage", "transaction"],
+ warehouseTransfer: ["item", "storage", "transaction"],
+ inventoryAdjustment: ["item", "storage", "transaction"],
+ place: ["item", "storage", "transaction"],
+ pick: ["item", "storage", "transaction"],
+ operationStart: ["workCenter", "operation", "transaction"],
+ operationFinish: ["workCenter", "operation", "transaction"],
+ materialIssue: ["workCenter", "operation", "transaction"],
+ materialReceive: ["workCenter", "operation", "transaction"]
+};
/**
- * Subset of the registry visible to a rule of a given `targetType`. Includes
- * all fields explicitly declared for that target plus the `shared` set, plus
- * any field whose `targetType` is an array containing the requested target.
- * Builder UI filters its field dropdown through this helper.
+ * A field resolves for a rule iff its context is structurally available on
+ * EVERY surface the rule subscribes to. Empty surfaces → defer to targetType
+ * only (caller hasn't picked surfaces yet).
*/
-export const getFieldsForTargetType = (targetType: TargetType): FieldDef[] =>
- FIELD_REGISTRY.filter((f) => {
- if (f.targetType === "shared") return true;
- if (Array.isArray(f.targetType)) return f.targetType.includes(targetType);
- return f.targetType === targetType;
- });
+export const isFieldAvailableOnSurfaces = (
+ def: FieldDef,
+ surfaces: readonly TransactionSurface[]
+): boolean =>
+ surfaces.length === 0 ||
+ surfaces.every((s) => SURFACE_CONTEXT_AVAILABILITY[s]?.includes(def.context));
-export const getFieldDef = (path: string): FieldDef | undefined => {
- // Custom fields are dynamic — accept any item.customFields.* path.
- if (path.startsWith("item.customFields.")) {
- return {
- path,
- label: path.slice("item.customFields.".length),
- type: "string",
- operators: SCALAR_OPS,
- context: "item",
- targetType: "item",
- description: "Custom field on the item record."
- };
- }
- return FIELD_REGISTRY.find((f) => f.path === path);
-};
+/**
+ * Registry subset a rule of the given `targetType` may reference when it
+ * subscribes to `surfaces`. Narrows `getFieldsForTargetType` by per-surface
+ * context availability. Builder field picker filters through this.
+ */
+export const getFieldsForTargetTypeAndSurfaces = (
+ targetType: TargetType,
+ surfaces: readonly TransactionSurface[]
+): FieldDef[] =>
+ getFieldsForTargetType(targetType).filter((f) =>
+ isFieldAvailableOnSurfaces(f, surfaces)
+ );
// ---------------------------------------------------------------------------
// Per-surface field semantics
diff --git a/packages/utils/src/field-registry.ts b/packages/utils/src/field-registry.ts
new file mode 100644
index 0000000000..95d16cc460
--- /dev/null
+++ b/packages/utils/src/field-registry.ts
@@ -0,0 +1,333 @@
+// Field resolver registry — single source of truth for the rule-builder UI and
+// the evaluator's field paths. Split out of `customRules.ts` to keep that file
+// focused on evaluation/compilation. Depends on `customRules` only for the core
+// `Operator` / `TargetType` types (type-only — no runtime cycle).
+
+import type { Database } from "@carbon/database";
+import type { Operator, TargetType } from "./customRules";
+
+type Tables = Database["public"]["Tables"];
+
+type IsNullable<T> = null extends T ? true : false;
+
+type ExpectedNullable<
+ T extends keyof Tables,
+ C extends keyof Tables[T]["Row"]
+> = IsNullable<Tables[T]["Row"][C]>;
+
+export type FieldType =
+ | "string"
+ | "number"
+ | "enum"
+ | "id"
+ /**
+ * Special-cased id picker: the rule builder renders a hierarchical
+ * (location → drill-down) storage-unit selector instead of a flat combobox.
+ * Values stored as the chosen storage unit's UUID.
+ */
+ | "storageUnit";
+
+export type ValueOptionsLoader =
+ | "locations"
+ | "storageTypes"
+ | "itemTypes"
+ | "replenishmentSystems"
+ | "itemTrackingTypes"
+ | "itemPostingGroups";
+
+export type FieldContext =
+ | "item"
+ | "storage"
+ | "workCenter"
+ | "operation"
+ | "transaction";
+
+export type FieldDef = {
+ path: string;
+ label: string;
+ type: FieldType;
+ operators: Operator[];
+ context: FieldContext;
+ /**
+ * Which rule `targetType`(s) may reference this field.
+ * - `"shared"` → visible to every targetType (e.g. `transaction.*`)
+ * - `TargetType` → visible only to that one targetType
+ * - `readonly TargetType[]` → visible to each targetType in the list (e.g.
+ * `["item", "storageUnit"]` for storage-unit fields that make sense on
+ * both item-target and storageUnit-target rules)
+ */
+ targetType: TargetType | "shared" | readonly TargetType[];
+ valueOptionsLoader?: ValueOptionsLoader;
+ /**
+ * `true` (default) — column is nullable; `isSet`/`isNotSet` are valid.
+ * `false` — column is NOT NULL at the DB level; presence ops are
+ * stripped from the available operator list.
+ */
+ nullable?: boolean;
+ /**
+ * Human-readable note on where this field's value originates. Surfaced in
+ * the rule-builder UI under the field selector so authors understand what
+ * they're testing against. Synthetic fields receive their `derivedFrom`
+ * string here automatically.
+ */
+ description?: string;
+};
+
+const PRESENCE_OPS = new Set<Operator>(["isSet", "isNotSet"]);
+
+const SCALAR_OPS: Operator[] = ["eq", "neq", "isSet", "isNotSet"];
+const ENUM_OPS: Operator[] = ["eq", "neq", "in", "notIn", "isSet", "isNotSet"];
+const ID_OPS: Operator[] = ["eq", "neq", "in", "notIn", "isSet", "isNotSet"];
+const NUMBER_OPS: Operator[] = ["eq", "neq", "gt", "lt", "isSet", "isNotSet"];
+const BOOL_OPS: Operator[] = ["eq", "neq"];
+
+export const availableOperators = (def: FieldDef): Operator[] =>
+ def.nullable === false
+ ? def.operators.filter((op) => !PRESENCE_OPS.has(op))
+ : def.operators;
+
+export const isOperatorAllowed = (def: FieldDef, op: Operator): boolean =>
+ availableOperators(def).includes(op);
+
+const fields = {
+ database: <
+ T extends keyof Tables,
+ C extends Extract<keyof Tables[T]["Row"], string>,
+ N extends ExpectedNullable<T, C>
+ >(args: {
+ table: T;
+ column: C;
+ nullable: N;
+ label: string;
+ type: FieldType;
+ operators: Operator[];
+ context: FieldContext;
+ targetType: FieldDef["targetType"];
+ ctxKey?: string;
+ valueOptionsLoader?: ValueOptionsLoader;
+ description?: string;
+ }): FieldDef => ({
+ path: `${args.ctxKey ?? args.table}.${args.column}`,
+ label: args.label,
+ type: args.type,
+ operators: args.operators,
+ context: args.context,
+ targetType: args.targetType,
+ valueOptionsLoader: args.valueOptionsLoader,
+ nullable: args.nullable,
+ description: args.description
+ }),
+
+ synthetic: (args: {
+ path: string;
+ derivedFrom: string;
+ nullable: boolean;
+ label: string;
+ type: FieldType;
+ operators: Operator[];
+ context: FieldContext;
+ targetType: FieldDef["targetType"];
+ valueOptionsLoader?: ValueOptionsLoader;
+ }): FieldDef => ({
+ path: args.path,
+ label: args.label,
+ type: args.type,
+ operators: args.operators,
+ context: args.context,
+ targetType: args.targetType,
+ valueOptionsLoader: args.valueOptionsLoader,
+ nullable: args.nullable,
+ description: args.derivedFrom
+ })
+};
+
+// FIELD_REGISTRY holds ONLY fields the evaluator guarantees in ctx for every
+// surface within a given targetType. Fields that may be null or are only
+// populated for a subset of surfaces are intentionally excluded — rule
+// authors should never write a predicate that silently no-ops on some surface.
+//
+// Cross-target fields (e.g. storageUnit.* visible to both item + storageUnit
+// rules) use the array form of `targetType`. For item-target surfaces the
+// storageUnit ctx may be undefined when `line.storageUnitId` is null
+// (inventoryAdjustment without a bin, warehouseTransfer with no destination
+// yet); we mark such fields `nullable: true` so `availableOperators` exposes
+// `isSet`/`isNotSet` and authors can guard explicitly.
+//
+// Dropped vs. earlier drafts (kept here as audit trail):
+// - shelf.locationId → `shelf` is not a RuleContext root key
+// - transaction.locationId → sometimes null per surface
+// - operation.itemId → null at operationStart (no item bound yet)
+// - operation.workInstructionId → may be null on operations
+//
+// Re-added: `item.itemPostingGroupId` — the evaluator now embeds the 1:1
+// `itemCost` row and flattens its `itemPostingGroupId` onto the item ctx, so
+// the value is guaranteed for every item-target surface (all carry an itemId).
+export const FIELD_REGISTRY: FieldDef[] = [
+ // ── Item context (item + storageUnit targets) ─────────────────────────────
+ // All storageUnit-target surfaces (place, pick, stockTransfer,
+ // warehouseTransfer) carry a `line.itemId`, so the evaluator loads item
+ // ctx and these fields resolve. Item DB columns are NOT NULL so no
+ // nullable change.
+ fields.database({
+ table: "item",
+ column: "type",
+ nullable: false,
+ label: "Item type",
+ type: "enum",
+ operators: ENUM_OPS,
+ context: "item",
+ targetType: ["item", "storageUnit"],
+ valueOptionsLoader: "itemTypes"
+ }),
+ fields.database({
+ table: "item",
+ column: "replenishmentSystem",
+ nullable: false,
+ label: "Replenishment system",
+ type: "enum",
+ operators: ENUM_OPS,
+ context: "item",
+ targetType: ["item", "storageUnit"],
+ valueOptionsLoader: "replenishmentSystems"
+ }),
+ fields.database({
+ table: "item",
+ column: "itemTrackingType",
+ nullable: false,
+ label: "Item tracking type",
+ type: "enum",
+ operators: ENUM_OPS,
+ context: "item",
+ targetType: ["item", "storageUnit"],
+ valueOptionsLoader: "itemTrackingTypes"
+ }),
+ // Posting group lives on the 1:1 `itemCost` row, not `item`. The evaluator
+ // embeds it (see server.ts item SELECT) and flattens it onto the item ctx.
+ // Nullable because an item may have no posting group assigned.
+ fields.synthetic({
+ path: "item.itemPostingGroupId",
+ derivedFrom: "The item's posting group (from its itemCost row).",
+ nullable: true,
+ label: "Item group",
+ type: "id",
+ operators: ID_OPS,
+ context: "item",
+ targetType: ["item", "storageUnit"],
+ valueOptionsLoader: "itemPostingGroups"
+ }),
+
+ // ── StorageUnit context (item + storageUnit targets) ──────────────────────
+ // Always loaded by the evaluator for storageUnit-target rules; loaded when
+ // `line.storageUnitId` is set for item-target rules. `nullable: true` on
+ // every entry so item rules can guard with `isSet`/`isNotSet`.
+ fields.synthetic({
+ path: "storageUnit.id",
+ derivedFrom: "The bin chosen on this transaction line.",
+ nullable: true,
+ label: "Storage unit",
+ // `"storageUnit"` triggers the hierarchical drill-down picker in the
+ // rule-builder UI (Location → drilldown). No flat loader needed.
+ type: "storageUnit",
+ // Drill picker selects a single bin — `in`/`notIn` would require a
+ // multi-select UI that doesn't exist. Restrict to scalar ops.
+ operators: SCALAR_OPS,
+ context: "storage",
+ targetType: ["item", "storageUnit"]
+ }),
+ fields.synthetic({
+ path: "storageUnit.storageTypeId",
+ derivedFrom: "The bin's primary storage type (e.g. cold, hazmat, dry).",
+ nullable: true,
+ label: "Storage type",
+ type: "id",
+ operators: ID_OPS,
+ context: "storage",
+ targetType: ["item", "storageUnit"],
+ valueOptionsLoader: "storageTypes"
+ }),
+ // Useful for `appliesToAll` rules that want to scope by physical location —
+ // e.g. "block pick from any unit in the quarantine warehouse". Declared as
+ // synthetic (not database) so `nullable: true` overrides the DB NOT NULL —
+ // ctx itself can be undefined for item-target rules when `line.storageUnitId`
+ // is null.
+ fields.synthetic({
+ path: "storageUnit.locationId",
+ derivedFrom:
+ "Physical location (warehouse or site) holding the chosen bin.",
+ nullable: true,
+ label: "Storage unit location",
+ type: "id",
+ operators: ID_OPS,
+ context: "storage",
+ targetType: ["item", "storageUnit"],
+ valueOptionsLoader: "locations"
+ }),
+
+ // ── WorkCenter target ─────────────────────────────────────────────────────
+ // workCenter is the target — always loaded by the evaluator.
+ fields.database({
+ table: "workCenter",
+ column: "locationId",
+ nullable: true,
+ label: "Work center location",
+ type: "id",
+ operators: ID_OPS,
+ context: "workCenter",
+ targetType: "workCenter",
+ valueOptionsLoader: "locations"
+ }),
+ fields.database({
+ table: "workCenter",
+ column: "active",
+ nullable: false,
+ label: "Work center active",
+ type: "enum",
+ operators: BOOL_OPS,
+ context: "workCenter",
+ targetType: "workCenter"
+ }),
+
+ // ── Transaction (shared across all targets) ───────────────────────────────
+ // transaction.quantity is set by every trigger handler. No other transaction
+ // field is guaranteed across all surfaces.
+ fields.synthetic({
+ path: "transaction.quantity",
+ derivedFrom:
+ "Quantity moved or applied by this transaction. Meaning shifts per surface — see per-surface notes below.",
+ nullable: false,
+ label: "Transaction quantity",
+ type: "number",
+ operators: NUMBER_OPS,
+ context: "transaction",
+ targetType: "shared"
+ })
+];
+
+/**
+ * Subset of the registry visible to a rule of a given `targetType`. Includes
+ * all fields explicitly declared for that target plus the `shared` set, plus
+ * any field whose `targetType` is an array containing the requested target.
+ * Builder UI filters its field dropdown through this helper.
+ */
+export const getFieldsForTargetType = (targetType: TargetType): FieldDef[] =>
+ FIELD_REGISTRY.filter((f) => {
+ if (f.targetType === "shared") return true;
+ if (Array.isArray(f.targetType)) return f.targetType.includes(targetType);
+ return f.targetType === targetType;
+ });
+
+export const getFieldDef = (path: string): FieldDef | undefined => {
+ // Custom fields are dynamic — accept any item.customFields.* path.
+ if (path.startsWith("item.customFields.")) {
+ return {
+ path,
+ label: path.slice("item.customFields.".length),
+ type: "string",
+ operators: SCALAR_OPS,
+ context: "item",
+ targetType: "item",
+ description: "Custom field on the item record."
+ };
+ }
+ return FIELD_REGISTRY.find((f) => f.path === path);
+};
diff --git a/packages/utils/src/index.ts b/packages/utils/src/index.ts
index febf7b440a..8de5a6a312 100644
--- a/packages/utils/src/index.ts
+++ b/packages/utils/src/index.ts
@@ -9,6 +9,7 @@ export * from "./country";
export * from "./customRules";
export * from "./date";
export * from "./duration";
+export * from "./field-registry";
export * from "./file";
export * from "./geo";
export * from "./items";