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.

feat: print labels

Brad Barbin7192364b3bf9
diff --git a/apps/erp/app/components/SplitButton.tsx b/apps/erp/app/components/SplitButton.tsx
new file mode 100644
index 0000000000..68a8f0d8db
--- /dev/null
+++ b/apps/erp/app/components/SplitButton.tsx
@@ -0,0 +1,81 @@
+import {
+ Button,
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuIcon,
+ DropdownMenuItem,
+ DropdownMenuTrigger,
+} from "@carbon/react";
+import { LuChevronDown } from "react-icons/lu";
+import { forwardRef } from "react";
+
+interface SplitButtonProps {
+ children: React.ReactNode;
+ onClick?: () => void;
+ leftIcon?: React.ReactElement;
+ variant?: "primary" | "secondary" | "ghost" | "destructive";
+ size?: "sm" | "md" | "lg";
+ disabled?: boolean;
+ className?: string;
+ dropdownItems: {
+ label: string;
+ onClick: () => void;
+ icon?: React.ReactElement;
+ }[];
+}
+
+const SplitButton = forwardRef<HTMLButtonElement, SplitButtonProps>(
+ (
+ {
+ children,
+ onClick,
+ leftIcon,
+ variant = "primary",
+ size,
+ disabled,
+ className,
+ dropdownItems,
+ },
+ ref
+ ) => {
+ return (
+ <div className="flex">
+ <Button
+ ref={ref}
+ onClick={onClick}
+ leftIcon={leftIcon}
+ variant={variant}
+ size={size}
+ disabled={disabled}
+ className={`rounded-r-none before:rounded-r-none ${className || ""}`}
+ >
+ {children}
+ </Button>
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild>
+ <Button
+ variant={variant}
+ size={size}
+ disabled={disabled}
+ className="rounded-l-none border-l px-1 before:rounded-l-none border shadow-none hover:shadow-button-base"
+ >
+ <LuChevronDown />
+ </Button>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent>
+ {dropdownItems.map((item, index) => (
+ <DropdownMenuItem key={index} onClick={item.onClick}>
+ {item.icon && <DropdownMenuIcon icon={item.icon} />}
+ {item.label}
+ </DropdownMenuItem>
+ ))}
+ </DropdownMenuContent>
+ </DropdownMenu>
+ </div>
+ );
+ }
+);
+
+SplitButton.displayName = "SplitButton";
+
+export { SplitButton };
diff --git a/apps/erp/app/modules/inventory/inventory.service.ts b/apps/erp/app/modules/inventory/inventory.service.ts
index efcb5e2c9a..3ac55d8223 100644
--- a/apps/erp/app/modules/inventory/inventory.service.ts
+++ b/apps/erp/app/modules/inventory/inventory.service.ts
@@ -188,27 +188,28 @@ export async function getReceiptLines(
return client.from("receiptLine").select("*").eq("receiptId", receiptId);
}
-export async function getReceiptLineTracking(
+export async function getReceiptTracking(
client: SupabaseClient<Database>,
- receiptLineIds: string[]
+ receiptId: string,
+ companyId: string
) {
- const trackedEntities = await client
+ return client
.from("trackedEntity")
- .select("*, trackedEntityAttribute(*)")
- .eq("trackedEntityAttribute.name", "Receipt Line")
- .in("trackedEntityAttribute.textValue", receiptLineIds);
-
- if (trackedEntities.error) {
- return trackedEntities;
- }
+ .select("*")
+ .eq("attributes ->> Receipt", receiptId)
+ .eq("companyId", companyId);
+}
+export async function getReceiptLineTracking(
+ client: SupabaseClient<Database>,
+ receiptLineId: string,
+ companyId: string
+) {
return client
.from("trackedEntity")
- .select("*, trackedEntityAttribute(*)")
- .in(
- "id",
- trackedEntities.data.map((t) => t.id)
- );
+ .select("*")
+ .eq("attributes ->> Receipt Line", receiptLineId)
+ .eq("companyId", companyId);
}
export async function getReceiptFiles(
diff --git a/apps/erp/app/modules/inventory/types.ts b/apps/erp/app/modules/inventory/types.ts
index bae92914a4..83412a68fe 100644
--- a/apps/erp/app/modules/inventory/types.ts
+++ b/apps/erp/app/modules/inventory/types.ts
@@ -1,12 +1,10 @@
import type { Database } from "@carbon/database";
import type {
- getBatch,
- getBatches,
getBatchProperties,
getInventoryItems,
getItemLedgerPage,
getReceiptLines,
- getReceiptLineTracking,
+ getReceiptTracking,
getReceipts,
getShipments,
getShipmentLines,
@@ -14,17 +12,10 @@ import type {
getShipmentLineTracking,
} from "./inventory.service";
-export type BatchDetails = NonNullable<
- Awaited<ReturnType<typeof getBatch>>["data"]
->;
export type BatchProperty = NonNullable<
Awaited<ReturnType<typeof getBatchProperties>>["data"]
>[number];
-export type BatchTableRow = NonNullable<
- Awaited<ReturnType<typeof getBatches>>["data"]
->[number];
-
export type InventoryItem = NonNullable<
Awaited<ReturnType<typeof getInventoryItems>>["data"]
>[number];
@@ -34,7 +25,7 @@ export type ItemLedger = NonNullable<
>[number];
export type ItemTracking = NonNullable<
- Awaited<ReturnType<typeof getReceiptLineTracking>>["data"]
+ Awaited<ReturnType<typeof getReceiptTracking>>["data"]
>[number];
export type Receipt = NonNullable<
diff --git a/apps/erp/app/modules/inventory/ui/Receipts/ReceiptHeader.tsx b/apps/erp/app/modules/inventory/ui/Receipts/ReceiptHeader.tsx
index f349df1276..504c11ae85 100644
--- a/apps/erp/app/modules/inventory/ui/Receipts/ReceiptHeader.tsx
+++ b/apps/erp/app/modules/inventory/ui/Receipts/ReceiptHeader.tsx
@@ -5,17 +5,20 @@ import {
IconButton,
useDisclosure,
} from "@carbon/react";
+import { labelSizes } from "@carbon/utils";
import { Link, useParams } from "@remix-run/react";
import {
LuCheckCheck,
LuCreditCard,
LuPanelLeft,
LuPanelRight,
+ LuQrCode,
LuShoppingCart,
} from "react-icons/lu";
import { usePanels } from "~/components/Layout";
+import { SplitButton } from "~/components/SplitButton";
import { usePermissions, useRouteData } from "~/hooks";
-import type { Receipt, ReceiptLine } from "~/modules/inventory";
+import type { ItemTracking, Receipt, ReceiptLine } from "~/modules/inventory";
import { ReceiptPostModal, ReceiptStatus } from "~/modules/inventory";
import { path } from "~/utils/path";
@@ -28,6 +31,7 @@ const ReceiptHeader = () => {
const routeData = useRouteData<{
receipt: Receipt;
receiptLines: ReceiptLine[];
+ receiptLineTracking: ItemTracking[];
}>(path.to.receipt(receiptId));
if (!routeData?.receipt) throw new Error("Failed to load receipt");
@@ -41,6 +45,23 @@ const ReceiptHeader = () => {
const isPosted = routeData.receipt.status === "Posted";
+ const navigateToTrackingLabels = (zpl?: boolean, labelSize?: string) => {
+ if (!window) return;
+ if (zpl) {
+ window.open(
+ window.location.origin +
+ path.to.file.receiptLabelsZpl(receiptId, labelSize),
+ "_blank"
+ );
+ } else {
+ window.open(
+ window.location.origin +
+ path.to.file.receiptLabelsPdf(receiptId, labelSize),
+ "_blank"
+ );
+ }
+ };
+
return (
<>
<div className="flex flex-shrink-0 items-center justify-between p-2 bg-card border-b border-border h-[50px] overflow-x-auto scrollbar-hide dark:border-none dark:shadow-[inset_0_0_1px_rgb(255_255_255_/_0.24),_0_0_0_0.5px_rgb(0,0,0,1),0px_0px_4px_rgba(0,_0,_0,_0.08)]">
@@ -60,6 +81,20 @@ const ReceiptHeader = () => {
<ReceiptStatus status={routeData?.receipt?.status} />
</HStack>
<HStack>
+ {routeData.receiptLineTracking.length > 0 && (
+ <SplitButton
+ leftIcon={<LuQrCode />}
+ dropdownItems={labelSizes.map((size) => ({
+ label: size.name,
+ onClick: () => navigateToTrackingLabels(!!size.zpl, size.id),
+ }))}
+ // TODO: if we knew the preferred label size, we could use that here
+ onClick={() => navigateToTrackingLabels(false)}
+ variant="secondary"
+ >
+ Tracking Labels
+ </SplitButton>
+ )}
<SourceDocumentLink
sourceDocument={routeData.receipt.sourceDocument ?? undefined}
sourceDocumentId={routeData.receipt.sourceDocumentId ?? undefined}
diff --git a/apps/erp/app/modules/inventory/ui/Receipts/ReceiptLines.tsx b/apps/erp/app/modules/inventory/ui/Receipts/ReceiptLines.tsx
index 83553e55f4..0a053388cf 100644
--- a/apps/erp/app/modules/inventory/ui/Receipts/ReceiptLines.tsx
+++ b/apps/erp/app/modules/inventory/ui/Receipts/ReceiptLines.tsx
@@ -41,9 +41,9 @@ import {
import type { PostgrestResponse } from "@supabase/supabase-js";
import { Suspense, useCallback, useEffect, useState } from "react";
import {
- LuBarcode,
LuCircleAlert,
LuGroup,
+ LuQrCode,
LuSplit,
LuX,
} from "react-icons/lu";
@@ -63,6 +63,7 @@ import {
type ReceiptLine,
} from "~/modules/inventory";
import { getDocumentType } from "~/modules/shared/shared.service";
+import { TrackedEntityAttributes } from "~/modules/shared/types";
import type { action as receiptLinesUpdateAction } from "~/routes/x+/receipt+/lines.update";
import { useItems } from "~/stores";
import type { StorageItem } from "~/types";
@@ -70,6 +71,8 @@ import { path } from "~/utils/path";
import { stripSpecialCharacters } from "~/utils/string";
import BatchPropertiesConfig from "../Batches/BatchPropertiesConfig";
import { BatchPropertiesFields } from "../Batches/BatchPropertiesFields";
+import { labelSizes } from "@carbon/utils";
+import { SplitButton } from "~/components/SplitButton";
const ReceiptLines = () => {
const { receiptId } = useParams();
@@ -104,29 +107,30 @@ const ReceiptLines = () => {
return receiptLines.reduce((acc, line) => {
if (!line.requiresSerialTracking) return acc;
- const trackedEntities = routeData?.receiptLineTracking.filter(
- (t) =>
- t.trackedEntityAttribute.find((a) => a.name === "Receipt Line")
- ?.textValue === line.id
+ const trackedEntitiesForLine = routeData?.receiptLineTracking.filter(
+ (t) => {
+ const attributes = t.attributes as TrackedEntityAttributes;
+ return attributes["Receipt Line"] === line.id;
+ }
);
- if (!trackedEntities) return acc;
+ if (!trackedEntitiesForLine) return acc;
return {
...acc,
[line.id]: Array.from({ length: line.receivedQuantity }, (_, index) => {
- const serialNumber = trackedEntities
- .find(
- (t) =>
- t.trackedEntityAttribute.find((a) => a.name === "Index")
- ?.numericValue === index
- )
- ?.trackedEntityAttribute.find(
- (a) => a.name === "Serial Number"
- )?.textValue;
+ const serialNumberEntity = trackedEntitiesForLine.find((t) => {
+ const attributes = t.attributes as TrackedEntityAttributes;
+ return attributes["Index"] === index;
+ });
+
+ const attributes = serialNumberEntity?.attributes as
+ | TrackedEntityAttributes
+ | undefined;
+ const serialNumber = attributes?.["Serial Number"] || "";
return {
index,
- number: serialNumber ?? "",
+ number: serialNumber,
};
}),
};
@@ -138,31 +142,32 @@ const ReceiptLines = () => {
receiptLines.reduce((acc, line) => {
if (!line.requiresSerialTracking) return acc;
- const trackedEntities = routeData?.receiptLineTracking.filter(
- (t) =>
- t.trackedEntityAttribute.find((a) => a.name === "Receipt Line")
- ?.textValue === line.id
+ const trackedEntitiesForLine = routeData?.receiptLineTracking.filter(
+ (t) => {
+ const attributes = t.attributes as TrackedEntityAttributes;
+ return attributes["Receipt Line"] === line.id;
+ }
);
- if (!trackedEntities) return acc;
+ if (!trackedEntitiesForLine) return acc;
return {
...acc,
[line.id]: Array.from(
{ length: line.receivedQuantity },
(_, index) => {
- const serialNumber = trackedEntities
- .find(
- (t) =>
- t.trackedEntityAttribute.find((a) => a.name === "Index")
- ?.numericValue === index
- )
- ?.trackedEntityAttribute.find(
- (a) => a.name === "Serial Number"
- )?.textValue;
+ const serialNumberEntity = trackedEntitiesForLine.find((t) => {
+ const attributes = t.attributes as TrackedEntityAttributes;
+ return attributes["Index"] === index;
+ });
+
+ const attributes = serialNumberEntity?.attributes as
+ | TrackedEntityAttributes
+ | undefined;
+ const serialNumber = attributes?.["Serial Number"] || "";
return {
index,
- number: serialNumber ?? "",
+ number: serialNumber,
};
}
),
@@ -170,7 +175,7 @@ const ReceiptLines = () => {
}, {})
);
// eslint-disable-next-line react-hooks/exhaustive-deps
- }, [routeData?.receipt?.sourceDocumentId]);
+ }, [routeData?.receipt?.sourceDocumentId, routeData?.receiptLines?.length]);
const onUpdateReceiptLine = useCallback(
async ({
@@ -219,18 +224,10 @@ const ReceiptLines = () => {
<Empty className="py-6" />
) : (
receiptLines.map((line, index) => {
- const tracking = routeData?.receiptLineTracking?.find(
- (t) =>
- t.sourceDocumentId === receiptId &&
- t.trackedEntityAttribute.find(
- (a: { name: string; textValue: string | null }) =>
- a.name === "Receipt Line"
- )?.textValue === line.id &&
- t.trackedEntityAttribute.find(
- (a: { name: string; textValue: string | null }) =>
- a.name === "Batch Number"
- )?.textValue !== null
- );
+ const tracking = routeData?.receiptLineTracking?.find((t) => {
+ const attributes = t.attributes as TrackedEntityAttributes;
+ return attributes["Receipt Line"] === line.id;
+ });
return (
<ReceiptLineItem
key={line.id}
@@ -532,47 +529,40 @@ function BatchForm({
manufacturingDate?: CalendarDate;
expirationDate?: CalendarDate;
properties: any;
- }>(
- tracking
- ? {
- number:
- tracking.trackedEntityAttribute.find(
- (a) => a.name === "Batch Number"
- )?.textValue ?? "",
- properties: Object.fromEntries(
- tracking.trackedEntityAttribute
- .filter(
- (attr) => !["Batch Number", "Receipt Line"].includes(attr.name)
- )
- .map((attr) => [attr.name, attr.textValue ?? ""])
- ),
- }
- : {
- number: "",
- properties: {},
- }
- );
+ }>(() => {
+ if (tracking) {
+ const attributes = tracking.attributes as TrackedEntityAttributes;
+ return {
+ number: attributes["Batch Number"] || "",
+ properties: Object.entries(attributes)
+ .filter(([key]) => !["Batch Number", "Receipt Line"].includes(key))
+ .reduce((acc, [key, value]) => ({ ...acc, [key]: value || "" }), {}),
+ };
+ }
+ return {
+ number: "",
+ properties: {},
+ };
+ });
const updateBatchNumber = async (newValues: typeof values, isNew = false) => {
if (!receipt?.id || !newValues.number.trim()) return;
- const batchMatch = isNew
- ? tracking?.trackedEntityAttribute.find((a) => a.name === "Batch Number")
- ?.textValue
- : null;
+ let batchMatch = null;
+ if (isNew && tracking) {
+ const attributes = tracking.attributes as TrackedEntityAttributes;
+ batchMatch = attributes["Batch Number"];
+ }
let valuesToSubmit = newValues;
if (batchMatch) {
+ const attributes = tracking?.attributes as TrackedEntityAttributes;
valuesToSubmit = {
...newValues,
- properties: Object.fromEntries(
- tracking?.trackedEntityAttribute
- .filter(
- (attr) => !["Batch Number", "Receipt Line"].includes(attr.name)
- )
- .map((attr) => [attr.name, attr.textValue ?? ""]) ?? []
- ),
+ properties: Object.entries(attributes)
+ .filter(([key]) => !["Batch Number", "Receipt Line"].includes(key))
+ .reduce((acc, [key, value]) => ({ ...acc, [key]: value || "" }), {}),
};
// Just update the local state without triggering another database write
@@ -604,19 +594,48 @@ function BatchForm({
updateBatchNumber(newValues);
};
+ const navigateToLineTrackingLabels = (zpl?: boolean, labelSize?: string) => {
+ if (!window) return;
+ if (zpl) {
+ window.open(
+ window.location.origin +
+ path.to.file.receiptLineLabelsZpl(line.id, labelSize),
+ "_blank"
+ );
+ } else {
+ window.open(
+ window.location.origin +
+ path.to.file.receiptLineLabelsPdf(line.id, labelSize),
+ "_blank"
+ );
+ }
+ };
const propertiesDisclosure = useDisclosure();
-
return (
<div className="flex flex-col gap-6 w-full p-6 border rounded-lg">
<div className="flex justify-between items-center gap-4">
<Heading size="h4">Batch Properties</Heading>
- <Button
- variant="secondary"
- size="sm"
- onClick={propertiesDisclosure.onOpen}
- >
- Edit Properties
- </Button>
+ <div className="flex items-center gap-2">
+ <SplitButton
+ size="sm"
+ leftIcon={<LuQrCode />}
+ dropdownItems={labelSizes.map((size) => ({
+ label: size.name,
+ onClick: () => navigateToLineTrackingLabels(!!size.zpl, size.id),
+ }))}
+ onClick={() => navigateToLineTrackingLabels(false)}
+ variant="secondary"
+ >
+ Tracking Labels
+ </SplitButton>
+ <Button
+ variant="secondary"
+ size="sm"
+ onClick={propertiesDisclosure.onOpen}
+ >
+ Edit Properties
+ </Button>
+ </div>
</div>
<div className="grid grid-cols-1 lg:grid-cols-3 gap-4 ">
<div className="flex flex-col gap-2 w-full">
@@ -684,12 +703,14 @@ function BatchForm({
function SerialForm({
line,
receipt,
+ batchProperties,
serialNumbers,
isReadOnly,
onSerialNumbersChange,
}: {
line: ReceiptLine;
receipt?: Receipt;
+ batchProperties?: PostgrestResponse<BatchProperty>;
serialNumbers: { index: number; number: string }[];
isReadOnly: boolean;
onSerialNumbersChange: (
@@ -765,11 +786,42 @@ function SerialForm({
[line.id, line.itemId, receipt?.id, validateSerialNumber]
);
+ const navigateToLineTrackingLabels = (zpl?: boolean, labelSize?: string) => {
+ if (!window) return;
+ if (zpl) {
+ window.open(
+ window.location.origin +
+ path.to.file.receiptLineLabelsZpl(line.id, labelSize),
+ "_blank"
+ );
+ } else {
+ window.open(
+ window.location.origin +
+ path.to.file.receiptLineLabelsPdf(line.id, labelSize),
+ "_blank"
+ );
+ }
+ };
+ const propertiesDisclosure = useDisclosure();
return (
- <div className="flex flex-col gap-2 p-6 border rounded-lg">
- <label className="text-xs text-muted-foreground flex items-center gap-2">
- <LuBarcode /> Serial Numbers
- </label>
+ <div className="flex flex-col gap-6 p-6 border rounded-lg">
+ <div className="flex justify-between items-center gap-6">
+ <Heading size="h4">Serial Numbers</Heading>
+ <div className="flex items-center gap-2">
+ <SplitButton
+ size="sm"
+ leftIcon={<LuQrCode />}
+ dropdownItems={labelSizes.map((size) => ({
+ label: size.name,
+ onClick: () => navigateToLineTrackingLabels(!!size.zpl, size.id),
+ }))}
+ onClick={() => navigateToLineTrackingLabels(false)}
+ variant="secondary"
+ >
+ Tracking Labels
+ </SplitButton>
+ </div>
+ </div>
<div className="grid grid-cols-1 lg:grid-cols-3 gap-x-4 gap-y-3">
{serialNumbers.map((serialNumber, index) => (
@@ -828,6 +880,22 @@ function SerialForm({
)}
</div>
))}
+ {propertiesDisclosure.isOpen && (
+ <Suspense fallback={null}>
+ <Await resolve={batchProperties}>
+ {(resolvedBatchProperties) => {
+ return (
+ <BatchPropertiesConfig
+ itemId={line.itemId}
+ properties={resolvedBatchProperties?.data ?? []}
+ type="modal"
+ onClose={propertiesDisclosure.onClose}
+ />
+ );
+ }}
+ </Await>
+ </Suspense>
+ )}
</div>
</div>
);
diff --git a/apps/erp/app/modules/inventory/ui/Receipts/ReceiptPostModal.tsx b/apps/erp/app/modules/inventory/ui/Receipts/ReceiptPostModal.tsx
index a7b7ab0529..0383c18793 100644
--- a/apps/erp/app/modules/inventory/ui/Receipts/ReceiptPostModal.tsx
+++ b/apps/erp/app/modules/inventory/ui/Receipts/ReceiptPostModal.tsx
@@ -16,17 +16,26 @@ import {
toast,
useMount,
} from "@carbon/react";
+import { useRouteData } from "@carbon/remix";
import { useFetcher, useNavigation, useParams } from "@remix-run/react";
import { useState } from "react";
import { LuTriangleAlert } from "react-icons/lu";
import { path } from "~/utils/path";
+import { ReceiptLine } from "../../types";
+import { getReceiptTracking } from "../../inventory.service";
+import { TrackedEntityAttributes } from "~/modules/shared";
+import { useUser } from "~/hooks";
const ReceiptPostModal = ({ onClose }: { onClose: () => void }) => {
const { receiptId } = useParams();
if (!receiptId) throw new Error("receiptId not found");
+ const routeData = useRouteData<{
+ receiptLines: ReceiptLine[];
+ }>(path.to.receipt(receiptId));
+
const navigation = useNavigation();
- const { carbon } = useCarbon();
+
const [validated, setValidated] = useState(false);
const [validationErrors, setValidationErrors] = useState<
{
@@ -36,61 +45,74 @@ const ReceiptPostModal = ({ onClose }: { onClose: () => void }) => {
}[]
>([]);
- const getReceiptLines = async () => {
- if (!carbon) {
- toast.error("Carbon client not found");
- return;
- }
- const [receiptLines, receiptLineTracking] = await Promise.all([
- carbon
- .from("receiptLine")
- .select(
- "id, itemReadableId, receivedQuantity, requiresBatchTracking, requiresSerialTracking"
- )
- .eq("receiptId", receiptId),
- carbon
- .from("itemTracking")
- .select("*, serialNumber(number), batchNumber(number)")
- .eq("sourceDocument", "Receipt")
- .eq("sourceDocumentId", receiptId),
- ]);
-
- if (receiptLines.error || receiptLineTracking.error) {
- toast.error("Error fetching receipt lines or tracking data");
- return;
- }
+ const { carbon } = useCarbon();
+ const {
+ company: { id: companyId },
+ } = useUser();
+ const validateReceiptTracking = async () => {
const errors: {
itemReadableId: string | null;
receivedQuantity: number;
receivedQuantityError: string;
}[] = [];
- const receiptLinesWithTracking = receiptLines.data.map((line) => ({
- ...line,
- receiptLineTracking: receiptLineTracking.data.filter(
- (tracking) => tracking.sourceDocumentLineId === line.id
- ),
- }));
-
- receiptLinesWithTracking.forEach((line) => {
- if (
- line.requiresBatchTracking &&
- (line.receiptLineTracking.length === 0 ||
- !line.receiptLineTracking[0].batchNumber)
- ) {
- errors.push({
- itemReadableId: line.itemReadableId,
- receivedQuantity: line.receivedQuantity,
- receivedQuantityError: "Batch number is required",
+ if (!carbon) {
+ toast.error("Carbon client is not available");
+ return;
+ }
+
+ const receiptLineTracking = await getReceiptTracking(
+ carbon,
+ receiptId,
+ companyId
+ );
+
+ if (
+ routeData?.receiptLines.length === 0 ||
+ routeData?.receiptLines.every((line) => line.receivedQuantity === 0)
+ ) {
+ setValidationErrors([
+ {
+ itemReadableId: null,
+ receivedQuantity: 0,
+ receivedQuantityError: "Receipt is empty",
+ },
+ ]);
+ }
+
+ routeData?.receiptLines.forEach((line: ReceiptLine) => {
+ if (line.requiresBatchTracking) {
+ const trackedEntity = receiptLineTracking.data?.find((tracking) => {
+ const attributes = tracking.attributes as TrackedEntityAttributes;
+ return attributes["Receipt Line"] === line.id;
});
+
+ const attributes = trackedEntity?.attributes as
+ | TrackedEntityAttributes
+ | undefined;
+ if (!attributes?.["Batch Number"]) {
+ errors.push({
+ itemReadableId: line.itemReadableId,
+ receivedQuantity: line.receivedQuantity,
+ receivedQuantityError: "Batch number is required",
+ });
+ }
}
if (line.requiresSerialTracking) {
- const quantityWithSerial = line.receiptLineTracking.reduce(
- (acc, tracking) => acc + tracking.quantity,
- 0
- );
+ const trackedEntities = receiptLineTracking.data?.filter((tracking) => {
+ const attributes = tracking.attributes as TrackedEntityAttributes;
+ return attributes["Receipt Line"] === line.id;
+ });
+
+ const quantityWithSerial = trackedEntities?.reduce((acc, tracking) => {
+ const attributes = tracking.attributes as TrackedEntityAttributes;
+ const serialNumber = attributes["Serial Number"];
+
+ return acc + (serialNumber ? 1 : 0);
+ }, 0);
+
if (quantityWithSerial !== line.receivedQuantity) {
errors.push({
itemReadableId: line.itemReadableId,
@@ -106,7 +128,7 @@ const ReceiptPostModal = ({ onClose }: { onClose: () => void }) => {
};
useMount(() => {
- getReceiptLines();
+ validateReceiptTracking();
});
const fetcher = useFetcher<{}>();
diff --git a/apps/erp/app/modules/settings/settings.models.ts b/apps/erp/app/modules/settings/settings.models.ts
index 7e16977023..c5ab4ca4d6 100644
--- a/apps/erp/app/modules/settings/settings.models.ts
+++ b/apps/erp/app/modules/settings/settings.models.ts
@@ -1,3 +1,4 @@
+import { labelSizes } from "@carbon/utils";
import { z } from "zod";
import { zfd } from "zod-form-data";
import { DataType } from "~/modules/shared";
@@ -66,6 +67,7 @@ export const customFieldValidator = z
return true;
});
+
export const digitalQuoteValidator = z.object({
digitalQuoteEnabled: zfd.checkbox(),
@@ -75,6 +77,12 @@ export const digitalQuoteValidator = z.object({
digitalQuoteIncludesPurchaseOrders: zfd.checkbox(),
});
+export const productLabelSizeValidator = z.object({
+ productLabelSize: z.enum(labelSizes.map((size) => size.id) as [string, ...string[]], {
+ message: "Product label size is required",
+ }),
+});
+
export const rfqReadyValidator = z.object({
rfqReadyNotificationGroup: z
.array(z.string().min(36, { message: "Invalid selection" }))
diff --git a/apps/erp/app/modules/settings/settings.service.ts b/apps/erp/app/modules/settings/settings.service.ts
index 84dc7d9e25..10903185f2 100644
--- a/apps/erp/app/modules/settings/settings.service.ts
+++ b/apps/erp/app/modules/settings/settings.service.ts
@@ -495,6 +495,14 @@ export async function updateLogoLightIcon(
.eq("id", companyId);
}
+export async function updateProductLabelSize(
+ client: SupabaseClient<Database>,
+ companyId: string,
+ productLabelSize: string
+) {
+ return client.from("companySettings").update(sanitize({ productLabelSize })).eq("id", companyId);
+}
+
export async function updateRfqReadySetting(
client: SupabaseClient<Database>,
companyId: string,
diff --git a/apps/erp/app/modules/settings/ui/useSettingsSubmodules.tsx b/apps/erp/app/modules/settings/ui/useSettingsSubmodules.tsx
index f2d8eaee51..91dc98685b 100644
--- a/apps/erp/app/modules/settings/ui/useSettingsSubmodules.tsx
+++ b/apps/erp/app/modules/settings/ui/useSettingsSubmodules.tsx
@@ -1,4 +1,5 @@
import {
+ LuBarcode,
LuCrown,
LuFactory,
LuImage,
@@ -22,6 +23,12 @@ const settingsRoutes: AuthenticatedRouteGroup[] = [
role: "employee",
icon: <LuFactory />,
},
+ {
+ name: "Labels",
+ to: path.to.labelsSettings,
+ role: "employee",
+ icon: <LuBarcode />,
+ },
{
name: "Logos",
to: path.to.logos,
diff --git a/apps/erp/app/modules/shared/types.ts b/apps/erp/app/modules/shared/types.ts
index 04846d3ee4..2e4b2d6976 100644
--- a/apps/erp/app/modules/shared/types.ts
+++ b/apps/erp/app/modules/shared/types.ts
@@ -89,3 +89,12 @@ export type SavedView = {
};
export type StandardFactor = (typeof standardFactorType)[number];
+
+export interface TrackedEntityAttributes {
+ [key: string]: any;
+ "Receipt Line"?: string;
+ "Batch Number"?: string;
+ "Serial Number"?: string;
+ Receipt?: string;
+ Index?: number;
+}
diff --git a/apps/erp/app/routes/file+/receipt+/$id.labels[.]pdf.tsx b/apps/erp/app/routes/file+/receipt+/$id.labels[.]pdf.tsx
new file mode 100644
index 0000000000..8dac946c28
--- /dev/null
+++ b/apps/erp/app/routes/file+/receipt+/$id.labels[.]pdf.tsx
@@ -0,0 +1,82 @@
+import { requirePermissions } from "@carbon/auth/auth.server";
+import { ProductLabelPDF } from "@carbon/documents/pdf";
+import { labelSizes } from "@carbon/utils";
+import { renderToStream } from "@react-pdf/renderer";
+import { redirect, type LoaderFunctionArgs } from "@vercel/remix";
+import { getReceiptTracking } from "~/modules/inventory";
+import { getCompanySettings } from "~/modules/settings/settings.service";
+import { TrackedEntityAttributes } from "~/modules/shared";
+import { path } from "~/utils/path";
+
+export const config = { runtime: "nodejs" };
+
+export async function loader({ request, params }: LoaderFunctionArgs) {
+ const { client, companyId } = await requirePermissions(request, {
+ view: "inventory",
+ });
+
+ const { id } = params;
+ if (!id) throw new Error("Could not find id");
+
+ const [companySettings, receiptLineTracking] = await Promise.all([
+ getCompanySettings(client, companyId),
+ getReceiptTracking(client, id, companyId),
+ ]);
+
+ // Get the label size from query params or default to avery5160
+ const url = new URL(request.url);
+ const labelParam = url.searchParams.get("labelSize");
+ const labelSizeId =
+ labelParam || companySettings.data?.productLabelSize || "avery5160";
+
+ // Find the label size configuration
+ let labelSize = labelSizes.find((size) => size.id === labelSizeId);
+
+ if (!labelSize) {
+ throw new Error("Invalid label size");
+ }
+
+ if (labelSize.zpl) {
+ throw redirect(path.to.file.receiptLabelsZpl(id, labelParam ?? undefined));
+ }
+
+ const items = receiptLineTracking.data?.map((tracking) => ({
+ itemId: tracking.sourceDocumentReadableId ?? "",
+ revision: "0",
+ number:
+ (tracking.attributes as TrackedEntityAttributes)?.["Serial Number"] ??
+ (tracking.attributes as TrackedEntityAttributes)?.["Batch Number"] ??
+ "",
+ trackedEntityId: tracking.id,
+ quantity: tracking.quantity,
+ trackingType: tracking.quantity > 1 ? "Batch" : "Serial",
+ }))
+ .sort((a, b) => {
+ if (a.itemId === b.itemId) {
+ return a.number.localeCompare(b.number);
+ }
+ return a.itemId.localeCompare(b.itemId);
+ });
+
+ if (!Array.isArray(items) || items.length === 0) {
+ return new Response(`No items found for receipt ${id}`, { status: 404 });
+ }
+
+ const stream = await renderToStream(
+ <ProductLabelPDF items={items ?? []} labelSize={labelSize} />
+ );
+
+ const body: Buffer = await new Promise((resolve, reject) => {
+ const buffers: Uint8Array[] = [];
+ stream.on("data", (data) => {
+ buffers.push(data);
+ });
+ stream.on("end", () => {
+ resolve(Buffer.concat(buffers));
+ });
+ stream.on("error", reject);
+ });
+
+ const headers = new Headers({ "Content-Type": "application/pdf" });
+ return new Response(body, { status: 200, headers });
+}
diff --git a/apps/erp/app/routes/file+/receipt+/$id.labels[.]zpl.tsx b/apps/erp/app/routes/file+/receipt+/$id.labels[.]zpl.tsx
new file mode 100644
index 0000000000..7cfa74d23c
--- /dev/null
+++ b/apps/erp/app/routes/file+/receipt+/$id.labels[.]zpl.tsx
@@ -0,0 +1,160 @@
+import { requirePermissions } from "@carbon/auth/auth.server";
+import { LabelSize, labelSizes } from "@carbon/utils";
+import { redirect, type LoaderFunctionArgs } from "@vercel/remix";
+import { getReceiptTracking } from "~/modules/inventory/inventory.service";
+import { getCompanySettings } from "~/modules/settings/settings.service";
+import { TrackedEntityAttributes } from "~/modules/shared/types";
+import { path } from "~/utils/path";
+
+export const config = { runtime: "nodejs" };
+
+export async function loader({ request, params }: LoaderFunctionArgs) {
+ const { client, companyId } = await requirePermissions(request, {
+ view: "inventory",
+ });
+
+ const { id } = params;
+ if (!id) throw new Error("Could not find id");
+
+ const [companySettings, receiptLineTracking] = await Promise.all([
+ getCompanySettings(client, companyId),
+ getReceiptTracking(client, id, companyId),
+ ]);
+
+ // Get the label size from query params or default to zebra2x1
+ const url = new URL(request.url);
+ const labelParam = url.searchParams.get("labelSize");
+ const labelSizeId =
+ labelParam || companySettings.data?.productLabelSize || "zebra2x1";
+
+ // Find the label size configuration
+ let labelSize = labelSizes.find((size) => size.id === labelSizeId);
+
+ if (!labelSize) {
+ throw new Error("Invalid label size");
+ }
+
+ if (!labelSize.zpl) {
+ throw redirect(path.to.file.receiptLabelsPdf(id, labelParam ?? undefined));
+ }
+
+ const items = receiptLineTracking.data?.map((tracking) => ({
+ itemId: tracking.sourceDocumentReadableId ?? "",
+ revision: "0",
+ number:
+ (tracking.attributes as TrackedEntityAttributes)?.["Serial Number"] ??
+ (tracking.attributes as TrackedEntityAttributes)?.["Batch Number"] ??
+ "",
+ trackedEntityId: tracking.id,
+ quantity: tracking.quantity,
+ trackingType: tracking.quantity > 1 ? "Batch" : "Serial",
+ })).sort((a, b) => {
+ if (a.itemId === b.itemId) {
+ return a.number.localeCompare(b.number);
+ }
+ return a.itemId.localeCompare(b.itemId);
+ });
+
+ if (!Array.isArray(items) || items.length === 0) {
+ return new Response(`No items found for receipt ${id}`, { status: 404 });
+ }
+
+ if (!labelSize?.zpl) {
+ throw new Error("Invalid label size or missing ZPL configuration");
+ }
+
+ // Generate ZPL for each item
+ const zplCommands = items.map((item) => generateZPLLabel(item, labelSize));
+ const zplOutput = zplCommands.join("\n");
+
+ const headers = new Headers({
+ "Content-Type": "application/zpl",
+ "Content-Disposition": `attachment; filename="labels-${id}.zpl"`,
+ });
+
+ return new Response(zplOutput, { status: 200, headers });
+}
+
+interface Item {
+ itemId: string;
+ revision?: string;
+ quantity?: number;
+ number: string;
+ trackedEntityId: string;
+ trackingType: string;
+}
+function generateZPLLabel(item: Item, labelSize: LabelSize): string {
+ if (!labelSize.zpl) {
+ throw new Error("Invalid label size or missing ZPL configuration");
+ }
+ const { width, height } = labelSize.zpl;
+ const dpi = labelSize.zpl.dpi || 203;
+
+ // Convert inches to dots based on DPI
+ const widthDots = Math.round(width * dpi);
+ const heightDots = Math.round(height * dpi);
+
+ // Determine if this is a small or large label
+ const isSmallLabel = width <= 2.5; // Consider 2x1 as small
+
+ // Calculate positions based on label size
+ const textStartX = 20;
+ let fontSize = isSmallLabel ? 25 : 35; // Smaller font for small labels
+ let descFontSize = isSmallLabel ? 18 : 25;
+ let smallFontSize = isSmallLabel ? 12 : 18;
+
+ // QR code positioning and sizing
+ const qrSize = isSmallLabel
+ ? Math.min(heightDots * 0.6, widthDots * 0.35) // Smaller QR for small labels
+ : Math.min(heightDots * 0.7, widthDots * 0.25); // Larger QR with more space on bigger labels
+
+ const qrStartX = isSmallLabel
+ ? widthDots - qrSize - 15 // Tighter spacing on small labels
+ : widthDots - qrSize - 40; // More spacing on larger labels
+
+ // Start ZPL command sequence
+ let zpl = "^XA"; // Start format
+
+ // Set label dimensions
+ zpl += `^PW${widthDots}`;
+ zpl += `^LL${heightDots}`;
+
+ // Item ID (larger font)
+ zpl += `^FO${textStartX},30^A0N,${fontSize},${fontSize}^FD${item.itemId}^FS`;
+
+ // Revision if available
+ let yPosition = isSmallLabel ? 65 : 80;
+ if (item.revision) {
+ zpl += `^FO${textStartX},${yPosition}^A0N,${descFontSize},${descFontSize}^FDRev: ${item.revision}^FS`;
+ yPosition += isSmallLabel ? 25 : 35;
+ }
+
+ // Quantity
+ if (["Serial", "Batch"].includes(item.trackingType)) {
+ zpl += `^FO${textStartX},${yPosition}^A0N,${descFontSize},${descFontSize}^FDQty: ${item.quantity}^FS`;
+ yPosition += isSmallLabel ? 25 : 35;
+ }
+
+ // Serial or Batch number
+ if (item.trackingType === "Serial") {
+ zpl += `^FO${textStartX},${yPosition}^A0N,${descFontSize},${descFontSize}^FDS/N: ${item.number}^FS`;
+ } else if (item.trackingType === "Batch") {
+ zpl += `^FO${textStartX},${yPosition}^A0N,${descFontSize},${descFontSize}^FDBatch: ${item.number}^FS`;
+ }
+
+ // QR Code for tracked entity ID
+ // Using proper error correction level (M) and input mode (A)
+ const qrYPosition = isSmallLabel ? 30 : 40;
+ zpl += `^FO${qrStartX},${qrYPosition}^BQN,2,${isSmallLabel ? 5 : 7},M,A^FD${
+ item.trackedEntityId
+ }^FS`;
+
+ // Tracked entity ID at bottom
+ const idYPosition = isSmallLabel ? heightDots - 25 : heightDots - 35;
+ zpl += `^FO${textStartX},${idYPosition}^A0N,${smallFontSize},${smallFontSize}^FD${item.trackedEntityId}^FS`;
+
+ // End ZPL command sequence
+ zpl += "^XZ"; // End format
+
+ return zpl;
+}
diff --git a/apps/erp/app/routes/file+/receipt+/line.$id.labels[.]pdf.tsx b/apps/erp/app/routes/file+/receipt+/line.$id.labels[.]pdf.tsx
new file mode 100644
index 0000000000..f3085cbcfe
--- /dev/null
+++ b/apps/erp/app/routes/file+/receipt+/line.$id.labels[.]pdf.tsx
@@ -0,0 +1,77 @@
+import { requirePermissions } from "@carbon/auth/auth.server";
+import { ProductLabelPDF } from "@carbon/documents/pdf";
+import { labelSizes } from "@carbon/utils";
+import { renderToStream } from "@react-pdf/renderer";
+import { type LoaderFunctionArgs } from "@vercel/remix";
+import { getReceiptLineTracking } from "~/modules/inventory";
+import { getCompanySettings } from "~/modules/settings/settings.service";
+import { TrackedEntityAttributes } from "~/modules/shared";
+
+export const config = { runtime: "nodejs" };
+
+export async function loader({ request, params }: LoaderFunctionArgs) {
+ const { client, companyId } = await requirePermissions(request, {
+ view: "inventory",
+ });
+
+ const { id } = params;
+ if (!id) throw new Error("Could not find id");
+
+ const [companySettings, receiptLineTracking] = await Promise.all([
+ getCompanySettings(client, companyId),
+ getReceiptLineTracking(client, id, companyId),
+ ]);
+
+ // Get the label size from query params or default to zebra2x1
+ const url = new URL(request.url);
+ const labelSizeId =
+ url.searchParams.get("labelSize") ||
+ companySettings.data?.productLabelSize ||
+ "avery5160";
+
+ // Find the label size configuration
+ const labelSize = labelSizes.find((size) => size.id === labelSizeId);
+
+ if (!labelSize) {
+ throw new Error("Invalid label size or missing ZPL configuration");
+ }
+
+ const items = receiptLineTracking.data?.map((tracking) => ({
+ itemId: tracking.sourceDocumentReadableId ?? "",
+ revision: "0",
+ number:
+ (tracking.attributes as TrackedEntityAttributes)?.["Serial Number"] ??
+ (tracking.attributes as TrackedEntityAttributes)?.["Batch Number"] ??
+ "",
+ trackedEntityId: tracking.id,
+ quantity: tracking.quantity,
+ trackingType: tracking.quantity > 1 ? "Batch" : "Serial",
+ })).sort((a, b) => {
+ if (a.itemId === b.itemId) {
+ return a.number.localeCompare(b.number);
+ }
+ return a.itemId.localeCompare(b.itemId);
+ });
+
+ if (!Array.isArray(items) || items.length === 0) {
+ return new Response(`No items found for receipt ${id}`, { status: 404 });
+ }
+
+ const stream = await renderToStream(
+ <ProductLabelPDF items={items ?? []} labelSize={labelSize} />
+ );
+
+ const body: Buffer = await new Promise((resolve, reject) => {
+ const buffers: Uint8Array[] = [];
+ stream.on("data", (data) => {
+ buffers.push(data);
+ });
+ stream.on("end", () => {
+ resolve(Buffer.concat(buffers));
+ });
+ stream.on("error", reject);
+ });
+
+ const headers = new Headers({ "Content-Type": "application/pdf" });
+ return new Response(body, { status: 200, headers });
+}
diff --git a/apps/erp/app/routes/file+/receipt+/line.$id.labels[.]zpl.tsx b/apps/erp/app/routes/file+/receipt+/line.$id.labels[.]zpl.tsx
new file mode 100644
index 0000000000..6dd47ffaa7
--- /dev/null
+++ b/apps/erp/app/routes/file+/receipt+/line.$id.labels[.]zpl.tsx
@@ -0,0 +1,157 @@
+import { requirePermissions } from "@carbon/auth/auth.server";
+import { LabelSize, labelSizes } from "@carbon/utils";
+import { redirect, type LoaderFunctionArgs } from "@vercel/remix";
+import { getReceiptLineTracking } from "~/modules/inventory/inventory.service";
+import { getCompanySettings } from "~/modules/settings/settings.service";
+import { TrackedEntityAttributes } from "~/modules/shared/types";
+import { path } from "~/utils/path";
+
+export const config = { runtime: "nodejs" };
+
+export async function loader({ request, params }: LoaderFunctionArgs) {
+ const { client, companyId } = await requirePermissions(request, {
+ view: "inventory",
+ });
+
+ const { id } = params;
+ if (!id) throw new Error("Could not find id");
+
+ const [companySettings, receiptLineTracking] = await Promise.all([
+ getCompanySettings(client, companyId),
+ getReceiptLineTracking(client, id, companyId),
+ ]);
+
+ // Get the label size from query params or default to avery5160
+ const url = new URL(request.url);
+ const labelParam = url.searchParams.get("labelSize");
+ const labelSizeId =
+ labelParam || companySettings.data?.productLabelSize || "avery5160";
+
+ // Find the label size configuration
+ let labelSize = labelSizes.find((size) => size.id === labelSizeId);
+
+ if (!labelSize) {
+ throw new Error("Invalid label size");
+ }
+
+ if (labelSize.zpl) {
+ throw redirect(
+ path.to.file.receiptLineLabelsZpl(id, labelParam ?? undefined)
+ );
+ }
+
+ const items = receiptLineTracking.data?.map((tracking) => ({
+ itemId: tracking.sourceDocumentReadableId ?? "",
+ revision: "0",
+ number:
+ (tracking.attributes as TrackedEntityAttributes)?.["Serial Number"] ??
+ (tracking.attributes as TrackedEntityAttributes)?.["Batch Number"] ??
+ "",
+ trackedEntityId: tracking.id,
+ quantity: tracking.quantity,
+ trackingType: tracking.quantity > 1 ? "Batch" : "Serial",
+ }));
+
+ if (!Array.isArray(items) || items.length === 0) {
+ return new Response(`No items found for receipt ${id}`, { status: 404 });
+ }
+
+ if (!labelSize?.zpl) {
+ throw new Error("Invalid label size or missing ZPL configuration");
+ }
+
+ // Generate ZPL for each item
+ const zplCommands = items.map((item) => generateZPLLabel(item, labelSize));
+ const zplOutput = zplCommands.join("\n");
+
+ const headers = new Headers({
+ "Content-Type": "application/zpl",
+ "Content-Disposition": `attachment; filename="labels-${id}.zpl"`,
+ });
+
+ return new Response(zplOutput, { status: 200, headers });
+}
+
+interface Item {
+ itemId: string;
+ revision?: string;
+ quantity?: number;
+ number: string;
+ trackedEntityId: string;
+ trackingType: string;
+}
+function generateZPLLabel(item: Item, labelSize: LabelSize): string {
+ if (!labelSize.zpl) {
+ throw new Error("Invalid label size or missing ZPL configuration");
+ }
+ const { width, height } = labelSize.zpl;
+ const dpi = labelSize.zpl.dpi || 203;
+
+ // Convert inches to dots based on DPI
+ const widthDots = Math.round(width * dpi);
+ const heightDots = Math.round(height * dpi);
+
+ // Determine if this is a small or large label
+ const isSmallLabel = width <= 2.5; // Consider 2x1 as small
+
+ // Calculate positions based on label size
+ const textStartX = 20;
+ let fontSize = isSmallLabel ? 25 : 35; // Smaller font for small labels
+ let descFontSize = isSmallLabel ? 18 : 25;
+ let smallFontSize = isSmallLabel ? 12 : 18;
+
+ // QR code positioning and sizing
+ const qrSize = isSmallLabel
+ ? Math.min(heightDots * 0.6, widthDots * 0.35) // Smaller QR for small labels
+ : Math.min(heightDots * 0.7, widthDots * 0.25); // Larger QR with more space on bigger labels
+
+ const qrStartX = isSmallLabel
+ ? widthDots - qrSize - 15 // Tighter spacing on small labels
+ : widthDots - qrSize - 40; // More spacing on larger labels
+
+ // Start ZPL command sequence
+ let zpl = "^XA"; // Start format
+
+ // Set label dimensions
+ zpl += `^PW${widthDots}`;
+ zpl += `^LL${heightDots}`;
+
+ // Item ID (larger font)
+ zpl += `^FO${textStartX},30^A0N,${fontSize},${fontSize}^FD${item.itemId}^FS`;
+
+ // Revision if available
+ let yPosition = isSmallLabel ? 65 : 80;
+ if (item.revision) {
+ zpl += `^FO${textStartX},${yPosition}^A0N,${descFontSize},${descFontSize}^FDRev: ${item.revision}^FS`;
+ yPosition += isSmallLabel ? 25 : 35;
+ }
+
+ // Quantity
+ if (["Serial", "Batch"].includes(item.trackingType)) {
+ zpl += `^FO${textStartX},${yPosition}^A0N,${descFontSize},${descFontSize}^FDQty: ${item.quantity}^FS`;
+ yPosition += isSmallLabel ? 25 : 35;
+ }
+
+ // Serial or Batch number
+ if (item.trackingType === "Serial") {
+ zpl += `^FO${textStartX},${yPosition}^A0N,${descFontSize},${descFontSize}^FDS/N: ${item.number}^FS`;
+ } else if (item.trackingType === "Batch") {
+ zpl += `^FO${textStartX},${yPosition}^A0N,${descFontSize},${descFontSize}^FDBatch: ${item.number}^FS`;
+ }
+
+ // QR Code for tracked entity ID
+ // Using proper error correction level (M) and input mode (A)
+ const qrYPosition = isSmallLabel ? 30 : 40;
+ zpl += `^FO${qrStartX},${qrYPosition}^BQN,2,${isSmallLabel ? 5 : 7},M,A^FD${
+ item.trackedEntityId
+ }^FS`;
+
+ // Tracked entity ID at bottom
+ const idYPosition = isSmallLabel ? heightDots - 25 : heightDots - 35;
+ zpl += `^FO${textStartX},${idYPosition}^A0N,${smallFontSize},${smallFontSize}^FD${item.trackedEntityId}^FS`;
+
+ // End ZPL command sequence
+ zpl += "^XZ"; // End format
+
+ return zpl;
+}
diff --git a/apps/erp/app/routes/x+/production+/_index.tsx b/apps/erp/app/routes/x+/production+/_index.tsx
index 0abeaaf75a..6670f546bc 100644
--- a/apps/erp/app/routes/x+/production+/_index.tsx
+++ b/apps/erp/app/routes/x+/production+/_index.tsx
@@ -1,4 +1,5 @@
import {
+ Badge,
Button,
Card,
CardAction,
@@ -56,7 +57,6 @@ import {
LuEllipsisVertical,
LuFile,
LuHardHat,
- LuLayoutList,
LuSquareUser,
LuUserRoundCheck,
} from "react-icons/lu";
@@ -287,7 +287,7 @@ export default function ProductionDashboard() {
<Card className="col-span-3 p-6 rounded-xl items-start justify-start gap-y-4">
<HStack className="justify-between w-full items-start mb-4">
<div className="bg-muted/80 border border-border rounded-xl p-2 text-foreground dark:shadow-md">
- <LuLayoutList className="size-5" />
+ <LuHardHat className="size-5" />
</div>
<Button
size="sm"
@@ -403,21 +403,23 @@ export default function ProductionDashboard() {
/>
)}
</div>
- <HStack className="text-sm text-muted-foreground pl-[3px] pt-1">
+ <HStack className="pl-[3px] pt-1">
{isFetching ? (
- <Skeleton className="h-5 w-1/4" />
+ <Skeleton className="h-8 w-1/2" />
) : (
<>
- <p>{formatDurationMilliseconds(total)}</p>
+ <p className="text-xl font-semibold tracking-tight">
+ {formatDurationMilliseconds(total)}
+ </p>
- {percentageChange > 0 ? (
- <span className="text-emerald-500">
+ {percentageChange >= 0 ? (
+ <Badge variant="green">
+{percentageChange.toFixed(0)}%
- </span>
+ </Badge>
) : (
- <span className="text-red-500">
+ <Badge variant="red">
{percentageChange.toFixed(0)}%
- </span>
+ </Badge>
)}
</>
)}
diff --git a/apps/erp/app/routes/x+/purchasing+/_index.tsx b/apps/erp/app/routes/x+/purchasing+/_index.tsx
index adb4b0c384..617f8c8b95 100644
--- a/apps/erp/app/routes/x+/purchasing+/_index.tsx
+++ b/apps/erp/app/routes/x+/purchasing+/_index.tsx
@@ -1,5 +1,6 @@
import { requirePermissions } from "@carbon/auth/auth.server";
import {
+ Badge,
Button,
Card,
CardAction,
@@ -430,26 +431,26 @@ export default function PurchaseDashboard() {
className="font-medium text-sm min-w-[160px] gap-4"
/>
</div>
- <HStack className="text-sm text-muted-foreground pl-[3px] pt-1">
+ <HStack className="pl-[3px] pt-1">
{isFetching ? (
- <Skeleton className="h-5 w-1/4" />
+ <Skeleton className="h-8 w-1/2" />
) : (
<>
- <p>
+ <p className="text-xl font-semibold tracking-tight">
{["purchaseOrderAmount", "purchaseInvoiceAmount"].includes(
selectedKpiData.key
)
? currencyFormatter.format(total)
: numberFormatter.format(total)}
</p>
- {percentageChange > 0 ? (
- <span className="text-emerald-500">
+ {percentageChange >= 0 ? (
+ <Badge variant="green">
+{percentageChange.toFixed(0)}%
- </span>
+ </Badge>
) : (
- <span className="text-red-500">
+ <Badge variant="red">
{percentageChange.toFixed(0)}%
- </span>
+ </Badge>
)}
</>
)}
diff --git a/apps/erp/app/routes/x+/receipt+/$receiptId.tsx b/apps/erp/app/routes/x+/receipt+/$receiptId.tsx
index c36e13bca9..3d7725303b 100644
--- a/apps/erp/app/routes/x+/receipt+/$receiptId.tsx
+++ b/apps/erp/app/routes/x+/receipt+/$receiptId.tsx
@@ -11,9 +11,10 @@ import {
getBatchProperties,
getReceipt,
getReceiptFiles,
- getReceiptLineTracking,
+ getReceiptTracking,
getReceiptLines,
} from "~/modules/inventory";
+import { getCompanySettings } from "~/modules/settings";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
@@ -32,9 +33,10 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
const { receiptId } = params;
if (!receiptId) throw new Error("Could not find receiptId");
- const [receipt, receiptLines] = await Promise.all([
+ const [receipt, receiptLines, receiptLineTracking] = await Promise.all([
getReceipt(serviceRole, receiptId),
getReceiptLines(serviceRole, receiptId),
+ getReceiptTracking(serviceRole, receiptId, companyId),
]);
if (receipt.error) {
@@ -58,11 +60,6 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
.map((line) => line.itemId);
}
- const receiptLineTracking = await getReceiptLineTracking(
- serviceRole,
- receiptLineIds
- );
-
return defer({
receipt: receipt.data,
receiptLines: receiptLines.data ?? [],
@@ -71,6 +68,7 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
batchProperties:
getBatchProperties(serviceRole, itemsWithBatchProperties, companyId) ??
[],
+ companySettings: getCompanySettings(serviceRole, companyId),
});
}
diff --git a/apps/erp/app/routes/x+/receipt+/lines.tracking.tsx b/apps/erp/app/routes/x+/receipt+/lines.tracking.tsx
index 1ac186c8f5..53ec68029f 100644
--- a/apps/erp/app/routes/x+/receipt+/lines.tracking.tsx
+++ b/apps/erp/app/routes/x+/receipt+/lines.tracking.tsx
@@ -1,6 +1,7 @@
import { getCarbonServiceRole } from "@carbon/auth";
import { requirePermissions } from "@carbon/auth/auth.server";
import { json, type ActionFunctionArgs } from "@vercel/remix";
+import { TrackedEntityAttributes } from "~/modules/shared/types";
export async function action({ request, context }: ActionFunctionArgs) {
const { client, companyId } = await requirePermissions(request, {
@@ -20,9 +21,9 @@ export async function action({ request, context }: ActionFunctionArgs) {
// First, get or create the batch number record
const { data: trackedEntity, error: batchQueryError } = await client
.from("trackedEntity")
- .select("*, trackedEntityAttribute(*)")
- .eq("trackedEntityAttribute.name", "Receipt Line")
- .eq("trackedEntityAttribute.textValue", receiptLineId)
+ .select("*")
+ .eq("attributes ->> Receipt", receiptId)
+ .eq("attributes ->> Batch Number", batchNumber)
.eq("companyId", companyId)
.maybeSingle();
@@ -60,39 +61,39 @@ export async function action({ request, context }: ActionFunctionArgs) {
const serialNumber = formData.get("serialNumber") as string;
const index = Number(formData.get("index"));
- // Check if serial number already exists for this item
- const { data: existingSerialNumbers, error: serialQueryError } =
+ // Check if the serial number is already used for a different receipt line or index
+ const { data: existingEntityWithIndex, error: indexQueryError } =
await client
.from("trackedEntity")
- .select("*, trackedEntityAttribute(*)")
- .eq("sourceDocument", "Item")
+ .select("*")
.eq("sourceDocumentId", itemId)
- .eq("companyId", companyId);
+ .eq("attributes->> Serial Number", serialNumber)
+ .eq("companyId", companyId)
+ .maybeSingle();
- if (serialQueryError) {
- return json({ error: "Failed to check serial number" }, { status: 500 });
+ if (indexQueryError) {
+ return json(
+ { error: "Failed to check serial number index" },
+ { status: 500 }
+ );
}
- const existingEntityWithSerialNumber = existingSerialNumbers?.find((t) =>
- t.trackedEntityAttribute?.some(
- (attribute) =>
- attribute.name === "Serial Number" &&
- attribute.textValue === serialNumber
- )
- );
-
- const existingEntityWithIndex = existingSerialNumbers?.find((t) =>
- t.trackedEntityAttribute?.some(
- (attribute) =>
- attribute.name === "Index" && attribute.numericValue === index
- )
- );
-
- if (
- existingEntityWithSerialNumber &&
- existingEntityWithIndex?.id !== existingEntityWithSerialNumber.id
- ) {
- return json({ error: "Serial number already exists" }, { status: 400 });
+ // If the serial number exists but for a different receipt line or index, return an error
+ if (existingEntityWithIndex) {
+ const attributes =
+ existingEntityWithIndex.attributes as TrackedEntityAttributes;
+ if (
+ attributes["Receipt Line"] !== receiptLineId ||
+ attributes["Index"] !== index
+ ) {
+ return json(
+ {
+ error:
+ "Serial number is already used for a different item or position",
+ },
+ { status: 400 }
+ );
+ }
}
const serviceRole = await getCarbonServiceRole();
diff --git a/apps/erp/app/routes/x+/sales+/_index.tsx b/apps/erp/app/routes/x+/sales+/_index.tsx
index f7823ec7df..1727d20b37 100644
--- a/apps/erp/app/routes/x+/sales+/_index.tsx
+++ b/apps/erp/app/routes/x+/sales+/_index.tsx
@@ -1,5 +1,6 @@
import { requirePermissions } from "@carbon/auth/auth.server";
import {
+ Badge,
Button,
Card,
CardAction,
@@ -512,12 +513,12 @@ export default function SalesDashboard() {
className="min-w-[160px] gap-4"
/>
</div>
- <HStack className="text-sm text-muted-foreground pl-[3px] pt-1">
+ <HStack className="pl-[3px] pt-1">
{isFetching ? (
- <Skeleton className="h-5 w-1/4" />
+ <Skeleton className="h-8 w-1/2" />
) : (
<>
- <p>
+ <p className="text-xl font-semibold tracking-tight">
{["salesOrderRevenue", "salesFunnel"].includes(
selectedKpiData.key
)
@@ -525,13 +526,13 @@ export default function SalesDashboard() {
: numberFormatter.format(total)}
</p>
{percentageChange >= 0 ? (
- <span className="text-emerald-500">
+ <Badge variant="green">
+{percentageChange.toFixed(0)}%
- </span>
+ </Badge>
) : (
- <span className="text-red-500">
+ <Badge variant="red">
{percentageChange.toFixed(0)}%
- </span>
+ </Badge>
)}
</>
)}
diff --git a/apps/erp/app/routes/x+/settings+/labels.tsx b/apps/erp/app/routes/x+/settings+/labels.tsx
new file mode 100644
index 0000000000..cc8c0e172a
--- /dev/null
+++ b/apps/erp/app/routes/x+/settings+/labels.tsx
@@ -0,0 +1,154 @@
+import {
+ Card,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ Heading,
+ ScrollArea,
+ toast,
+ VStack,
+} from "@carbon/react";
+import type { ActionFunctionArgs, LoaderFunctionArgs } from "@vercel/remix";
+import { json, redirect } from "@vercel/remix";
+
+import { error } from "@carbon/auth";
+import { requirePermissions } from "@carbon/auth/auth.server";
+import { flash } from "@carbon/auth/session.server";
+import { Select, Submit, ValidatedForm, validator } from "@carbon/form";
+import { labelSizes } from "@carbon/utils";
+import { useFetcher, useLoaderData } from "@remix-run/react";
+import { useEffect } from "react";
+import {
+ getCompanySettings,
+} from "~/modules/settings";
+import type { Handle } from "~/utils/handle";
+import { path } from "~/utils/path";
+import { productLabelSizeValidator, updateProductLabelSize } from "~/modules/settings";
+export const handle: Handle = {
+ breadcrumb: "Labels",
+ to: path.to.labelsSettings,
+};
+
+export async function loader({ request }: LoaderFunctionArgs) {
+ const { client, companyId } = await requirePermissions(request, {
+ view: "settings",
+ });
+
+ const [companySettings] = await Promise.all([
+ getCompanySettings(client, companyId),
+ ]);
+ if (!companySettings.data)
+ throw redirect(
+ path.to.settings,
+ await flash(
+ request,
+ error(companySettings.error, "Failed to get company settings")
+ )
+ );
+ return json({ companySettings: companySettings.data, });
+}
+
+export async function action({ request }: ActionFunctionArgs) {
+ const { client, companyId } = await requirePermissions(request, {
+ update: "settings",
+ });
+
+ const formData = await request.formData();
+ const intent = formData.get("intent");
+
+ switch (intent) {
+ case "productLabelSize":
+ const validation = await validator(productLabelSizeValidator).validate(
+ formData
+ );
+
+ if (validation.error) {
+ return json({ success: false, message: "Invalid form data" });
+ }
+
+ const productLabelSize = await updateProductLabelSize(
+ client,
+ companyId,
+ validation.data.productLabelSize
+ );
+ if (productLabelSize.error)
+ return json({ success: false, message: productLabelSize.error.message });
+
+ }
+
+ return json({ success: true, message: "Label settings updated" });
+}
+
+export default function SalesSettingsRoute() {
+ const { companySettings } = useLoaderData<typeof loader>();
+ const fetcher = useFetcher<typeof action>();
+
+
+ useEffect(() => {
+ if (fetcher.data?.success === true && fetcher?.data?.message) {
+ toast.success(fetcher.data.message);
+ }
+
+ if (fetcher.data?.success === false && fetcher?.data?.message) {
+ toast.error(fetcher.data.message);
+ }
+ }, [fetcher.data?.message, fetcher.data?.success]);
+
+
+
+
+
+ return (
+ <ScrollArea className="w-full h-[calc(100dvh-49px)]">
+ <VStack
+ spacing={4}
+ className="py-12 px-4 max-w-[60rem] h-full mx-auto gap-4"
+ >
+ <Heading size="h3">Labels</Heading>
+ <Card>
+ <ValidatedForm
+ method="post"
+ validator={productLabelSizeValidator}
+ defaultValues={{
+ productLabelSize: companySettings.productLabelSize ?? "avery5160",
+ }}
+ fetcher={fetcher}
+ >
+ <input type="hidden" name="intent" value="productLabelSize" />
+ <CardHeader>
+ <CardTitle className="flex items-center gap-2">
+ Product Label Size
+ </CardTitle>
+ <CardDescription>
+ Define the default size of the product label. Used for tracking items in inventory.
+ </CardDescription>
+ </CardHeader>
+ <CardContent>
+ <div className="flex flex-col gap-8 max-w-[400px]">
+ <div className="flex flex-col gap-2">
+
+ <Select
+ name="productLabelSize"
+ label="Product Label Size"
+ options={labelSizes.map((size) => ({
+ value: size.id,
+ label: size.name,
+ }))}
+ />
+ </div>
+
+
+ </div>
+ </CardContent>
+ <CardFooter>
+ <Submit>Save</Submit>
+ </CardFooter>
+ </ValidatedForm>
+ </Card>
+
+ </VStack>
+ </ScrollArea>
+ );
+}
diff --git a/apps/erp/app/utils/path.ts b/apps/erp/app/utils/path.ts
index ada388be36..e0d909a23e 100644
--- a/apps/erp/app/utils/path.ts
+++ b/apps/erp/app/utils/path.ts
@@ -100,8 +100,33 @@ export const path = {
previewFile: (path: string) => generatePath(`${file}/preview/${path}`),
purchaseOrder: (id: string) =>
generatePath(`${file}/purchase-order/${id}.pdf`),
+ receiptLabelsPdf: (id: string, labelSize?: string) =>
+ generatePath(
+ labelSize
+ ? `${file}/receipt/${id}/labels.pdf?labelSize=${labelSize}`
+ : `${file}/receipt/${id}/labels.pdf`
+ ),
+ receiptLabelsZpl: (id: string, labelSize?: string) =>
+ generatePath(
+ labelSize
+ ? `${file}/receipt/${id}/labels.zpl?labelSize=${labelSize}`
+ : `${file}/receipt/${id}/labels.zpl`
+ ),
+ receiptLineLabelsPdf: (id: string, labelSize?: string) =>
+ generatePath(
+ labelSize
+ ? `${file}/receipt/line/${id}/labels.pdf?labelSize=${labelSize}`
+ : `${file}/receipt/line/${id}/labels.pdf`
+ ),
+ receiptLineLabelsZpl: (id: string, labelSize?: string) =>
+ generatePath(
+ labelSize
+ ? `${file}/receipt/line/${id}/labels.zpl?labelSize=${labelSize}`
+ : `${file}/receipt/line/${id}/labels.zpl`
+ ),
salesOrder: (id: string) => generatePath(`${file}/sales-order/${id}.pdf`),
shipment: (id: string) => generatePath(`${file}/shipment/${id}.pdf`),
+
quote: (id: string) => generatePath(`${file}/quote/${id}.pdf`),
},
legal: {
@@ -499,6 +524,7 @@ export const path = {
jobRecalculate: (id: string) => generatePath(`${x}/job/${id}/recalculate`),
jobRelease: (id: string) => generatePath(`${x}/job/${id}/release`),
jobStatus: (id: string) => generatePath(`${x}/job/${id}/status`),
+ labelsSettings: `${x}/settings/labels`,
location: (id: string) => generatePath(`${x}/resources/locations/${id}`),
locations: `${x}/resources/locations`,
login: "/login",
diff --git a/packages/database/src/swagger-docs-schema.ts b/packages/database/src/swagger-docs-schema.ts
index 33faf15128..2acb48571e 100644
--- a/packages/database/src/swagger-docs-schema.ts
+++ b/packages/database/src/swagger-docs-schema.ts
@@ -4542,204 +4542,6 @@ export default {
tags: ["currencyCode"],
},
},
- "/batchNumber": {
- get: {
- parameters: [
- {
- $ref: "#/parameters/rowFilter.batchNumber.id",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.number",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.itemId",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.source",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.companyId",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.supplierId",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.manufacturingDate",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.expirationDate",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.notes",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.properties",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.createdAt",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.createdBy",
- },
- {
- $ref: "#/parameters/select",
- },
- {
- $ref: "#/parameters/order",
- },
- {
- $ref: "#/parameters/range",
- },
- {
- $ref: "#/parameters/rangeUnit",
- },
- {
- $ref: "#/parameters/offset",
- },
- {
- $ref: "#/parameters/limit",
- },
- {
- $ref: "#/parameters/preferCount",
- },
- ],
- responses: {
- "200": {
- description: "OK",
- schema: {
- items: {
- $ref: "#/definitions/batchNumber",
- },
- type: "array",
- },
- },
- "206": {
- description: "Partial Content",
- },
- },
- tags: ["batchNumber"],
- },
- post: {
- parameters: [
- {
- $ref: "#/parameters/body.batchNumber",
- },
- {
- $ref: "#/parameters/select",
- },
- {
- $ref: "#/parameters/preferPost",
- },
- ],
- responses: {
- "201": {
- description: "Created",
- },
- },
- tags: ["batchNumber"],
- },
- delete: {
- parameters: [
- {
- $ref: "#/parameters/rowFilter.batchNumber.id",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.number",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.itemId",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.source",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.companyId",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.supplierId",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.manufacturingDate",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.expirationDate",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.notes",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.properties",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.createdAt",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.createdBy",
- },
- {
- $ref: "#/parameters/preferReturn",
- },
- ],
- responses: {
- "204": {
- description: "No Content",
- },
- },
- tags: ["batchNumber"],
- },
- patch: {
- parameters: [
- {
- $ref: "#/parameters/rowFilter.batchNumber.id",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.number",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.itemId",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.source",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.companyId",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.supplierId",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.manufacturingDate",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.expirationDate",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.notes",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.properties",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.createdAt",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumber.createdBy",
- },
- {
- $ref: "#/parameters/body.batchNumber",
- },
- {
- $ref: "#/parameters/preferReturn",
- },
- ],
- responses: {
- "204": {
- description: "No Content",
- },
- },
- tags: ["batchNumber"],
- },
- },
"/methodMaterial": {
get: {
parameters: [
@@ -5277,50 +5079,77 @@ export default {
tags: ["process"],
},
},
- "/itemTracking": {
+ "/quoteMaterial": {
get: {
parameters: [
{
- $ref: "#/parameters/rowFilter.itemTracking.id",
+ $ref: "#/parameters/rowFilter.quoteMaterial.id",
+ },
+ {
+ $ref: "#/parameters/rowFilter.quoteMaterial.quoteId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.quoteMaterial.quoteLineId",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.sourceDocument",
+ $ref: "#/parameters/rowFilter.quoteMaterial.itemId",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.sourceDocumentId",
+ $ref: "#/parameters/rowFilter.quoteMaterial.itemReadableId",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.sourceDocumentLineId",
+ $ref: "#/parameters/rowFilter.quoteMaterial.itemType",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.sourceDocumentReadableId",
+ $ref: "#/parameters/rowFilter.quoteMaterial.methodType",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.itemId",
+ $ref: "#/parameters/rowFilter.quoteMaterial.order",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.serialNumberId",
+ $ref: "#/parameters/rowFilter.quoteMaterial.description",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.batchNumberId",
+ $ref: "#/parameters/rowFilter.quoteMaterial.quantity",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.quantity",
+ $ref: "#/parameters/rowFilter.quoteMaterial.unitOfMeasureCode",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.index",
+ $ref: "#/parameters/rowFilter.quoteMaterial.unitCost",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.posted",
+ $ref: "#/parameters/rowFilter.quoteMaterial.companyId",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.companyId",
+ $ref: "#/parameters/rowFilter.quoteMaterial.createdAt",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.createdAt",
+ $ref: "#/parameters/rowFilter.quoteMaterial.createdBy",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.createdBy",
+ $ref: "#/parameters/rowFilter.quoteMaterial.updatedAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.quoteMaterial.updatedBy",
+ },
+ {
+ $ref: "#/parameters/rowFilter.quoteMaterial.customFields",
+ },
+ {
+ $ref: "#/parameters/rowFilter.quoteMaterial.quoteMakeMethodId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.quoteMaterial.quoteOperationId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.quoteMaterial.scrapQuantity",
+ },
+ {
+ $ref: "#/parameters/rowFilter.quoteMaterial.tags",
+ },
+ {
+ $ref: "#/parameters/rowFilter.quoteMaterial.productionQuantity",
},
{
$ref: "#/parameters/select",
@@ -5349,7 +5178,7 @@ export default {
description: "OK",
schema: {
items: {
- $ref: "#/definitions/itemTracking",
+ $ref: "#/definitions/quoteMaterial",
},
type: "array",
},
@@ -5358,12 +5187,12 @@ export default {
description: "Partial Content",
},
},
- tags: ["itemTracking"],
+ tags: ["quoteMaterial"],
},
post: {
parameters: [
{
- $ref: "#/parameters/body.itemTracking",
+ $ref: "#/parameters/body.quoteMaterial",
},
{
$ref: "#/parameters/select",
@@ -5377,109 +5206,78 @@ export default {
description: "Created",
},
},
- tags: ["itemTracking"],
+ tags: ["quoteMaterial"],
},
delete: {
parameters: [
{
- $ref: "#/parameters/rowFilter.itemTracking.id",
- },
- {
- $ref: "#/parameters/rowFilter.itemTracking.sourceDocument",
- },
- {
- $ref: "#/parameters/rowFilter.itemTracking.sourceDocumentId",
- },
- {
- $ref: "#/parameters/rowFilter.itemTracking.sourceDocumentLineId",
- },
- {
- $ref: "#/parameters/rowFilter.itemTracking.sourceDocumentReadableId",
- },
- {
- $ref: "#/parameters/rowFilter.itemTracking.itemId",
- },
- {
- $ref: "#/parameters/rowFilter.itemTracking.serialNumberId",
+ $ref: "#/parameters/rowFilter.quoteMaterial.id",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.batchNumberId",
+ $ref: "#/parameters/rowFilter.quoteMaterial.quoteId",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.quantity",
+ $ref: "#/parameters/rowFilter.quoteMaterial.quoteLineId",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.index",
+ $ref: "#/parameters/rowFilter.quoteMaterial.itemId",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.posted",
+ $ref: "#/parameters/rowFilter.quoteMaterial.itemReadableId",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.companyId",
+ $ref: "#/parameters/rowFilter.quoteMaterial.itemType",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.createdAt",
+ $ref: "#/parameters/rowFilter.quoteMaterial.methodType",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.createdBy",
+ $ref: "#/parameters/rowFilter.quoteMaterial.order",
},
{
- $ref: "#/parameters/preferReturn",
- },
- ],
- responses: {
- "204": {
- description: "No Content",
- },
- },
- tags: ["itemTracking"],
- },
- patch: {
- parameters: [
- {
- $ref: "#/parameters/rowFilter.itemTracking.id",
+ $ref: "#/parameters/rowFilter.quoteMaterial.description",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.sourceDocument",
+ $ref: "#/parameters/rowFilter.quoteMaterial.quantity",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.sourceDocumentId",
+ $ref: "#/parameters/rowFilter.quoteMaterial.unitOfMeasureCode",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.sourceDocumentLineId",
+ $ref: "#/parameters/rowFilter.quoteMaterial.unitCost",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.sourceDocumentReadableId",
+ $ref: "#/parameters/rowFilter.quoteMaterial.companyId",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.itemId",
+ $ref: "#/parameters/rowFilter.quoteMaterial.createdAt",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.serialNumberId",
+ $ref: "#/parameters/rowFilter.quoteMaterial.createdBy",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.batchNumberId",
+ $ref: "#/parameters/rowFilter.quoteMaterial.updatedAt",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.quantity",
+ $ref: "#/parameters/rowFilter.quoteMaterial.updatedBy",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.index",
+ $ref: "#/parameters/rowFilter.quoteMaterial.customFields",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.posted",
+ $ref: "#/parameters/rowFilter.quoteMaterial.quoteMakeMethodId",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.companyId",
+ $ref: "#/parameters/rowFilter.quoteMaterial.quoteOperationId",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.createdAt",
+ $ref: "#/parameters/rowFilter.quoteMaterial.scrapQuantity",
},
{
- $ref: "#/parameters/rowFilter.itemTracking.createdBy",
+ $ref: "#/parameters/rowFilter.quoteMaterial.tags",
},
{
- $ref: "#/parameters/body.itemTracking",
+ $ref: "#/parameters/rowFilter.quoteMaterial.productionQuantity",
},
{
$ref: "#/parameters/preferReturn",
@@ -5490,11 +5288,9 @@ export default {
description: "No Content",
},
},
- tags: ["itemTracking"],
+ tags: ["quoteMaterial"],
},
- },
- "/quoteMaterial": {
- get: {
+ patch: {
parameters: [
{
$ref: "#/parameters/rowFilter.quoteMaterial.id",
@@ -5564,246 +5360,36 @@ export default {
},
{
$ref: "#/parameters/rowFilter.quoteMaterial.productionQuantity",
- },
- {
- $ref: "#/parameters/select",
- },
- {
- $ref: "#/parameters/order",
- },
- {
- $ref: "#/parameters/range",
- },
- {
- $ref: "#/parameters/rangeUnit",
- },
- {
- $ref: "#/parameters/offset",
- },
- {
- $ref: "#/parameters/limit",
- },
- {
- $ref: "#/parameters/preferCount",
- },
- ],
- responses: {
- "200": {
- description: "OK",
- schema: {
- items: {
- $ref: "#/definitions/quoteMaterial",
- },
- type: "array",
- },
- },
- "206": {
- description: "Partial Content",
- },
- },
- tags: ["quoteMaterial"],
- },
- post: {
- parameters: [
- {
- $ref: "#/parameters/body.quoteMaterial",
- },
- {
- $ref: "#/parameters/select",
- },
- {
- $ref: "#/parameters/preferPost",
- },
- ],
- responses: {
- "201": {
- description: "Created",
- },
- },
- tags: ["quoteMaterial"],
- },
- delete: {
- parameters: [
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.id",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.quoteId",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.quoteLineId",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.itemId",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.itemReadableId",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.itemType",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.methodType",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.order",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.description",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.quantity",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.unitOfMeasureCode",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.unitCost",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.companyId",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.createdAt",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.createdBy",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.updatedAt",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.updatedBy",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.customFields",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.quoteMakeMethodId",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.quoteOperationId",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.scrapQuantity",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.tags",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.productionQuantity",
- },
- {
- $ref: "#/parameters/preferReturn",
- },
- ],
- responses: {
- "204": {
- description: "No Content",
- },
- },
- tags: ["quoteMaterial"],
- },
- patch: {
- parameters: [
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.id",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.quoteId",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.quoteLineId",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.itemId",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.itemReadableId",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.itemType",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.methodType",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.order",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.description",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.quantity",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.unitOfMeasureCode",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.unitCost",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.companyId",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.createdAt",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.createdBy",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.updatedAt",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.updatedBy",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.customFields",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.quoteMakeMethodId",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.quoteOperationId",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.scrapQuantity",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.tags",
- },
- {
- $ref: "#/parameters/rowFilter.quoteMaterial.productionQuantity",
- },
- {
- $ref: "#/parameters/body.quoteMaterial",
- },
- {
- $ref: "#/parameters/preferReturn",
- },
- ],
- responses: {
- "204": {
- description: "No Content",
- },
- },
- tags: ["quoteMaterial"],
- },
- },
- "/contractorAbility": {
- get: {
- parameters: [
- {
- $ref: "#/parameters/rowFilter.contractorAbility.contractorId",
- },
- {
- $ref: "#/parameters/rowFilter.contractorAbility.abilityId",
- },
- {
- $ref: "#/parameters/rowFilter.contractorAbility.createdBy",
- },
- {
- $ref: "#/parameters/rowFilter.contractorAbility.createdAt",
+ },
+ {
+ $ref: "#/parameters/body.quoteMaterial",
+ },
+ {
+ $ref: "#/parameters/preferReturn",
+ },
+ ],
+ responses: {
+ "204": {
+ description: "No Content",
+ },
+ },
+ tags: ["quoteMaterial"],
+ },
+ },
+ "/contractorAbility": {
+ get: {
+ parameters: [
+ {
+ $ref: "#/parameters/rowFilter.contractorAbility.contractorId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.contractorAbility.abilityId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.contractorAbility.createdBy",
+ },
+ {
+ $ref: "#/parameters/rowFilter.contractorAbility.createdAt",
},
{
$ref: "#/parameters/select",
@@ -13710,78 +13296,6 @@ export default {
tags: ["costLedger"],
},
},
- "/batchNumbers": {
- get: {
- parameters: [
- {
- $ref: "#/parameters/rowFilter.batchNumbers.id",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumbers.number",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumbers.manufacturingDate",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumbers.expirationDate",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumbers.supplierId",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumbers.companyId",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumbers.itemId",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumbers.source",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumbers.itemName",
- },
- {
- $ref: "#/parameters/rowFilter.batchNumbers.itemReadableId",
- },
- {
- $ref: "#/parameters/select",
- },
- {
- $ref: "#/parameters/order",
- },
- {
- $ref: "#/parameters/range",
- },
- {
- $ref: "#/parameters/rangeUnit",
- },
- {
- $ref: "#/parameters/offset",
- },
- {
- $ref: "#/parameters/limit",
- },
- {
- $ref: "#/parameters/preferCount",
- },
- ],
- responses: {
- "200": {
- description: "OK",
- schema: {
- items: {
- $ref: "#/definitions/batchNumbers",
- },
- type: "array",
- },
- },
- "206": {
- description: "Partial Content",
- },
- },
- tags: ["batchNumbers"],
- },
- },
"/purchaseOrderLine": {
get: {
parameters: [
@@ -15093,6 +14607,150 @@ export default {
tags: ["shelf"],
},
},
+ "/trackedActivityOutput": {
+ get: {
+ parameters: [
+ {
+ $ref: "#/parameters/rowFilter.trackedActivityOutput.trackedActivityId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivityOutput.trackedEntityId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivityOutput.quantity",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivityOutput.companyId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivityOutput.createdAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivityOutput.createdBy",
+ },
+ {
+ $ref: "#/parameters/select",
+ },
+ {
+ $ref: "#/parameters/order",
+ },
+ {
+ $ref: "#/parameters/range",
+ },
+ {
+ $ref: "#/parameters/rangeUnit",
+ },
+ {
+ $ref: "#/parameters/offset",
+ },
+ {
+ $ref: "#/parameters/limit",
+ },
+ {
+ $ref: "#/parameters/preferCount",
+ },
+ ],
+ responses: {
+ "200": {
+ description: "OK",
+ schema: {
+ items: {
+ $ref: "#/definitions/trackedActivityOutput",
+ },
+ type: "array",
+ },
+ },
+ "206": {
+ description: "Partial Content",
+ },
+ },
+ tags: ["trackedActivityOutput"],
+ },
+ post: {
+ parameters: [
+ {
+ $ref: "#/parameters/body.trackedActivityOutput",
+ },
+ {
+ $ref: "#/parameters/select",
+ },
+ {
+ $ref: "#/parameters/preferPost",
+ },
+ ],
+ responses: {
+ "201": {
+ description: "Created",
+ },
+ },
+ tags: ["trackedActivityOutput"],
+ },
+ delete: {
+ parameters: [
+ {
+ $ref: "#/parameters/rowFilter.trackedActivityOutput.trackedActivityId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivityOutput.trackedEntityId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivityOutput.quantity",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivityOutput.companyId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivityOutput.createdAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivityOutput.createdBy",
+ },
+ {
+ $ref: "#/parameters/preferReturn",
+ },
+ ],
+ responses: {
+ "204": {
+ description: "No Content",
+ },
+ },
+ tags: ["trackedActivityOutput"],
+ },
+ patch: {
+ parameters: [
+ {
+ $ref: "#/parameters/rowFilter.trackedActivityOutput.trackedActivityId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivityOutput.trackedEntityId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivityOutput.quantity",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivityOutput.companyId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivityOutput.createdAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivityOutput.createdBy",
+ },
+ {
+ $ref: "#/parameters/body.trackedActivityOutput",
+ },
+ {
+ $ref: "#/parameters/preferReturn",
+ },
+ ],
+ responses: {
+ "204": {
+ description: "No Content",
+ },
+ },
+ tags: ["trackedActivityOutput"],
+ },
+ },
"/purchaseInvoiceLines": {
get: {
parameters: [
@@ -16893,6 +16551,177 @@ export default {
tags: ["scrapReason"],
},
},
+ "/trackedActivity": {
+ get: {
+ parameters: [
+ {
+ $ref: "#/parameters/rowFilter.trackedActivity.id",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivity.type",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivity.sourceDocument",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivity.sourceDocumentId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivity.sourceDocumentReadableId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivity.attributes",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivity.companyId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivity.createdAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivity.createdBy",
+ },
+ {
+ $ref: "#/parameters/select",
+ },
+ {
+ $ref: "#/parameters/order",
+ },
+ {
+ $ref: "#/parameters/range",
+ },
+ {
+ $ref: "#/parameters/rangeUnit",
+ },
+ {
+ $ref: "#/parameters/offset",
+ },
+ {
+ $ref: "#/parameters/limit",
+ },
+ {
+ $ref: "#/parameters/preferCount",
+ },
+ ],
+ responses: {
+ "200": {
+ description: "OK",
+ schema: {
+ items: {
+ $ref: "#/definitions/trackedActivity",
+ },
+ type: "array",
+ },
+ },
+ "206": {
+ description: "Partial Content",
+ },
+ },
+ tags: ["trackedActivity"],
+ },
+ post: {
+ parameters: [
+ {
+ $ref: "#/parameters/body.trackedActivity",
+ },
+ {
+ $ref: "#/parameters/select",
+ },
+ {
+ $ref: "#/parameters/preferPost",
+ },
+ ],
+ responses: {
+ "201": {
+ description: "Created",
+ },
+ },
+ tags: ["trackedActivity"],
+ },
+ delete: {
+ parameters: [
+ {
+ $ref: "#/parameters/rowFilter.trackedActivity.id",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivity.type",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivity.sourceDocument",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivity.sourceDocumentId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivity.sourceDocumentReadableId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivity.attributes",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivity.companyId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivity.createdAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivity.createdBy",
+ },
+ {
+ $ref: "#/parameters/preferReturn",
+ },
+ ],
+ responses: {
+ "204": {
+ description: "No Content",
+ },
+ },
+ tags: ["trackedActivity"],
+ },
+ patch: {
+ parameters: [
+ {
+ $ref: "#/parameters/rowFilter.trackedActivity.id",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivity.type",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivity.sourceDocument",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivity.sourceDocumentId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivity.sourceDocumentReadableId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivity.attributes",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivity.companyId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivity.createdAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.trackedActivity.createdBy",
+ },
+ {
+ $ref: "#/parameters/body.trackedActivity",
+ },
+ {
+ $ref: "#/parameters/preferReturn",
+ },
+ ],
+ responses: {
+ "204": {
+ description: "No Content",
+ },
+ },
+ tags: ["trackedActivity"],
+ },
+ },
"/consumables": {
get: {
parameters: [
@@ -28741,10 +28570,7 @@ export default {
$ref: "#/parameters/rowFilter.itemLedger.documentLineId",
},
{
- $ref: "#/parameters/rowFilter.itemLedger.serialNumber",
- },
- {
- $ref: "#/parameters/rowFilter.itemLedger.batchNumber",
+ $ref: "#/parameters/rowFilter.itemLedger.trackedEntityId",
},
{
$ref: "#/parameters/select",
@@ -28854,10 +28680,7 @@ export default {
$ref: "#/parameters/rowFilter.itemLedger.documentLineId",
},
{
- $ref: "#/parameters/rowFilter.itemLedger.serialNumber",
- },
- {
- $ref: "#/parameters/rowFilter.itemLedger.batchNumber",
+ $ref: "#/parameters/rowFilter.itemLedger.trackedEntityId",
},
{
$ref: "#/parameters/preferReturn",
@@ -28921,10 +28744,7 @@ export default {
$ref: "#/parameters/rowFilter.itemLedger.documentLineId",
},
{
- $ref: "#/parameters/rowFilter.itemLedger.serialNumber",
- },
- {
- $ref: "#/parameters/rowFilter.itemLedger.batchNumber",
+ $ref: "#/parameters/rowFilter.itemLedger.trackedEntityId",
},
{
$ref: "#/parameters/body.itemLedger",
@@ -31254,75 +31074,6 @@ export default {
tags: ["account"],
},
},
- "/serialNumbers": {
- get: {
- parameters: [
- {
- $ref: "#/parameters/rowFilter.serialNumbers.id",
- },
- {
- $ref: "#/parameters/rowFilter.serialNumbers.number",
- },
- {
- $ref: "#/parameters/rowFilter.serialNumbers.status",
- },
- {
- $ref: "#/parameters/rowFilter.serialNumbers.supplierId",
- },
- {
- $ref: "#/parameters/rowFilter.serialNumbers.companyId",
- },
- {
- $ref: "#/parameters/rowFilter.serialNumbers.itemId",
- },
- {
- $ref: "#/parameters/rowFilter.serialNumbers.source",
- },
- {
- $ref: "#/parameters/rowFilter.serialNumbers.itemName",
- },
- {
- $ref: "#/parameters/rowFilter.serialNumbers.itemReadableId",
- },
- {
- $ref: "#/parameters/select",
- },
- {
- $ref: "#/parameters/order",
- },
- {
- $ref: "#/parameters/range",
- },
- {
- $ref: "#/parameters/rangeUnit",
- },
- {
- $ref: "#/parameters/offset",
- },
- {
- $ref: "#/parameters/limit",
- },
- {
- $ref: "#/parameters/preferCount",
- },
- ],
- responses: {
- "200": {
- description: "OK",
- schema: {
- items: {
- $ref: "#/definitions/serialNumbers",
- },
- type: "array",
- },
- },
- "206": {
- description: "Partial Content",
- },
- },
- tags: ["serialNumbers"],
- },
- },
"/companyIntegration": {
get: {
parameters: [
@@ -31866,6 +31617,12 @@ export default {
{
$ref: "#/parameters/rowFilter.companySettings.rfqReadyNotificationGroup",
},
+ {
+ $ref: "#/parameters/rowFilter.companySettings.productLabelSize",
+ },
+ {
+ $ref: "#/parameters/rowFilter.companySettings.shelfLabelSize",
+ },
{
$ref: "#/parameters/select",
},
@@ -31940,6 +31697,12 @@ export default {
{
$ref: "#/parameters/rowFilter.companySettings.rfqReadyNotificationGroup",
},
+ {
+ $ref: "#/parameters/rowFilter.companySettings.productLabelSize",
+ },
+ {
+ $ref: "#/parameters/rowFilter.companySettings.shelfLabelSize",
+ },
{
$ref: "#/parameters/preferReturn",
},
@@ -31968,6 +31731,12 @@ export default {
{
$ref: "#/parameters/rowFilter.companySettings.rfqReadyNotificationGroup",
},
+ {
+ $ref: "#/parameters/rowFilter.companySettings.productLabelSize",
+ },
+ {
+ $ref: "#/parameters/rowFilter.companySettings.shelfLabelSize",
+ },
{
$ref: "#/parameters/body.companySettings",
},
@@ -32550,56 +32319,38 @@ export default {
tags: ["workCenterProcess"],
},
},
- "/partners": {
+ "/trackedEntity": {
get: {
parameters: [
{
- $ref: "#/parameters/rowFilter.partners.id",
- },
- {
- $ref: "#/parameters/rowFilter.partners.hoursPerWeek",
- },
- {
- $ref: "#/parameters/rowFilter.partners.abilityId",
- },
- {
- $ref: "#/parameters/rowFilter.partners.active",
- },
- {
- $ref: "#/parameters/rowFilter.partners.companyId",
- },
- {
- $ref: "#/parameters/rowFilter.partners.createdBy",
- },
- {
- $ref: "#/parameters/rowFilter.partners.createdAt",
+ $ref: "#/parameters/rowFilter.trackedEntity.id",
},
{
- $ref: "#/parameters/rowFilter.partners.updatedBy",
+ $ref: "#/parameters/rowFilter.trackedEntity.quantity",
},
{
- $ref: "#/parameters/rowFilter.partners.updatedAt",
+ $ref: "#/parameters/rowFilter.trackedEntity.status",
},
{
- $ref: "#/parameters/rowFilter.partners.customFields",
+ $ref: "#/parameters/rowFilter.trackedEntity.sourceDocument",
},
{
- $ref: "#/parameters/rowFilter.partners.supplierLocationId",
+ $ref: "#/parameters/rowFilter.trackedEntity.sourceDocumentId",
},
{
- $ref: "#/parameters/rowFilter.partners.abilityName",
+ $ref: "#/parameters/rowFilter.trackedEntity.sourceDocumentReadableId",
},
{
- $ref: "#/parameters/rowFilter.partners.supplierId",
+ $ref: "#/parameters/rowFilter.trackedEntity.attributes",
},
{
- $ref: "#/parameters/rowFilter.partners.supplierName",
+ $ref: "#/parameters/rowFilter.trackedEntity.companyId",
},
{
- $ref: "#/parameters/rowFilter.partners.city",
+ $ref: "#/parameters/rowFilter.trackedEntity.createdAt",
},
{
- $ref: "#/parameters/rowFilter.partners.state",
+ $ref: "#/parameters/rowFilter.trackedEntity.createdBy",
},
{
$ref: "#/parameters/select",
@@ -32628,7 +32379,7 @@ export default {
description: "OK",
schema: {
items: {
- $ref: "#/definitions/partners",
+ $ref: "#/definitions/trackedEntity",
},
type: "array",
},
@@ -32637,155 +32388,353 @@ export default {
description: "Partial Content",
},
},
- tags: ["partners"],
+ tags: ["trackedEntity"],
},
- },
- "/consumable": {
- get: {
+ post: {
parameters: [
{
- $ref: "#/parameters/rowFilter.consumable.id",
+ $ref: "#/parameters/body.trackedEntity",
},
{
- $ref: "#/parameters/rowFilter.consumable.itemId",
+ $ref: "#/parameters/select",
},
{
- $ref: "#/parameters/rowFilter.consumable.approved",
+ $ref: "#/parameters/preferPost",
+ },
+ ],
+ responses: {
+ "201": {
+ description: "Created",
},
+ },
+ tags: ["trackedEntity"],
+ },
+ delete: {
+ parameters: [
{
- $ref: "#/parameters/rowFilter.consumable.approvedBy",
+ $ref: "#/parameters/rowFilter.trackedEntity.id",
},
{
- $ref: "#/parameters/rowFilter.consumable.customFields",
+ $ref: "#/parameters/rowFilter.trackedEntity.quantity",
},
{
- $ref: "#/parameters/rowFilter.consumable.companyId",
+ $ref: "#/parameters/rowFilter.trackedEntity.status",
},
{
- $ref: "#/parameters/rowFilter.consumable.createdBy",
+ $ref: "#/parameters/rowFilter.trackedEntity.sourceDocument",
},
{
- $ref: "#/parameters/rowFilter.consumable.createdAt",
+ $ref: "#/parameters/rowFilter.trackedEntity.sourceDocumentId",
},
{
- $ref: "#/parameters/rowFilter.consumable.updatedBy",
+ $ref: "#/parameters/rowFilter.trackedEntity.sourceDocumentReadableId",
},
{
- $ref: "#/parameters/rowFilter.consumable.updatedAt",
+ $ref: "#/parameters/rowFilter.trackedEntity.attributes",
},
{
- $ref: "#/parameters/rowFilter.consumable.externalId",
+ $ref: "#/parameters/rowFilter.trackedEntity.companyId",
},
{
- $ref: "#/parameters/rowFilter.consumable.tags",
+ $ref: "#/parameters/rowFilter.trackedEntity.createdAt",
},
{
- $ref: "#/parameters/select",
+ $ref: "#/parameters/rowFilter.trackedEntity.createdBy",
},
{
- $ref: "#/parameters/order",
+ $ref: "#/parameters/preferReturn",
+ },
+ ],
+ responses: {
+ "204": {
+ description: "No Content",
},
+ },
+ tags: ["trackedEntity"],
+ },
+ patch: {
+ parameters: [
{
- $ref: "#/parameters/range",
+ $ref: "#/parameters/rowFilter.trackedEntity.id",
},
{
- $ref: "#/parameters/rangeUnit",
+ $ref: "#/parameters/rowFilter.trackedEntity.quantity",
},
{
- $ref: "#/parameters/offset",
+ $ref: "#/parameters/rowFilter.trackedEntity.status",
},
{
- $ref: "#/parameters/limit",
+ $ref: "#/parameters/rowFilter.trackedEntity.sourceDocument",
},
{
- $ref: "#/parameters/preferCount",
+ $ref: "#/parameters/rowFilter.trackedEntity.sourceDocumentId",
},
- ],
- responses: {
- "200": {
- description: "OK",
- schema: {
- items: {
- $ref: "#/definitions/consumable",
- },
- type: "array",
- },
+ {
+ $ref: "#/parameters/rowFilter.trackedEntity.sourceDocumentReadableId",
},
- "206": {
- description: "Partial Content",
+ {
+ $ref: "#/parameters/rowFilter.trackedEntity.attributes",
},
- },
- tags: ["consumable"],
- },
- post: {
- parameters: [
{
- $ref: "#/parameters/body.consumable",
+ $ref: "#/parameters/rowFilter.trackedEntity.companyId",
},
{
- $ref: "#/parameters/select",
+ $ref: "#/parameters/rowFilter.trackedEntity.createdAt",
},
{
- $ref: "#/parameters/preferPost",
+ $ref: "#/parameters/rowFilter.trackedEntity.createdBy",
+ },
+ {
+ $ref: "#/parameters/body.trackedEntity",
+ },
+ {
+ $ref: "#/parameters/preferReturn",
},
],
responses: {
- "201": {
- description: "Created",
+ "204": {
+ description: "No Content",
},
},
- tags: ["consumable"],
+ tags: ["trackedEntity"],
},
- delete: {
+ },
+ "/partners": {
+ get: {
parameters: [
{
- $ref: "#/parameters/rowFilter.consumable.id",
+ $ref: "#/parameters/rowFilter.partners.id",
},
{
- $ref: "#/parameters/rowFilter.consumable.itemId",
+ $ref: "#/parameters/rowFilter.partners.hoursPerWeek",
},
{
- $ref: "#/parameters/rowFilter.consumable.approved",
+ $ref: "#/parameters/rowFilter.partners.abilityId",
},
{
- $ref: "#/parameters/rowFilter.consumable.approvedBy",
+ $ref: "#/parameters/rowFilter.partners.active",
},
{
- $ref: "#/parameters/rowFilter.consumable.customFields",
+ $ref: "#/parameters/rowFilter.partners.companyId",
},
{
- $ref: "#/parameters/rowFilter.consumable.companyId",
+ $ref: "#/parameters/rowFilter.partners.createdBy",
},
{
- $ref: "#/parameters/rowFilter.consumable.createdBy",
+ $ref: "#/parameters/rowFilter.partners.createdAt",
},
{
- $ref: "#/parameters/rowFilter.consumable.createdAt",
+ $ref: "#/parameters/rowFilter.partners.updatedBy",
},
{
- $ref: "#/parameters/rowFilter.consumable.updatedBy",
+ $ref: "#/parameters/rowFilter.partners.updatedAt",
},
{
- $ref: "#/parameters/rowFilter.consumable.updatedAt",
+ $ref: "#/parameters/rowFilter.partners.customFields",
},
{
- $ref: "#/parameters/rowFilter.consumable.externalId",
+ $ref: "#/parameters/rowFilter.partners.supplierLocationId",
},
{
- $ref: "#/parameters/rowFilter.consumable.tags",
+ $ref: "#/parameters/rowFilter.partners.abilityName",
},
{
- $ref: "#/parameters/preferReturn",
+ $ref: "#/parameters/rowFilter.partners.supplierId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.partners.supplierName",
+ },
+ {
+ $ref: "#/parameters/rowFilter.partners.city",
+ },
+ {
+ $ref: "#/parameters/rowFilter.partners.state",
+ },
+ {
+ $ref: "#/parameters/select",
+ },
+ {
+ $ref: "#/parameters/order",
+ },
+ {
+ $ref: "#/parameters/range",
+ },
+ {
+ $ref: "#/parameters/rangeUnit",
+ },
+ {
+ $ref: "#/parameters/offset",
+ },
+ {
+ $ref: "#/parameters/limit",
+ },
+ {
+ $ref: "#/parameters/preferCount",
},
],
responses: {
- "204": {
- description: "No Content",
+ "200": {
+ description: "OK",
+ schema: {
+ items: {
+ $ref: "#/definitions/partners",
+ },
+ type: "array",
+ },
+ },
+ "206": {
+ description: "Partial Content",
},
},
- tags: ["consumable"],
+ tags: ["partners"],
},
- patch: {
+ },
+ "/consumable": {
+ get: {
+ parameters: [
+ {
+ $ref: "#/parameters/rowFilter.consumable.id",
+ },
+ {
+ $ref: "#/parameters/rowFilter.consumable.itemId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.consumable.approved",
+ },
+ {
+ $ref: "#/parameters/rowFilter.consumable.approvedBy",
+ },
+ {
+ $ref: "#/parameters/rowFilter.consumable.customFields",
+ },
+ {
+ $ref: "#/parameters/rowFilter.consumable.companyId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.consumable.createdBy",
+ },
+ {
+ $ref: "#/parameters/rowFilter.consumable.createdAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.consumable.updatedBy",
+ },
+ {
+ $ref: "#/parameters/rowFilter.consumable.updatedAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.consumable.externalId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.consumable.tags",
+ },
+ {
+ $ref: "#/parameters/select",
+ },
+ {
+ $ref: "#/parameters/order",
+ },
+ {
+ $ref: "#/parameters/range",
+ },
+ {
+ $ref: "#/parameters/rangeUnit",
+ },
+ {
+ $ref: "#/parameters/offset",
+ },
+ {
+ $ref: "#/parameters/limit",
+ },
+ {
+ $ref: "#/parameters/preferCount",
+ },
+ ],
+ responses: {
+ "200": {
+ description: "OK",
+ schema: {
+ items: {
+ $ref: "#/definitions/consumable",
+ },
+ type: "array",
+ },
+ },
+ "206": {
+ description: "Partial Content",
+ },
+ },
+ tags: ["consumable"],
+ },
+ post: {
+ parameters: [
+ {
+ $ref: "#/parameters/body.consumable",
+ },
+ {
+ $ref: "#/parameters/select",
+ },
+ {
+ $ref: "#/parameters/preferPost",
+ },
+ ],
+ responses: {
+ "201": {
+ description: "Created",
+ },
+ },
+ tags: ["consumable"],
+ },
+ delete: {
+ parameters: [
+ {
+ $ref: "#/parameters/rowFilter.consumable.id",
+ },
+ {
+ $ref: "#/parameters/rowFilter.consumable.itemId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.consumable.approved",
+ },
+ {
+ $ref: "#/parameters/rowFilter.consumable.approvedBy",
+ },
+ {
+ $ref: "#/parameters/rowFilter.consumable.customFields",
+ },
+ {
+ $ref: "#/parameters/rowFilter.consumable.companyId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.consumable.createdBy",
+ },
+ {
+ $ref: "#/parameters/rowFilter.consumable.createdAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.consumable.updatedBy",
+ },
+ {
+ $ref: "#/parameters/rowFilter.consumable.updatedAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.consumable.externalId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.consumable.tags",
+ },
+ {
+ $ref: "#/parameters/preferReturn",
+ },
+ ],
+ responses: {
+ "204": {
+ description: "No Content",
+ },
+ },
+ tags: ["consumable"],
+ },
+ patch: {
parameters: [
{
$ref: "#/parameters/rowFilter.consumable.id",
@@ -38388,32 +38337,29 @@ export default {
tags: ["feedback"],
},
},
- "/oauthCode": {
+ "/trackedActivityInput": {
get: {
parameters: [
{
- $ref: "#/parameters/rowFilter.oauthCode.id",
+ $ref: "#/parameters/rowFilter.trackedActivityInput.trackedActivityId",
},
{
- $ref: "#/parameters/rowFilter.oauthCode.code",
+ $ref: "#/parameters/rowFilter.trackedActivityInput.trackedEntityId",
},
{
- $ref: "#/parameters/rowFilter.oauthCode.clientId",
+ $ref: "#/parameters/rowFilter.trackedActivityInput.quantity",
},
{
- $ref: "#/parameters/rowFilter.oauthCode.userId",
+ $ref: "#/parameters/rowFilter.trackedActivityInput.entityType",
},
{
- $ref: "#/parameters/rowFilter.oauthCode.companyId",
- },
- {
- $ref: "#/parameters/rowFilter.oauthCode.redirectUri",
+ $ref: "#/parameters/rowFilter.trackedActivityInput.companyId",
},
{
- $ref: "#/parameters/rowFilter.oauthCode.createdAt",
+ $ref: "#/parameters/rowFilter.trackedActivityInput.createdAt",
},
{
- $ref: "#/parameters/rowFilter.oauthCode.expiresAt",
+ $ref: "#/parameters/rowFilter.trackedActivityInput.createdBy",
},
{
$ref: "#/parameters/select",
@@ -38442,7 +38388,7 @@ export default {
description: "OK",
schema: {
items: {
- $ref: "#/definitions/oauthCode",
+ $ref: "#/definitions/trackedActivityInput",
},
type: "array",
},
@@ -38451,12 +38397,12 @@ export default {
description: "Partial Content",
},
},
- tags: ["oauthCode"],
+ tags: ["trackedActivityInput"],
},
post: {
parameters: [
{
- $ref: "#/parameters/body.oauthCode",
+ $ref: "#/parameters/body.trackedActivityInput",
},
{
$ref: "#/parameters/select",
@@ -38470,33 +38416,30 @@ export default {
description: "Created",
},
},
- tags: ["oauthCode"],
+ tags: ["trackedActivityInput"],
},
delete: {
parameters: [
{
- $ref: "#/parameters/rowFilter.oauthCode.id",
- },
- {
- $ref: "#/parameters/rowFilter.oauthCode.code",
+ $ref: "#/parameters/rowFilter.trackedActivityInput.trackedActivityId",
},
{
- $ref: "#/parameters/rowFilter.oauthCode.clientId",
+ $ref: "#/parameters/rowFilter.trackedActivityInput.trackedEntityId",
},
{
- $ref: "#/parameters/rowFilter.oauthCode.userId",
+ $ref: "#/parameters/rowFilter.trackedActivityInput.quantity",
},
{
- $ref: "#/parameters/rowFilter.oauthCode.companyId",
+ $ref: "#/parameters/rowFilter.trackedActivityInput.entityType",
},
{
- $ref: "#/parameters/rowFilter.oauthCode.redirectUri",
+ $ref: "#/parameters/rowFilter.trackedActivityInput.companyId",
},
{
- $ref: "#/parameters/rowFilter.oauthCode.createdAt",
+ $ref: "#/parameters/rowFilter.trackedActivityInput.createdAt",
},
{
- $ref: "#/parameters/rowFilter.oauthCode.expiresAt",
+ $ref: "#/parameters/rowFilter.trackedActivityInput.createdBy",
},
{
$ref: "#/parameters/preferReturn",
@@ -38507,36 +38450,33 @@ export default {
description: "No Content",
},
},
- tags: ["oauthCode"],
+ tags: ["trackedActivityInput"],
},
patch: {
parameters: [
{
- $ref: "#/parameters/rowFilter.oauthCode.id",
+ $ref: "#/parameters/rowFilter.trackedActivityInput.trackedActivityId",
},
{
- $ref: "#/parameters/rowFilter.oauthCode.code",
+ $ref: "#/parameters/rowFilter.trackedActivityInput.trackedEntityId",
},
{
- $ref: "#/parameters/rowFilter.oauthCode.clientId",
+ $ref: "#/parameters/rowFilter.trackedActivityInput.quantity",
},
{
- $ref: "#/parameters/rowFilter.oauthCode.userId",
+ $ref: "#/parameters/rowFilter.trackedActivityInput.entityType",
},
{
- $ref: "#/parameters/rowFilter.oauthCode.companyId",
- },
- {
- $ref: "#/parameters/rowFilter.oauthCode.redirectUri",
+ $ref: "#/parameters/rowFilter.trackedActivityInput.companyId",
},
{
- $ref: "#/parameters/rowFilter.oauthCode.createdAt",
+ $ref: "#/parameters/rowFilter.trackedActivityInput.createdAt",
},
{
- $ref: "#/parameters/rowFilter.oauthCode.expiresAt",
+ $ref: "#/parameters/rowFilter.trackedActivityInput.createdBy",
},
{
- $ref: "#/parameters/body.oauthCode",
+ $ref: "#/parameters/body.trackedActivityInput",
},
{
$ref: "#/parameters/preferReturn",
@@ -38547,98 +38487,260 @@ export default {
description: "No Content",
},
},
- tags: ["oauthCode"],
+ tags: ["trackedActivityInput"],
},
},
- "/tools": {
+ "/oauthCode": {
get: {
parameters: [
{
- $ref: "#/parameters/rowFilter.tools.active",
- },
- {
- $ref: "#/parameters/rowFilter.tools.assignee",
- },
- {
- $ref: "#/parameters/rowFilter.tools.defaultMethodType",
- },
- {
- $ref: "#/parameters/rowFilter.tools.description",
- },
- {
- $ref: "#/parameters/rowFilter.tools.itemTrackingType",
- },
- {
- $ref: "#/parameters/rowFilter.tools.name",
- },
- {
- $ref: "#/parameters/rowFilter.tools.replenishmentSystem",
- },
- {
- $ref: "#/parameters/rowFilter.tools.unitOfMeasureCode",
- },
- {
- $ref: "#/parameters/rowFilter.tools.notes",
- },
- {
- $ref: "#/parameters/rowFilter.tools.thumbnailPath",
- },
- {
- $ref: "#/parameters/rowFilter.tools.modelId",
- },
- {
- $ref: "#/parameters/rowFilter.tools.autodeskUrn",
- },
- {
- $ref: "#/parameters/rowFilter.tools.modelPath",
- },
- {
- $ref: "#/parameters/rowFilter.tools.modelName",
- },
- {
- $ref: "#/parameters/rowFilter.tools.modelSize",
- },
- {
- $ref: "#/parameters/rowFilter.tools.id",
- },
- {
- $ref: "#/parameters/rowFilter.tools.itemId",
- },
- {
- $ref: "#/parameters/rowFilter.tools.approved",
- },
- {
- $ref: "#/parameters/rowFilter.tools.approvedBy",
- },
- {
- $ref: "#/parameters/rowFilter.tools.customFields",
- },
- {
- $ref: "#/parameters/rowFilter.tools.companyId",
- },
- {
- $ref: "#/parameters/rowFilter.tools.createdBy",
+ $ref: "#/parameters/rowFilter.oauthCode.id",
},
{
- $ref: "#/parameters/rowFilter.tools.createdAt",
+ $ref: "#/parameters/rowFilter.oauthCode.code",
},
{
- $ref: "#/parameters/rowFilter.tools.updatedBy",
+ $ref: "#/parameters/rowFilter.oauthCode.clientId",
},
{
- $ref: "#/parameters/rowFilter.tools.updatedAt",
+ $ref: "#/parameters/rowFilter.oauthCode.userId",
},
{
- $ref: "#/parameters/rowFilter.tools.externalId",
+ $ref: "#/parameters/rowFilter.oauthCode.companyId",
},
{
- $ref: "#/parameters/rowFilter.tools.tags",
+ $ref: "#/parameters/rowFilter.oauthCode.redirectUri",
},
{
- $ref: "#/parameters/rowFilter.tools.supplierIds",
+ $ref: "#/parameters/rowFilter.oauthCode.createdAt",
},
{
- $ref: "#/parameters/rowFilter.tools.unitOfMeasure",
+ $ref: "#/parameters/rowFilter.oauthCode.expiresAt",
+ },
+ {
+ $ref: "#/parameters/select",
+ },
+ {
+ $ref: "#/parameters/order",
+ },
+ {
+ $ref: "#/parameters/range",
+ },
+ {
+ $ref: "#/parameters/rangeUnit",
+ },
+ {
+ $ref: "#/parameters/offset",
+ },
+ {
+ $ref: "#/parameters/limit",
+ },
+ {
+ $ref: "#/parameters/preferCount",
+ },
+ ],
+ responses: {
+ "200": {
+ description: "OK",
+ schema: {
+ items: {
+ $ref: "#/definitions/oauthCode",
+ },
+ type: "array",
+ },
+ },
+ "206": {
+ description: "Partial Content",
+ },
+ },
+ tags: ["oauthCode"],
+ },
+ post: {
+ parameters: [
+ {
+ $ref: "#/parameters/body.oauthCode",
+ },
+ {
+ $ref: "#/parameters/select",
+ },
+ {
+ $ref: "#/parameters/preferPost",
+ },
+ ],
+ responses: {
+ "201": {
+ description: "Created",
+ },
+ },
+ tags: ["oauthCode"],
+ },
+ delete: {
+ parameters: [
+ {
+ $ref: "#/parameters/rowFilter.oauthCode.id",
+ },
+ {
+ $ref: "#/parameters/rowFilter.oauthCode.code",
+ },
+ {
+ $ref: "#/parameters/rowFilter.oauthCode.clientId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.oauthCode.userId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.oauthCode.companyId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.oauthCode.redirectUri",
+ },
+ {
+ $ref: "#/parameters/rowFilter.oauthCode.createdAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.oauthCode.expiresAt",
+ },
+ {
+ $ref: "#/parameters/preferReturn",
+ },
+ ],
+ responses: {
+ "204": {
+ description: "No Content",
+ },
+ },
+ tags: ["oauthCode"],
+ },
+ patch: {
+ parameters: [
+ {
+ $ref: "#/parameters/rowFilter.oauthCode.id",
+ },
+ {
+ $ref: "#/parameters/rowFilter.oauthCode.code",
+ },
+ {
+ $ref: "#/parameters/rowFilter.oauthCode.clientId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.oauthCode.userId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.oauthCode.companyId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.oauthCode.redirectUri",
+ },
+ {
+ $ref: "#/parameters/rowFilter.oauthCode.createdAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.oauthCode.expiresAt",
+ },
+ {
+ $ref: "#/parameters/body.oauthCode",
+ },
+ {
+ $ref: "#/parameters/preferReturn",
+ },
+ ],
+ responses: {
+ "204": {
+ description: "No Content",
+ },
+ },
+ tags: ["oauthCode"],
+ },
+ },
+ "/tools": {
+ get: {
+ parameters: [
+ {
+ $ref: "#/parameters/rowFilter.tools.active",
+ },
+ {
+ $ref: "#/parameters/rowFilter.tools.assignee",
+ },
+ {
+ $ref: "#/parameters/rowFilter.tools.defaultMethodType",
+ },
+ {
+ $ref: "#/parameters/rowFilter.tools.description",
+ },
+ {
+ $ref: "#/parameters/rowFilter.tools.itemTrackingType",
+ },
+ {
+ $ref: "#/parameters/rowFilter.tools.name",
+ },
+ {
+ $ref: "#/parameters/rowFilter.tools.replenishmentSystem",
+ },
+ {
+ $ref: "#/parameters/rowFilter.tools.unitOfMeasureCode",
+ },
+ {
+ $ref: "#/parameters/rowFilter.tools.notes",
+ },
+ {
+ $ref: "#/parameters/rowFilter.tools.thumbnailPath",
+ },
+ {
+ $ref: "#/parameters/rowFilter.tools.modelId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.tools.autodeskUrn",
+ },
+ {
+ $ref: "#/parameters/rowFilter.tools.modelPath",
+ },
+ {
+ $ref: "#/parameters/rowFilter.tools.modelName",
+ },
+ {
+ $ref: "#/parameters/rowFilter.tools.modelSize",
+ },
+ {
+ $ref: "#/parameters/rowFilter.tools.id",
+ },
+ {
+ $ref: "#/parameters/rowFilter.tools.itemId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.tools.approved",
+ },
+ {
+ $ref: "#/parameters/rowFilter.tools.approvedBy",
+ },
+ {
+ $ref: "#/parameters/rowFilter.tools.customFields",
+ },
+ {
+ $ref: "#/parameters/rowFilter.tools.companyId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.tools.createdBy",
+ },
+ {
+ $ref: "#/parameters/rowFilter.tools.createdAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.tools.updatedBy",
+ },
+ {
+ $ref: "#/parameters/rowFilter.tools.updatedAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.tools.externalId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.tools.tags",
+ },
+ {
+ $ref: "#/parameters/rowFilter.tools.supplierIds",
+ },
+ {
+ $ref: "#/parameters/rowFilter.tools.unitOfMeasure",
},
{
$ref: "#/parameters/select",
@@ -39942,38 +40044,38 @@ export default {
tags: ["document"],
},
},
- "/serialNumber": {
+ "/attributeDataType": {
get: {
parameters: [
{
- $ref: "#/parameters/rowFilter.serialNumber.id",
+ $ref: "#/parameters/rowFilter.attributeDataType.id",
},
{
- $ref: "#/parameters/rowFilter.serialNumber.number",
+ $ref: "#/parameters/rowFilter.attributeDataType.label",
},
{
- $ref: "#/parameters/rowFilter.serialNumber.itemId",
+ $ref: "#/parameters/rowFilter.attributeDataType.isBoolean",
},
{
- $ref: "#/parameters/rowFilter.serialNumber.source",
+ $ref: "#/parameters/rowFilter.attributeDataType.isDate",
},
{
- $ref: "#/parameters/rowFilter.serialNumber.supplierId",
+ $ref: "#/parameters/rowFilter.attributeDataType.isList",
},
{
- $ref: "#/parameters/rowFilter.serialNumber.companyId",
+ $ref: "#/parameters/rowFilter.attributeDataType.isNumeric",
},
{
- $ref: "#/parameters/rowFilter.serialNumber.createdAt",
+ $ref: "#/parameters/rowFilter.attributeDataType.isText",
},
{
- $ref: "#/parameters/rowFilter.serialNumber.expirationDate",
+ $ref: "#/parameters/rowFilter.attributeDataType.isUser",
},
{
- $ref: "#/parameters/rowFilter.serialNumber.batchNumberId",
+ $ref: "#/parameters/rowFilter.attributeDataType.isCustomer",
},
{
- $ref: "#/parameters/rowFilter.serialNumber.status",
+ $ref: "#/parameters/rowFilter.attributeDataType.isSupplier",
},
{
$ref: "#/parameters/select",
@@ -40002,7 +40104,7 @@ export default {
description: "OK",
schema: {
items: {
- $ref: "#/definitions/serialNumber",
+ $ref: "#/definitions/attributeDataType",
},
type: "array",
},
@@ -40011,12 +40113,12 @@ export default {
description: "Partial Content",
},
},
- tags: ["serialNumber"],
+ tags: ["attributeDataType"],
},
post: {
parameters: [
{
- $ref: "#/parameters/body.serialNumber",
+ $ref: "#/parameters/body.attributeDataType",
},
{
$ref: "#/parameters/select",
@@ -40030,39 +40132,39 @@ export default {
description: "Created",
},
},
- tags: ["serialNumber"],
+ tags: ["attributeDataType"],
},
delete: {
parameters: [
{
- $ref: "#/parameters/rowFilter.serialNumber.id",
+ $ref: "#/parameters/rowFilter.attributeDataType.id",
},
{
- $ref: "#/parameters/rowFilter.serialNumber.number",
+ $ref: "#/parameters/rowFilter.attributeDataType.label",
},
{
- $ref: "#/parameters/rowFilter.serialNumber.itemId",
+ $ref: "#/parameters/rowFilter.attributeDataType.isBoolean",
},
{
- $ref: "#/parameters/rowFilter.serialNumber.source",
+ $ref: "#/parameters/rowFilter.attributeDataType.isDate",
},
{
- $ref: "#/parameters/rowFilter.serialNumber.supplierId",
+ $ref: "#/parameters/rowFilter.attributeDataType.isList",
},
{
- $ref: "#/parameters/rowFilter.serialNumber.companyId",
+ $ref: "#/parameters/rowFilter.attributeDataType.isNumeric",
},
{
- $ref: "#/parameters/rowFilter.serialNumber.createdAt",
+ $ref: "#/parameters/rowFilter.attributeDataType.isText",
},
{
- $ref: "#/parameters/rowFilter.serialNumber.expirationDate",
+ $ref: "#/parameters/rowFilter.attributeDataType.isUser",
},
{
- $ref: "#/parameters/rowFilter.serialNumber.batchNumberId",
+ $ref: "#/parameters/rowFilter.attributeDataType.isCustomer",
},
{
- $ref: "#/parameters/rowFilter.serialNumber.status",
+ $ref: "#/parameters/rowFilter.attributeDataType.isSupplier",
},
{
$ref: "#/parameters/preferReturn",
@@ -40073,187 +40175,7 @@ export default {
description: "No Content",
},
},
- tags: ["serialNumber"],
- },
- patch: {
- parameters: [
- {
- $ref: "#/parameters/rowFilter.serialNumber.id",
- },
- {
- $ref: "#/parameters/rowFilter.serialNumber.number",
- },
- {
- $ref: "#/parameters/rowFilter.serialNumber.itemId",
- },
- {
- $ref: "#/parameters/rowFilter.serialNumber.source",
- },
- {
- $ref: "#/parameters/rowFilter.serialNumber.supplierId",
- },
- {
- $ref: "#/parameters/rowFilter.serialNumber.companyId",
- },
- {
- $ref: "#/parameters/rowFilter.serialNumber.createdAt",
- },
- {
- $ref: "#/parameters/rowFilter.serialNumber.expirationDate",
- },
- {
- $ref: "#/parameters/rowFilter.serialNumber.batchNumberId",
- },
- {
- $ref: "#/parameters/rowFilter.serialNumber.status",
- },
- {
- $ref: "#/parameters/body.serialNumber",
- },
- {
- $ref: "#/parameters/preferReturn",
- },
- ],
- responses: {
- "204": {
- description: "No Content",
- },
- },
- tags: ["serialNumber"],
- },
- },
- "/attributeDataType": {
- get: {
- parameters: [
- {
- $ref: "#/parameters/rowFilter.attributeDataType.id",
- },
- {
- $ref: "#/parameters/rowFilter.attributeDataType.label",
- },
- {
- $ref: "#/parameters/rowFilter.attributeDataType.isBoolean",
- },
- {
- $ref: "#/parameters/rowFilter.attributeDataType.isDate",
- },
- {
- $ref: "#/parameters/rowFilter.attributeDataType.isList",
- },
- {
- $ref: "#/parameters/rowFilter.attributeDataType.isNumeric",
- },
- {
- $ref: "#/parameters/rowFilter.attributeDataType.isText",
- },
- {
- $ref: "#/parameters/rowFilter.attributeDataType.isUser",
- },
- {
- $ref: "#/parameters/rowFilter.attributeDataType.isCustomer",
- },
- {
- $ref: "#/parameters/rowFilter.attributeDataType.isSupplier",
- },
- {
- $ref: "#/parameters/select",
- },
- {
- $ref: "#/parameters/order",
- },
- {
- $ref: "#/parameters/range",
- },
- {
- $ref: "#/parameters/rangeUnit",
- },
- {
- $ref: "#/parameters/offset",
- },
- {
- $ref: "#/parameters/limit",
- },
- {
- $ref: "#/parameters/preferCount",
- },
- ],
- responses: {
- "200": {
- description: "OK",
- schema: {
- items: {
- $ref: "#/definitions/attributeDataType",
- },
- type: "array",
- },
- },
- "206": {
- description: "Partial Content",
- },
- },
- tags: ["attributeDataType"],
- },
- post: {
- parameters: [
- {
- $ref: "#/parameters/body.attributeDataType",
- },
- {
- $ref: "#/parameters/select",
- },
- {
- $ref: "#/parameters/preferPost",
- },
- ],
- responses: {
- "201": {
- description: "Created",
- },
- },
- tags: ["attributeDataType"],
- },
- delete: {
- parameters: [
- {
- $ref: "#/parameters/rowFilter.attributeDataType.id",
- },
- {
- $ref: "#/parameters/rowFilter.attributeDataType.label",
- },
- {
- $ref: "#/parameters/rowFilter.attributeDataType.isBoolean",
- },
- {
- $ref: "#/parameters/rowFilter.attributeDataType.isDate",
- },
- {
- $ref: "#/parameters/rowFilter.attributeDataType.isList",
- },
- {
- $ref: "#/parameters/rowFilter.attributeDataType.isNumeric",
- },
- {
- $ref: "#/parameters/rowFilter.attributeDataType.isText",
- },
- {
- $ref: "#/parameters/rowFilter.attributeDataType.isUser",
- },
- {
- $ref: "#/parameters/rowFilter.attributeDataType.isCustomer",
- },
- {
- $ref: "#/parameters/rowFilter.attributeDataType.isSupplier",
- },
- {
- $ref: "#/parameters/preferReturn",
- },
- ],
- responses: {
- "204": {
- description: "No Content",
- },
- },
- tags: ["attributeDataType"],
+ tags: ["attributeDataType"],
},
patch: {
parameters: [
@@ -44303,147 +44225,6 @@ export default {
tags: ["(rpc) get_my_permission"],
},
},
- "/rpc/update_shipment_line_batch_tracking": {
- get: {
- parameters: [
- {
- format: "text",
- in: "query",
- name: "p_shipment_line_id",
- required: true,
- type: "string",
- },
- {
- format: "text",
- in: "query",
- name: "p_shipment_id",
- required: true,
- type: "string",
- },
- {
- format: "text",
- in: "query",
- name: "p_batch_number",
- required: true,
- type: "string",
- },
- {
- format: "text",
- in: "query",
- name: "p_batch_id",
- required: true,
- type: "string",
- },
- {
- format: "date",
- in: "query",
- name: "p_manufacturing_date",
- required: true,
- type: "string",
- },
- {
- format: "date",
- in: "query",
- name: "p_expiration_date",
- required: true,
- type: "string",
- },
- {
- format: "numeric",
- in: "query",
- name: "p_quantity",
- required: true,
- type: "number",
- },
- {
- format: "jsonb",
- in: "query",
- name: "p_properties",
- required: false,
- type: "string",
- },
- ],
- produces: [
- "application/json",
- "application/vnd.pgrst.object+json;nulls=stripped",
- "application/vnd.pgrst.object+json",
- ],
- responses: {
- "200": {
- description: "OK",
- },
- },
- tags: ["(rpc) update_shipment_line_batch_tracking"],
- },
- post: {
- parameters: [
- {
- in: "body",
- name: "args",
- required: true,
- schema: {
- properties: {
- p_batch_id: {
- format: "text",
- type: "string",
- },
- p_batch_number: {
- format: "text",
- type: "string",
- },
- p_expiration_date: {
- format: "date",
- type: "string",
- },
- p_manufacturing_date: {
- format: "date",
- type: "string",
- },
- p_properties: {
- format: "jsonb",
- },
- p_quantity: {
- format: "numeric",
- type: "number",
- },
- p_shipment_id: {
- format: "text",
- type: "string",
- },
- p_shipment_line_id: {
- format: "text",
- type: "string",
- },
- },
- required: [
- "p_shipment_line_id",
- "p_shipment_id",
- "p_batch_number",
- "p_batch_id",
- "p_manufacturing_date",
- "p_expiration_date",
- "p_quantity",
- ],
- type: "object",
- },
- },
- {
- $ref: "#/parameters/preferParams",
- },
- ],
- produces: [
- "application/json",
- "application/vnd.pgrst.object+json;nulls=stripped",
- "application/vnd.pgrst.object+json",
- ],
- responses: {
- "200": {
- description: "OK",
- },
- },
- tags: ["(rpc) update_shipment_line_batch_tracking"],
- },
- },
"/rpc/get_next_sequence": {
get: {
parameters: [
@@ -44618,240 +44399,7 @@ export default {
description: "OK",
},
},
- tags: ["(rpc) get_job_quantity_on_hand"],
- },
- post: {
- parameters: [
- {
- in: "body",
- name: "args",
- required: true,
- schema: {
- properties: {
- company_id: {
- format: "text",
- type: "string",
- },
- job_id: {
- format: "text",
- type: "string",
- },
- location_id: {
- format: "text",
- type: "string",
- },
- },
- required: ["job_id", "company_id", "location_id"],
- type: "object",
- },
- },
- {
- $ref: "#/parameters/preferParams",
- },
- ],
- produces: [
- "application/json",
- "application/vnd.pgrst.object+json;nulls=stripped",
- "application/vnd.pgrst.object+json",
- ],
- responses: {
- "200": {
- description: "OK",
- },
- },
- tags: ["(rpc) get_job_quantity_on_hand"],
- },
- },
- "/rpc/get_companies_with_employee_role": {
- get: {
- produces: [
- "application/json",
- "application/vnd.pgrst.object+json;nulls=stripped",
- "application/vnd.pgrst.object+json",
- ],
- responses: {
- "200": {
- description: "OK",
- },
- },
- tags: ["(rpc) get_companies_with_employee_role"],
- },
- post: {
- parameters: [
- {
- in: "body",
- name: "args",
- required: true,
- schema: {
- type: "object",
- },
- },
- {
- $ref: "#/parameters/preferParams",
- },
- ],
- produces: [
- "application/json",
- "application/vnd.pgrst.object+json;nulls=stripped",
- "application/vnd.pgrst.object+json",
- ],
- responses: {
- "200": {
- description: "OK",
- },
- },
- tags: ["(rpc) get_companies_with_employee_role"],
- },
- },
- "/rpc/jsonb_to_text_array": {
- get: {
- parameters: [
- {
- format: "jsonb",
- in: "query",
- name: "",
- required: true,
- type: "string",
- },
- ],
- produces: [
- "application/json",
- "application/vnd.pgrst.object+json;nulls=stripped",
- "application/vnd.pgrst.object+json",
- ],
- responses: {
- "200": {
- description: "OK",
- },
- },
- tags: ["(rpc) jsonb_to_text_array"],
- },
- post: {
- parameters: [
- {
- in: "body",
- name: "args",
- required: true,
- schema: {
- properties: {
- "": {
- format: "jsonb",
- },
- },
- required: [""],
- type: "object",
- },
- },
- {
- $ref: "#/parameters/preferParams",
- },
- ],
- produces: [
- "application/json",
- "application/vnd.pgrst.object+json;nulls=stripped",
- "application/vnd.pgrst.object+json",
- ],
- responses: {
- "200": {
- description: "OK",
- },
- },
- tags: ["(rpc) jsonb_to_text_array"],
- },
- },
- "/rpc/xid_machine": {
- get: {
- parameters: [
- {
- format: "public.xid",
- in: "query",
- name: "_xid",
- required: true,
- type: "string",
- },
- ],
- produces: [
- "application/json",
- "application/vnd.pgrst.object+json;nulls=stripped",
- "application/vnd.pgrst.object+json",
- ],
- responses: {
- "200": {
- description: "OK",
- },
- },
- tags: ["(rpc) xid_machine"],
- },
- post: {
- parameters: [
- {
- in: "body",
- name: "args",
- required: true,
- schema: {
- properties: {
- _xid: {
- format: "public.xid",
- type: "string",
- },
- },
- required: ["_xid"],
- type: "object",
- },
- },
- {
- $ref: "#/parameters/preferParams",
- },
- ],
- produces: [
- "application/json",
- "application/vnd.pgrst.object+json;nulls=stripped",
- "application/vnd.pgrst.object+json",
- ],
- responses: {
- "200": {
- description: "OK",
- },
- },
- tags: ["(rpc) xid_machine"],
- },
- },
- "/rpc/get_item_quantities_by_shelf_batch_serial": {
- get: {
- parameters: [
- {
- format: "text",
- in: "query",
- name: "item_id",
- required: true,
- type: "string",
- },
- {
- format: "text",
- in: "query",
- name: "company_id",
- required: true,
- type: "string",
- },
- {
- format: "text",
- in: "query",
- name: "location_id",
- required: true,
- type: "string",
- },
- ],
- produces: [
- "application/json",
- "application/vnd.pgrst.object+json;nulls=stripped",
- "application/vnd.pgrst.object+json",
- ],
- responses: {
- "200": {
- description: "OK",
- },
- },
- tags: ["(rpc) get_item_quantities_by_shelf_batch_serial"],
+ tags: ["(rpc) get_job_quantity_on_hand"],
},
post: {
parameters: [
@@ -44865,7 +44413,7 @@ export default {
format: "text",
type: "string",
},
- item_id: {
+ job_id: {
format: "text",
type: "string",
},
@@ -44874,7 +44422,7 @@ export default {
type: "string",
},
},
- required: ["item_id", "company_id", "location_id"],
+ required: ["job_id", "company_id", "location_id"],
type: "object",
},
},
@@ -44892,30 +44440,113 @@ export default {
description: "OK",
},
},
- tags: ["(rpc) get_item_quantities_by_shelf_batch_serial"],
+ tags: ["(rpc) get_job_quantity_on_hand"],
},
},
- "/rpc/get_custom_field_unique_values": {
+ "/rpc/get_companies_with_employee_role": {
get: {
+ produces: [
+ "application/json",
+ "application/vnd.pgrst.object+json;nulls=stripped",
+ "application/vnd.pgrst.object+json",
+ ],
+ responses: {
+ "200": {
+ description: "OK",
+ },
+ },
+ tags: ["(rpc) get_companies_with_employee_role"],
+ },
+ post: {
parameters: [
{
- format: "text",
- in: "query",
- name: "table_name",
+ in: "body",
+ name: "args",
required: true,
- type: "string",
+ schema: {
+ type: "object",
+ },
},
{
- format: "text",
+ $ref: "#/parameters/preferParams",
+ },
+ ],
+ produces: [
+ "application/json",
+ "application/vnd.pgrst.object+json;nulls=stripped",
+ "application/vnd.pgrst.object+json",
+ ],
+ responses: {
+ "200": {
+ description: "OK",
+ },
+ },
+ tags: ["(rpc) get_companies_with_employee_role"],
+ },
+ },
+ "/rpc/jsonb_to_text_array": {
+ get: {
+ parameters: [
+ {
+ format: "jsonb",
in: "query",
- name: "field_key",
+ name: "",
required: true,
type: "string",
},
+ ],
+ produces: [
+ "application/json",
+ "application/vnd.pgrst.object+json;nulls=stripped",
+ "application/vnd.pgrst.object+json",
+ ],
+ responses: {
+ "200": {
+ description: "OK",
+ },
+ },
+ tags: ["(rpc) jsonb_to_text_array"],
+ },
+ post: {
+ parameters: [
{
- format: "text",
+ in: "body",
+ name: "args",
+ required: true,
+ schema: {
+ properties: {
+ "": {
+ format: "jsonb",
+ },
+ },
+ required: [""],
+ type: "object",
+ },
+ },
+ {
+ $ref: "#/parameters/preferParams",
+ },
+ ],
+ produces: [
+ "application/json",
+ "application/vnd.pgrst.object+json;nulls=stripped",
+ "application/vnd.pgrst.object+json",
+ ],
+ responses: {
+ "200": {
+ description: "OK",
+ },
+ },
+ tags: ["(rpc) jsonb_to_text_array"],
+ },
+ },
+ "/rpc/xid_machine": {
+ get: {
+ parameters: [
+ {
+ format: "public.xid",
in: "query",
- name: "company_id",
+ name: "_xid",
required: true,
type: "string",
},
@@ -44930,7 +44561,7 @@ export default {
description: "OK",
},
},
- tags: ["(rpc) get_custom_field_unique_values"],
+ tags: ["(rpc) xid_machine"],
},
post: {
parameters: [
@@ -44940,20 +44571,12 @@ export default {
required: true,
schema: {
properties: {
- company_id: {
- format: "text",
- type: "string",
- },
- field_key: {
- format: "text",
- type: "string",
- },
- table_name: {
- format: "text",
+ _xid: {
+ format: "public.xid",
type: "string",
},
},
- required: ["table_name", "field_key", "company_id"],
+ required: ["_xid"],
type: "object",
},
},
@@ -44971,23 +44594,30 @@ export default {
description: "OK",
},
},
- tags: ["(rpc) get_custom_field_unique_values"],
+ tags: ["(rpc) xid_machine"],
},
},
- "/rpc/has_role": {
+ "/rpc/get_custom_field_unique_values": {
get: {
parameters: [
{
format: "text",
in: "query",
- name: "required_role",
+ name: "table_name",
required: true,
type: "string",
},
{
format: "text",
in: "query",
- name: "company",
+ name: "field_key",
+ required: true,
+ type: "string",
+ },
+ {
+ format: "text",
+ in: "query",
+ name: "company_id",
required: true,
type: "string",
},
@@ -45002,7 +44632,7 @@ export default {
description: "OK",
},
},
- tags: ["(rpc) has_role"],
+ tags: ["(rpc) get_custom_field_unique_values"],
},
post: {
parameters: [
@@ -45012,16 +44642,20 @@ export default {
required: true,
schema: {
properties: {
- company: {
+ company_id: {
format: "text",
type: "string",
},
- required_role: {
+ field_key: {
+ format: "text",
+ type: "string",
+ },
+ table_name: {
format: "text",
type: "string",
},
},
- required: ["required_role", "company"],
+ required: ["table_name", "field_key", "company_id"],
type: "object",
},
},
@@ -45039,16 +44673,23 @@ export default {
description: "OK",
},
},
- tags: ["(rpc) has_role"],
+ tags: ["(rpc) get_custom_field_unique_values"],
},
},
- "/rpc/has_any_company_permission": {
+ "/rpc/has_role": {
get: {
parameters: [
{
format: "text",
in: "query",
- name: "claim",
+ name: "required_role",
+ required: true,
+ type: "string",
+ },
+ {
+ format: "text",
+ in: "query",
+ name: "company",
required: true,
type: "string",
},
@@ -45063,7 +44704,7 @@ export default {
description: "OK",
},
},
- tags: ["(rpc) has_any_company_permission"],
+ tags: ["(rpc) has_role"],
},
post: {
parameters: [
@@ -45073,12 +44714,16 @@ export default {
required: true,
schema: {
properties: {
- claim: {
+ company: {
+ format: "text",
+ type: "string",
+ },
+ required_role: {
format: "text",
type: "string",
},
},
- required: ["claim"],
+ required: ["required_role", "company"],
type: "object",
},
},
@@ -45096,40 +44741,19 @@ export default {
description: "OK",
},
},
- tags: ["(rpc) has_any_company_permission"],
+ tags: ["(rpc) has_role"],
},
},
- "/rpc/update_shipment_line_serial_tracking": {
+ "/rpc/has_any_company_permission": {
get: {
parameters: [
{
format: "text",
in: "query",
- name: "p_shipment_line_id",
- required: true,
- type: "string",
- },
- {
- format: "text",
- in: "query",
- name: "p_shipment_id",
- required: true,
- type: "string",
- },
- {
- format: "text",
- in: "query",
- name: "p_serial_number_id",
+ name: "claim",
required: true,
type: "string",
},
- {
- format: "integer",
- in: "query",
- name: "p_index",
- required: true,
- type: "integer",
- },
],
produces: [
"application/json",
@@ -45141,7 +44765,7 @@ export default {
description: "OK",
},
},
- tags: ["(rpc) update_shipment_line_serial_tracking"],
+ tags: ["(rpc) has_any_company_permission"],
},
post: {
parameters: [
@@ -45151,29 +44775,12 @@ export default {
required: true,
schema: {
properties: {
- p_index: {
- format: "integer",
- type: "integer",
- },
- p_serial_number_id: {
- format: "text",
- type: "string",
- },
- p_shipment_id: {
- format: "text",
- type: "string",
- },
- p_shipment_line_id: {
+ claim: {
format: "text",
type: "string",
},
},
- required: [
- "p_shipment_line_id",
- "p_shipment_id",
- "p_serial_number_id",
- "p_index",
- ],
+ required: ["claim"],
type: "object",
},
},
@@ -45191,7 +44798,7 @@ export default {
description: "OK",
},
},
- tags: ["(rpc) update_shipment_line_serial_tracking"],
+ tags: ["(rpc) has_any_company_permission"],
},
},
"/rpc/get_job_operation_by_id": {
@@ -45575,6 +45182,13 @@ export default {
required: true,
type: "integer",
},
+ {
+ format: "text",
+ in: "query",
+ name: "p_tracked_entity_id",
+ required: false,
+ type: "string",
+ },
],
produces: [
"application/json",
@@ -45612,6 +45226,10 @@ export default {
format: "text",
type: "string",
},
+ p_tracked_entity_id: {
+ format: "text",
+ type: "string",
+ },
},
required: [
"p_receipt_line_id",
@@ -45664,33 +45282,19 @@ export default {
type: "string",
},
{
- format: "text",
- in: "query",
- name: "p_batch_id",
- required: true,
- type: "string",
- },
- {
- format: "date",
+ format: "numeric",
in: "query",
- name: "p_manufacturing_date",
+ name: "p_quantity",
required: true,
- type: "string",
+ type: "number",
},
{
- format: "date",
+ format: "text",
in: "query",
- name: "p_expiration_date",
- required: true,
+ name: "p_tracked_entity_id",
+ required: false,
type: "string",
},
- {
- format: "numeric",
- in: "query",
- name: "p_quantity",
- required: true,
- type: "number",
- },
{
format: "jsonb",
in: "query",
@@ -45719,22 +45323,10 @@ export default {
required: true,
schema: {
properties: {
- p_batch_id: {
- format: "text",
- type: "string",
- },
p_batch_number: {
format: "text",
type: "string",
},
- p_expiration_date: {
- format: "date",
- type: "string",
- },
- p_manufacturing_date: {
- format: "date",
- type: "string",
- },
p_properties: {
format: "jsonb",
},
@@ -45750,14 +45342,15 @@ export default {
format: "text",
type: "string",
},
+ p_tracked_entity_id: {
+ format: "text",
+ type: "string",
+ },
},
required: [
"p_receipt_line_id",
"p_receipt_id",
"p_batch_number",
- "p_batch_id",
- "p_manufacturing_date",
- "p_expiration_date",
"p_quantity",
],
type: "object",
@@ -46478,11 +46071,75 @@ export default {
description: "OK",
},
},
- tags: ["(rpc) get_company_id_from_api_key"],
+ tags: ["(rpc) get_company_id_from_api_key"],
+ },
+ },
+ "/rpc/get_companies_with_any_role": {
+ get: {
+ produces: [
+ "application/json",
+ "application/vnd.pgrst.object+json;nulls=stripped",
+ "application/vnd.pgrst.object+json",
+ ],
+ responses: {
+ "200": {
+ description: "OK",
+ },
+ },
+ tags: ["(rpc) get_companies_with_any_role"],
+ },
+ post: {
+ parameters: [
+ {
+ in: "body",
+ name: "args",
+ required: true,
+ schema: {
+ type: "object",
+ },
+ },
+ {
+ $ref: "#/parameters/preferParams",
+ },
+ ],
+ produces: [
+ "application/json",
+ "application/vnd.pgrst.object+json;nulls=stripped",
+ "application/vnd.pgrst.object+json",
+ ],
+ responses: {
+ "200": {
+ description: "OK",
+ },
+ },
+ tags: ["(rpc) get_companies_with_any_role"],
},
},
- "/rpc/get_companies_with_any_role": {
+ "/rpc/get_item_quantities_by_tracking_id": {
get: {
+ parameters: [
+ {
+ format: "text",
+ in: "query",
+ name: "item_id",
+ required: true,
+ type: "string",
+ },
+ {
+ format: "text",
+ in: "query",
+ name: "company_id",
+ required: true,
+ type: "string",
+ },
+ {
+ format: "text",
+ in: "query",
+ name: "location_id",
+ required: true,
+ type: "string",
+ },
+ ],
produces: [
"application/json",
"application/vnd.pgrst.object+json;nulls=stripped",
@@ -46493,7 +46150,7 @@ export default {
description: "OK",
},
},
- tags: ["(rpc) get_companies_with_any_role"],
+ tags: ["(rpc) get_item_quantities_by_tracking_id"],
},
post: {
parameters: [
@@ -46502,6 +46159,21 @@ export default {
name: "args",
required: true,
schema: {
+ properties: {
+ company_id: {
+ format: "text",
+ type: "string",
+ },
+ item_id: {
+ format: "text",
+ type: "string",
+ },
+ location_id: {
+ format: "text",
+ type: "string",
+ },
+ },
+ required: ["item_id", "company_id", "location_id"],
type: "object",
},
},
@@ -46519,7 +46191,7 @@ export default {
description: "OK",
},
},
- tags: ["(rpc) get_companies_with_any_role"],
+ tags: ["(rpc) get_item_quantities_by_tracking_id"],
},
},
"/rpc/is_claims_admin": {
@@ -49220,70 +48892,6 @@ export default {
},
type: "object",
},
- batchNumber: {
- required: ["id", "number", "itemId", "source", "companyId", "createdAt"],
- properties: {
- id: {
- default: "public.xid()",
- format: "text",
- type: "string",
- },
- number: {
- description: "Note:\nThis is a Primary Key.<pk/>",
- format: "text",
- type: "string",
- },
- itemId: {
- description:
- "Note:\nThis is a Primary Key.<pk/>\nThis is a Foreign Key to `item.id`.<fk table='item' column='id'/>",
- format: "text",
- type: "string",
- },
- source: {
- default: "Purchased",
- enum: ["Purchased", "Manufactured"],
- format: 'public."trackingSource"',
- type: "string",
- },
- companyId: {
- description:
- "Note:\nThis is a Foreign Key to `company.id`.<fk table='company' column='id'/>",
- format: "text",
- type: "string",
- },
- supplierId: {
- format: "text",
- type: "string",
- },
- manufacturingDate: {
- format: "date",
- type: "string",
- },
- expirationDate: {
- format: "date",
- type: "string",
- },
- notes: {
- format: "json",
- },
- properties: {
- format: "jsonb",
- },
- createdAt: {
- default: "now()",
- format: "timestamp with time zone",
- type: "string",
- },
- createdBy: {
- default: "auth.uid()",
- description:
- "Note:\nThis is a Foreign Key to `user.id`.<fk table='user' column='id'/>",
- format: "text",
- type: "string",
- },
- },
- type: "object",
- },
methodMaterial: {
required: [
"id",
@@ -49563,96 +49171,6 @@ export default {
},
type: "object",
},
- itemTracking: {
- required: [
- "id",
- "sourceDocument",
- "sourceDocumentId",
- "itemId",
- "quantity",
- "index",
- "posted",
- "companyId",
- "createdAt",
- ],
- properties: {
- id: {
- default: "public.xid()",
- description: "Note:\nThis is a Primary Key.<pk/>",
- format: "text",
- type: "string",
- },
- sourceDocument: {
- enum: ["Receipt", "Job Production", "Job Material", "Shipment"],
- format: 'public."itemTrackingSourceDocument"',
- type: "string",
- },
- sourceDocumentId: {
- format: "text",
- type: "string",
- },
- sourceDocumentLineId: {
- format: "text",
- type: "string",
- },
- sourceDocumentReadableId: {
- format: "text",
- type: "string",
- },
- itemId: {
- description:
- "Note:\nThis is a Foreign Key to `item.id`.<fk table='item' column='id'/>",
- format: "text",
- type: "string",
- },
- serialNumberId: {
- description:
- "Note:\nThis is a Foreign Key to `serialNumber.id`.<fk table='serialNumber' column='id'/>",
- format: "text",
- type: "string",
- },
- batchNumberId: {
- description:
- "Note:\nThis is a Foreign Key to `batchNumber.id`.<fk table='batchNumber' column='id'/>",
- format: "text",
- type: "string",
- },
- quantity: {
- default: 1,
- format: "numeric",
- type: "number",
- },
- index: {
- default: 0,
- format: "integer",
- type: "integer",
- },
- posted: {
- default: false,
- format: "boolean",
- type: "boolean",
- },
- companyId: {
- description:
- "Note:\nThis is a Foreign Key to `company.id`.<fk table='company' column='id'/>",
- format: "text",
- type: "string",
- },
- createdAt: {
- default: "now()",
- format: "timestamp with time zone",
- type: "string",
- },
- createdBy: {
- default: "auth.uid()",
- description:
- "Note:\nThis is a Foreign Key to `user.id`.<fk table='user' column='id'/>",
- format: "text",
- type: "string",
- },
- },
- type: "object",
- },
quoteMaterial: {
required: [
"id",
@@ -53740,57 +53258,6 @@ export default {
},
type: "object",
},
- batchNumbers: {
- properties: {
- id: {
- format: "text",
- type: "string",
- },
- number: {
- description: "Note:\nThis is a Primary Key.<pk/>",
- format: "text",
- type: "string",
- },
- manufacturingDate: {
- format: "date",
- type: "string",
- },
- expirationDate: {
- format: "date",
- type: "string",
- },
- supplierId: {
- format: "text",
- type: "string",
- },
- companyId: {
- description:
- "Note:\nThis is a Foreign Key to `company.id`.<fk table='company' column='id'/>",
- format: "text",
- type: "string",
- },
- itemId: {
- description:
- "Note:\nThis is a Primary Key.<pk/>\nThis is a Foreign Key to `item.id`.<fk table='item' column='id'/>",
- format: "text",
- type: "string",
- },
- source: {
- enum: ["Purchased", "Manufactured"],
- format: 'public."trackingSource"',
- type: "string",
- },
- itemName: {
- format: "text",
- type: "string",
- },
- itemReadableId: {
- format: "text",
- type: "string",
- },
- },
- type: "object",
- },
purchaseOrderLine: {
required: [
"id",
@@ -54382,6 +53849,52 @@ export default {
},
type: "object",
},
+ trackedActivityOutput: {
+ required: [
+ "trackedActivityId",
+ "trackedEntityId",
+ "quantity",
+ "companyId",
+ "createdAt",
+ "createdBy",
+ ],
+ properties: {
+ trackedActivityId: {
+ description:
+ "Note:\nThis is a Primary Key.<pk/>\nThis is a Foreign Key to `trackedActivity.id`.<fk table='trackedActivity' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ trackedEntityId: {
+ description:
+ "Note:\nThis is a Primary Key.<pk/>\nThis is a Foreign Key to `trackedEntity.id`.<fk table='trackedEntity' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ quantity: {
+ format: "numeric",
+ type: "number",
+ },
+ companyId: {
+ description:
+ "Note:\nThis is a Foreign Key to `company.id`.<fk table='company' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ createdAt: {
+ default: "now()",
+ format: "timestamp with time zone",
+ type: "string",
+ },
+ createdBy: {
+ description:
+ "Note:\nThis is a Foreign Key to `user.id`.<fk table='user' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ },
+ type: "object",
+ },
purchaseInvoiceLines: {
properties: {
id: {
@@ -55238,6 +54751,61 @@ export default {
},
type: "object",
},
+ trackedActivity: {
+ required: [
+ "id",
+ "type",
+ "attributes",
+ "companyId",
+ "createdAt",
+ "createdBy",
+ ],
+ properties: {
+ id: {
+ default: "public.xid()",
+ description: "Note:\nThis is a Primary Key.<pk/>",
+ format: "text",
+ type: "string",
+ },
+ type: {
+ format: "text",
+ type: "string",
+ },
+ sourceDocument: {
+ format: "text",
+ type: "string",
+ },
+ sourceDocumentId: {
+ format: "text",
+ type: "string",
+ },
+ sourceDocumentReadableId: {
+ format: "text",
+ type: "string",
+ },
+ attributes: {
+ format: "jsonb",
+ },
+ companyId: {
+ description:
+ "Note:\nThis is a Foreign Key to `company.id`.<fk table='company' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ createdAt: {
+ default: "now()",
+ format: "timestamp with time zone",
+ type: "string",
+ },
+ createdBy: {
+ description:
+ "Note:\nThis is a Foreign Key to `user.id`.<fk table='user' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ },
+ type: "object",
+ },
consumables: {
properties: {
active: {
@@ -60892,11 +60460,9 @@ export default {
format: "text",
type: "string",
},
- serialNumber: {
- format: "text",
- type: "string",
- },
- batchNumber: {
+ trackedEntityId: {
+ description:
+ "Note:\nThis is a Foreign Key to `trackedEntity.id`.<fk table='trackedEntity' column='id'/>",
format: "text",
type: "string",
},
@@ -61912,54 +61478,6 @@ export default {
},
type: "object",
},
- serialNumbers: {
- properties: {
- id: {
- format: "text",
- type: "string",
- },
- number: {
- description: "Note:\nThis is a Primary Key.<pk/>",
- format: "text",
- type: "string",
- },
- status: {
- enum: ["Available", "Reserved", "Consumed"],
- format: 'public."serialStatus"',
- type: "string",
- },
- supplierId: {
- format: "text",
- type: "string",
- },
- companyId: {
- description:
- "Note:\nThis is a Foreign Key to `company.id`.<fk table='company' column='id'/>",
- format: "text",
- type: "string",
- },
- itemId: {
- description:
- "Note:\nThis is a Primary Key.<pk/>\nThis is a Foreign Key to `item.id`.<fk table='item' column='id'/>",
- format: "text",
- type: "string",
- },
- source: {
- enum: ["Purchased", "Manufactured"],
- format: 'public."trackingSource"',
- type: "string",
- },
- itemName: {
- format: "text",
- type: "string",
- },
- itemReadableId: {
- format: "text",
- type: "string",
- },
- },
- type: "object",
- },
companyIntegration: {
required: ["id", "metadata", "companyId", "active", "updatedAt"],
properties: {
@@ -62284,6 +61802,16 @@ export default {
},
type: "array",
},
+ productLabelSize: {
+ default: "avery5160",
+ format: "text",
+ type: "string",
+ },
+ shelfLabelSize: {
+ default: "avery5160",
+ format: "text",
+ type: "string",
+ },
},
type: "object",
},
@@ -62450,6 +61978,70 @@ export default {
},
type: "object",
},
+ trackedEntity: {
+ required: [
+ "id",
+ "quantity",
+ "status",
+ "sourceDocument",
+ "sourceDocumentId",
+ "attributes",
+ "companyId",
+ "createdAt",
+ "createdBy",
+ ],
+ properties: {
+ id: {
+ default: "public.xid()",
+ description: "Note:\nThis is a Primary Key.<pk/>",
+ format: "text",
+ type: "string",
+ },
+ quantity: {
+ format: "numeric",
+ type: "number",
+ },
+ status: {
+ default: "Available",
+ enum: ["Available", "Reserved", "On Hold", "Consumed"],
+ format: 'public."trackedEntityStatus"',
+ type: "string",
+ },
+ sourceDocument: {
+ format: "text",
+ type: "string",
+ },
+ sourceDocumentId: {
+ format: "text",
+ type: "string",
+ },
+ sourceDocumentReadableId: {
+ format: "text",
+ type: "string",
+ },
+ attributes: {
+ format: "jsonb",
+ },
+ companyId: {
+ description:
+ "Note:\nThis is a Foreign Key to `company.id`.<fk table='company' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ createdAt: {
+ default: "now()",
+ format: "timestamp with time zone",
+ type: "string",
+ },
+ createdBy: {
+ description:
+ "Note:\nThis is a Foreign Key to `user.id`.<fk table='user' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ },
+ type: "object",
+ },
partners: {
properties: {
id: {
@@ -64882,6 +64474,57 @@ export default {
},
type: "object",
},
+ trackedActivityInput: {
+ required: [
+ "trackedActivityId",
+ "trackedEntityId",
+ "quantity",
+ "entityType",
+ "companyId",
+ "createdAt",
+ "createdBy",
+ ],
+ properties: {
+ trackedActivityId: {
+ description:
+ "Note:\nThis is a Primary Key.<pk/>\nThis is a Foreign Key to `trackedActivity.id`.<fk table='trackedActivity' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ trackedEntityId: {
+ description:
+ "Note:\nThis is a Primary Key.<pk/>\nThis is a Foreign Key to `trackedEntity.id`.<fk table='trackedEntity' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ quantity: {
+ format: "numeric",
+ type: "number",
+ },
+ entityType: {
+ format: "text",
+ type: "string",
+ },
+ companyId: {
+ description:
+ "Note:\nThis is a Foreign Key to `company.id`.<fk table='company' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ createdAt: {
+ default: "now()",
+ format: "timestamp with time zone",
+ type: "string",
+ },
+ createdBy: {
+ description:
+ "Note:\nThis is a Foreign Key to `user.id`.<fk table='user' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ },
+ type: "object",
+ },
oauthCode: {
required: [
"id",
@@ -65940,73 +65583,6 @@ export default {
},
type: "object",
},
- serialNumber: {
- required: [
- "id",
- "number",
- "itemId",
- "source",
- "companyId",
- "createdAt",
- "status",
- ],
- properties: {
- id: {
- default: "public.xid()",
- format: "text",
- type: "string",
- },
- number: {
- description: "Note:\nThis is a Primary Key.<pk/>",
- format: "text",
- type: "string",
- },
- itemId: {
- description:
- "Note:\nThis is a Primary Key.<pk/>\nThis is a Foreign Key to `item.id`.<fk table='item' column='id'/>",
- format: "text",
- type: "string",
- },
- source: {
- default: "Purchased",
- enum: ["Purchased", "Manufactured"],
- format: 'public."trackingSource"',
- type: "string",
- },
- supplierId: {
- format: "text",
- type: "string",
- },
- companyId: {
- description:
- "Note:\nThis is a Foreign Key to `company.id`.<fk table='company' column='id'/>",
- format: "text",
- type: "string",
- },
- createdAt: {
- default: "now()",
- format: "timestamp with time zone",
- type: "string",
- },
- expirationDate: {
- format: "date",
- type: "string",
- },
- batchNumberId: {
- description:
- "Note:\nThis is a Foreign Key to `batchNumber.id`.<fk table='batchNumber' column='id'/>",
- format: "text",
- type: "string",
- },
- status: {
- default: "Available",
- enum: ["Available", "Reserved", "Consumed"],
- format: 'public."serialStatus"',
- type: "string",
- },
- },
- type: "object",
- },
attributeDataType: {
required: [
"id",
@@ -69916,99 +69492,6 @@ export default {
in: "query",
type: "string",
},
- "body.batchNumber": {
- name: "batchNumber",
- description: "batchNumber",
- required: false,
- in: "body",
- schema: {
- $ref: "#/definitions/batchNumber",
- },
- },
- "rowFilter.batchNumber.id": {
- name: "id",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
- "rowFilter.batchNumber.number": {
- name: "number",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
- "rowFilter.batchNumber.itemId": {
- name: "itemId",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
- "rowFilter.batchNumber.source": {
- name: "source",
- required: false,
- format: 'public."trackingSource"',
- in: "query",
- type: "string",
- },
- "rowFilter.batchNumber.companyId": {
- name: "companyId",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
- "rowFilter.batchNumber.supplierId": {
- name: "supplierId",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
- "rowFilter.batchNumber.manufacturingDate": {
- name: "manufacturingDate",
- required: false,
- format: "date",
- in: "query",
- type: "string",
- },
- "rowFilter.batchNumber.expirationDate": {
- name: "expirationDate",
- required: false,
- format: "date",
- in: "query",
- type: "string",
- },
- "rowFilter.batchNumber.notes": {
- name: "notes",
- required: false,
- format: "json",
- in: "query",
- type: "string",
- },
- "rowFilter.batchNumber.properties": {
- name: "properties",
- required: false,
- format: "jsonb",
- in: "query",
- type: "string",
- },
- "rowFilter.batchNumber.createdAt": {
- name: "createdAt",
- required: false,
- format: "timestamp with time zone",
- in: "query",
- type: "string",
- },
- "rowFilter.batchNumber.createdBy": {
- name: "createdBy",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
"body.methodMaterial": {
name: "methodMaterial",
description: "methodMaterial",
@@ -70337,113 +69820,6 @@ export default {
in: "query",
type: "string",
},
- "body.itemTracking": {
- name: "itemTracking",
- description: "itemTracking",
- required: false,
- in: "body",
- schema: {
- $ref: "#/definitions/itemTracking",
- },
- },
- "rowFilter.itemTracking.id": {
- name: "id",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
- "rowFilter.itemTracking.sourceDocument": {
- name: "sourceDocument",
- required: false,
- format: 'public."itemTrackingSourceDocument"',
- in: "query",
- type: "string",
- },
- "rowFilter.itemTracking.sourceDocumentId": {
- name: "sourceDocumentId",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
- "rowFilter.itemTracking.sourceDocumentLineId": {
- name: "sourceDocumentLineId",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
- "rowFilter.itemTracking.sourceDocumentReadableId": {
- name: "sourceDocumentReadableId",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
- "rowFilter.itemTracking.itemId": {
- name: "itemId",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
- "rowFilter.itemTracking.serialNumberId": {
- name: "serialNumberId",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
- "rowFilter.itemTracking.batchNumberId": {
- name: "batchNumberId",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
- "rowFilter.itemTracking.quantity": {
- name: "quantity",
- required: false,
- format: "numeric",
- in: "query",
- type: "string",
- },
- "rowFilter.itemTracking.index": {
- name: "index",
- required: false,
- format: "integer",
- in: "query",
- type: "string",
- },
- "rowFilter.itemTracking.posted": {
- name: "posted",
- required: false,
- format: "boolean",
- in: "query",
- type: "string",
- },
- "rowFilter.itemTracking.companyId": {
- name: "companyId",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
- "rowFilter.itemTracking.createdAt": {
- name: "createdAt",
- required: false,
- format: "timestamp with time zone",
- in: "query",
- type: "string",
- },
- "rowFilter.itemTracking.createdBy": {
- name: "createdBy",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
"body.quoteMaterial": {
name: "quoteMaterial",
description: "quoteMaterial",
@@ -75662,85 +75038,6 @@ export default {
in: "query",
type: "string",
},
- "body.batchNumbers": {
- name: "batchNumbers",
- description: "batchNumbers",
- required: false,
- in: "body",
- schema: {
- $ref: "#/definitions/batchNumbers",
- },
- },
- "rowFilter.batchNumbers.id": {
- name: "id",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
- "rowFilter.batchNumbers.number": {
- name: "number",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
- "rowFilter.batchNumbers.manufacturingDate": {
- name: "manufacturingDate",
- required: false,
- format: "date",
- in: "query",
- type: "string",
- },
- "rowFilter.batchNumbers.expirationDate": {
- name: "expirationDate",
- required: false,
- format: "date",
- in: "query",
- type: "string",
- },
- "rowFilter.batchNumbers.supplierId": {
- name: "supplierId",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
- "rowFilter.batchNumbers.companyId": {
- name: "companyId",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
- "rowFilter.batchNumbers.itemId": {
- name: "itemId",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
- "rowFilter.batchNumbers.source": {
- name: "source",
- required: false,
- format: 'public."trackingSource"',
- in: "query",
- type: "string",
- },
- "rowFilter.batchNumbers.itemName": {
- name: "itemName",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
- "rowFilter.batchNumbers.itemReadableId": {
- name: "itemReadableId",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
"body.purchaseOrderLine": {
name: "purchaseOrderLine",
description: "purchaseOrderLine",
@@ -76535,6 +75832,57 @@ export default {
in: "query",
type: "string",
},
+ "body.trackedActivityOutput": {
+ name: "trackedActivityOutput",
+ description: "trackedActivityOutput",
+ required: false,
+ in: "body",
+ schema: {
+ $ref: "#/definitions/trackedActivityOutput",
+ },
+ },
+ "rowFilter.trackedActivityOutput.trackedActivityId": {
+ name: "trackedActivityId",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.trackedActivityOutput.trackedEntityId": {
+ name: "trackedEntityId",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.trackedActivityOutput.quantity": {
+ name: "quantity",
+ required: false,
+ format: "numeric",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.trackedActivityOutput.companyId": {
+ name: "companyId",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.trackedActivityOutput.createdAt": {
+ name: "createdAt",
+ required: false,
+ format: "timestamp with time zone",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.trackedActivityOutput.createdBy": {
+ name: "createdBy",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
"body.purchaseInvoiceLines": {
name: "purchaseInvoiceLines",
description: "purchaseInvoiceLines",
@@ -77666,6 +77014,78 @@ export default {
in: "query",
type: "string",
},
+ "body.trackedActivity": {
+ name: "trackedActivity",
+ description: "trackedActivity",
+ required: false,
+ in: "body",
+ schema: {
+ $ref: "#/definitions/trackedActivity",
+ },
+ },
+ "rowFilter.trackedActivity.id": {
+ name: "id",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.trackedActivity.type": {
+ name: "type",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.trackedActivity.sourceDocument": {
+ name: "sourceDocument",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.trackedActivity.sourceDocumentId": {
+ name: "sourceDocumentId",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.trackedActivity.sourceDocumentReadableId": {
+ name: "sourceDocumentReadableId",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.trackedActivity.attributes": {
+ name: "attributes",
+ required: false,
+ format: "jsonb",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.trackedActivity.companyId": {
+ name: "companyId",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.trackedActivity.createdAt": {
+ name: "createdAt",
+ required: false,
+ format: "timestamp with time zone",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.trackedActivity.createdBy": {
+ name: "createdBy",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
"body.consumables": {
name: "consumables",
description: "consumables",
@@ -85074,15 +84494,8 @@ export default {
in: "query",
type: "string",
},
- "rowFilter.itemLedger.serialNumber": {
- name: "serialNumber",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
- "rowFilter.itemLedger.batchNumber": {
- name: "batchNumber",
+ "rowFilter.itemLedger.trackedEntityId": {
+ name: "trackedEntityId",
required: false,
format: "text",
in: "query",
@@ -86383,78 +85796,6 @@ export default {
in: "query",
type: "string",
},
- "body.serialNumbers": {
- name: "serialNumbers",
- description: "serialNumbers",
- required: false,
- in: "body",
- schema: {
- $ref: "#/definitions/serialNumbers",
- },
- },
- "rowFilter.serialNumbers.id": {
- name: "id",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
- "rowFilter.serialNumbers.number": {
- name: "number",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
- "rowFilter.serialNumbers.status": {
- name: "status",
- required: false,
- format: 'public."serialStatus"',
- in: "query",
- type: "string",
- },
- "rowFilter.serialNumbers.supplierId": {
- name: "supplierId",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
- "rowFilter.serialNumbers.companyId": {
- name: "companyId",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
- "rowFilter.serialNumbers.itemId": {
- name: "itemId",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
- "rowFilter.serialNumbers.source": {
- name: "source",
- required: false,
- format: 'public."trackingSource"',
- in: "query",
- type: "string",
- },
- "rowFilter.serialNumbers.itemName": {
- name: "itemName",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
- "rowFilter.serialNumbers.itemReadableId": {
- name: "itemReadableId",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
"body.companyIntegration": {
name: "companyIntegration",
description: "companyIntegration",
@@ -86897,6 +86238,20 @@ export default {
in: "query",
type: "string",
},
+ "rowFilter.companySettings.productLabelSize": {
+ name: "productLabelSize",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.companySettings.shelfLabelSize": {
+ name: "shelfLabelSize",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
"body.jobFavorite": {
name: "jobFavorite",
description: "jobFavorite",
@@ -87094,6 +86449,85 @@ export default {
in: "query",
type: "string",
},
+ "body.trackedEntity": {
+ name: "trackedEntity",
+ description: "trackedEntity",
+ required: false,
+ in: "body",
+ schema: {
+ $ref: "#/definitions/trackedEntity",
+ },
+ },
+ "rowFilter.trackedEntity.id": {
+ name: "id",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.trackedEntity.quantity": {
+ name: "quantity",
+ required: false,
+ format: "numeric",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.trackedEntity.status": {
+ name: "status",
+ required: false,
+ format: 'public."trackedEntityStatus"',
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.trackedEntity.sourceDocument": {
+ name: "sourceDocument",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.trackedEntity.sourceDocumentId": {
+ name: "sourceDocumentId",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.trackedEntity.sourceDocumentReadableId": {
+ name: "sourceDocumentReadableId",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.trackedEntity.attributes": {
+ name: "attributes",
+ required: false,
+ format: "jsonb",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.trackedEntity.companyId": {
+ name: "companyId",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.trackedEntity.createdAt": {
+ name: "createdAt",
+ required: false,
+ format: "timestamp with time zone",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.trackedEntity.createdBy": {
+ name: "createdBy",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
"body.partners": {
name: "partners",
description: "partners",
@@ -90242,6 +89676,64 @@ export default {
in: "query",
type: "string",
},
+ "body.trackedActivityInput": {
+ name: "trackedActivityInput",
+ description: "trackedActivityInput",
+ required: false,
+ in: "body",
+ schema: {
+ $ref: "#/definitions/trackedActivityInput",
+ },
+ },
+ "rowFilter.trackedActivityInput.trackedActivityId": {
+ name: "trackedActivityId",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.trackedActivityInput.trackedEntityId": {
+ name: "trackedEntityId",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.trackedActivityInput.quantity": {
+ name: "quantity",
+ required: false,
+ format: "numeric",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.trackedActivityInput.entityType": {
+ name: "entityType",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.trackedActivityInput.companyId": {
+ name: "companyId",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.trackedActivityInput.createdAt": {
+ name: "createdAt",
+ required: false,
+ format: "timestamp with time zone",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.trackedActivityInput.createdBy": {
+ name: "createdBy",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
"body.oauthCode": {
name: "oauthCode",
description: "oauthCode",
@@ -91676,85 +91168,6 @@ export default {
in: "query",
type: "string",
},
- "body.serialNumber": {
- name: "serialNumber",
- description: "serialNumber",
- required: false,
- in: "body",
- schema: {
- $ref: "#/definitions/serialNumber",
- },
- },
- "rowFilter.serialNumber.id": {
- name: "id",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
- "rowFilter.serialNumber.number": {
- name: "number",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
- "rowFilter.serialNumber.itemId": {
- name: "itemId",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
- "rowFilter.serialNumber.source": {
- name: "source",
- required: false,
- format: 'public."trackingSource"',
- in: "query",
- type: "string",
- },
- "rowFilter.serialNumber.supplierId": {
- name: "supplierId",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
- "rowFilter.serialNumber.companyId": {
- name: "companyId",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
- "rowFilter.serialNumber.createdAt": {
- name: "createdAt",
- required: false,
- format: "timestamp with time zone",
- in: "query",
- type: "string",
- },
- "rowFilter.serialNumber.expirationDate": {
- name: "expirationDate",
- required: false,
- format: "date",
- in: "query",
- type: "string",
- },
- "rowFilter.serialNumber.batchNumberId": {
- name: "batchNumberId",
- required: false,
- format: "text",
- in: "query",
- type: "string",
- },
- "rowFilter.serialNumber.status": {
- name: "status",
- required: false,
- format: 'public."serialStatus"',
- in: "query",
- type: "string",
- },
"body.attributeDataType": {
name: "attributeDataType",
description: "attributeDataType",
diff --git a/packages/database/src/types.ts b/packages/database/src/types.ts
index 60393fbda1..0c7a2d661a 100644
--- a/packages/database/src/types.ts
+++ b/packages/database/src/types.ts
@@ -2064,21 +2064,27 @@ export type Database = {
digitalQuoteIncludesPurchaseOrders: boolean
digitalQuoteNotificationGroup: string[]
id: string
+ productLabelSize: string | null
rfqReadyNotificationGroup: string[]
+ shelfLabelSize: string | null
}
Insert: {
digitalQuoteEnabled?: boolean
digitalQuoteIncludesPurchaseOrders?: boolean
digitalQuoteNotificationGroup?: string[]
id: string
+ productLabelSize?: string | null
rfqReadyNotificationGroup?: string[]
+ shelfLabelSize?: string | null
}
Update: {
digitalQuoteEnabled?: boolean
digitalQuoteIncludesPurchaseOrders?: boolean
digitalQuoteNotificationGroup?: string[]
id?: string
+ productLabelSize?: string | null
rfqReadyNotificationGroup?: string[]
+ shelfLabelSize?: string | null
}
Relationships: [
{
@@ -6795,6 +6801,7 @@ export type Database = {
postingDate: string
quantity: number
shelfId: string | null
+ trackedEntityId: string | null
}
Insert: {
companyId: string
@@ -6815,6 +6822,7 @@ export type Database = {
postingDate?: string
quantity: number
shelfId?: string | null
+ trackedEntityId?: string | null
}
Update: {
companyId?: string
@@ -6835,6 +6843,7 @@ export type Database = {
postingDate?: string
quantity?: number
shelfId?: string | null
+ trackedEntityId?: string | null
}
Relationships: [
{
@@ -6893,6 +6902,13 @@ export type Database = {
referencedRelation: "shelf"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "itemLedger_trackedEntityId_fkey"
+ columns: ["trackedEntityId"]
+ isOneToOne: false
+ referencedRelation: "trackedEntity"
+ referencedColumns: ["id"]
+ },
{
foreignKeyName: "partLeger_companyId_fkey"
columns: ["companyId"]
@@ -26008,6 +26024,7 @@ export type Database = {
}
trackedActivity: {
Row: {
+ attributes: Json
companyId: string
createdAt: string
createdBy: string
@@ -26018,6 +26035,7 @@ export type Database = {
type: string
}
Insert: {
+ attributes?: Json
companyId: string
createdAt?: string
createdBy: string
@@ -26028,6 +26046,7 @@ export type Database = {
type: string
}
Update: {
+ attributes?: Json
companyId?: string
createdAt?: string
createdBy?: string
@@ -26103,110 +26122,6 @@ export type Database = {
},
]
}
- trackedActivityAttribute: {
- Row: {
- booleanValue: boolean | null
- companyId: string
- createdAt: string
- createdBy: string
- name: string
- numericValue: number | null
- textValue: string | null
- trackedActivityId: string
- }
- Insert: {
- booleanValue?: boolean | null
- companyId: string
- createdAt?: string
- createdBy: string
- name: string
- numericValue?: number | null
- textValue?: string | null
- trackedActivityId: string
- }
- Update: {
- booleanValue?: boolean | null
- companyId?: string
- createdAt?: string
- createdBy?: string
- name?: string
- numericValue?: number | null
- textValue?: string | null
- trackedActivityId?: string
- }
- Relationships: [
- {
- foreignKeyName: "trackedActivityAttribute_companyId_fkey"
- columns: ["companyId"]
- isOneToOne: false
- referencedRelation: "companies"
- referencedColumns: ["id"]
- },
- {
- foreignKeyName: "trackedActivityAttribute_companyId_fkey"
- columns: ["companyId"]
- isOneToOne: false
- referencedRelation: "company"
- referencedColumns: ["id"]
- },
- {
- foreignKeyName: "trackedActivityAttribute_companyId_fkey"
- columns: ["companyId"]
- isOneToOne: false
- referencedRelation: "customFieldTables"
- referencedColumns: ["companyId"]
- },
- {
- foreignKeyName: "trackedActivityAttribute_companyId_fkey"
- columns: ["companyId"]
- isOneToOne: false
- referencedRelation: "integrations"
- referencedColumns: ["companyId"]
- },
- {
- foreignKeyName: "trackedActivityAttribute_createdBy_fkey"
- columns: ["createdBy"]
- isOneToOne: false
- referencedRelation: "employees"
- referencedColumns: ["id"]
- },
- {
- foreignKeyName: "trackedActivityAttribute_createdBy_fkey"
- columns: ["createdBy"]
- isOneToOne: false
- referencedRelation: "employeesAcrossCompanies"
- referencedColumns: ["id"]
- },
- {
- foreignKeyName: "trackedActivityAttribute_createdBy_fkey"
- columns: ["createdBy"]
- isOneToOne: false
- referencedRelation: "employeeSummary"
- referencedColumns: ["id"]
- },
- {
- foreignKeyName: "trackedActivityAttribute_createdBy_fkey"
- columns: ["createdBy"]
- isOneToOne: false
- referencedRelation: "user"
- referencedColumns: ["id"]
- },
- {
- foreignKeyName: "trackedActivityAttribute_createdBy_fkey"
- columns: ["createdBy"]
- isOneToOne: false
- referencedRelation: "userDefaults"
- referencedColumns: ["userId"]
- },
- {
- foreignKeyName: "trackedActivityAttribute_trackedActivityId_fkey"
- columns: ["trackedActivityId"]
- isOneToOne: false
- referencedRelation: "trackedActivity"
- referencedColumns: ["id"]
- },
- ]
- }
trackedActivityInput: {
Row: {
companyId: string
@@ -26422,6 +26337,7 @@ export type Database = {
}
trackedEntity: {
Row: {
+ attributes: Json
companyId: string
createdAt: string
createdBy: string
@@ -26430,8 +26346,10 @@ export type Database = {
sourceDocument: string
sourceDocumentId: string
sourceDocumentReadableId: string | null
+ status: Database["public"]["Enums"]["trackedEntityStatus"]
}
Insert: {
+ attributes?: Json
companyId: string
createdAt?: string
createdBy: string
@@ -26440,8 +26358,10 @@ export type Database = {
sourceDocument: string
sourceDocumentId: string
sourceDocumentReadableId?: string | null
+ status?: Database["public"]["Enums"]["trackedEntityStatus"]
}
Update: {
+ attributes?: Json
companyId?: string
createdAt?: string
createdBy?: string
@@ -26450,6 +26370,7 @@ export type Database = {
sourceDocument?: string
sourceDocumentId?: string
sourceDocumentReadableId?: string | null
+ status?: Database["public"]["Enums"]["trackedEntityStatus"]
}
Relationships: [
{
@@ -26517,110 +26438,6 @@ export type Database = {
},
]
}
- trackedEntityAttribute: {
- Row: {
- booleanValue: boolean | null
- companyId: string
- createdAt: string
- createdBy: string
- name: string
- numericValue: number | null
- textValue: string | null
- trackedEntityId: string
- }
- Insert: {
- booleanValue?: boolean | null
- companyId: string
- createdAt?: string
- createdBy: string
- name: string
- numericValue?: number | null
- textValue?: string | null
- trackedEntityId: string
- }
- Update: {
- booleanValue?: boolean | null
- companyId?: string
- createdAt?: string
- createdBy?: string
- name?: string
- numericValue?: number | null
- textValue?: string | null
- trackedEntityId?: string
- }
- Relationships: [
- {
- foreignKeyName: "trackedEntityAttribute_companyId_fkey"
- columns: ["companyId"]
- isOneToOne: false
- referencedRelation: "companies"
- referencedColumns: ["id"]
- },
- {
- foreignKeyName: "trackedEntityAttribute_companyId_fkey"
- columns: ["companyId"]
- isOneToOne: false
- referencedRelation: "company"
- referencedColumns: ["id"]
- },
- {
- foreignKeyName: "trackedEntityAttribute_companyId_fkey"
- columns: ["companyId"]
- isOneToOne: false
- referencedRelation: "customFieldTables"
- referencedColumns: ["companyId"]
- },
- {
- foreignKeyName: "trackedEntityAttribute_companyId_fkey"
- columns: ["companyId"]
- isOneToOne: false
- referencedRelation: "integrations"
- referencedColumns: ["companyId"]
- },
- {
- foreignKeyName: "trackedEntityAttribute_createdBy_fkey"
- columns: ["createdBy"]
- isOneToOne: false
- referencedRelation: "employees"
- referencedColumns: ["id"]
- },
- {
- foreignKeyName: "trackedEntityAttribute_createdBy_fkey"
- columns: ["createdBy"]
- isOneToOne: false
- referencedRelation: "employeesAcrossCompanies"
- referencedColumns: ["id"]
- },
- {
- foreignKeyName: "trackedEntityAttribute_createdBy_fkey"
- columns: ["createdBy"]
- isOneToOne: false
- referencedRelation: "employeeSummary"
- referencedColumns: ["id"]
- },
- {
- foreignKeyName: "trackedEntityAttribute_createdBy_fkey"
- columns: ["createdBy"]
- isOneToOne: false
- referencedRelation: "user"
- referencedColumns: ["id"]
- },
- {
- foreignKeyName: "trackedEntityAttribute_createdBy_fkey"
- columns: ["createdBy"]
- isOneToOne: false
- referencedRelation: "userDefaults"
- referencedColumns: ["userId"]
- },
- {
- foreignKeyName: "trackedEntityAttribute_trackedEntityId_fkey"
- columns: ["trackedEntityId"]
- isOneToOne: false
- referencedRelation: "trackedEntity"
- referencedColumns: ["id"]
- },
- ]
- }
unitOfMeasure: {
Row: {
active: boolean
@@ -33488,14 +33305,14 @@ export type Database = {
Relationships: [
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["customerCountryCode"]
+ columns: ["paymentCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
},
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["paymentCountryCode"]
+ columns: ["customerCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
@@ -36701,7 +36518,6 @@ export type Database = {
| "Consumable"
| "Material"
| "Fixture"
- serialStatus: "Available" | "Reserved" | "Consumed"
serviceType: "Internal" | "External"
shipmentSourceDocument:
| "Sales Order"
@@ -36723,6 +36539,7 @@ export type Database = {
| "Refund"
supplierQuoteStatus: "Active" | "Expired"
tableViewType: "Public" | "Private"
+ trackedEntityStatus: "Available" | "Reserved" | "On Hold" | "Consumed"
trackingSource: "Purchased" | "Manufactured"
}
CompositeTypes: {
diff --git a/packages/database/supabase/functions/create-inventory-document/index.ts b/packages/database/supabase/functions/create-inventory-document/index.ts
index 7a67519694..063eb6e1a0 100644
--- a/packages/database/supabase/functions/create-inventory-document/index.ts
+++ b/packages/database/supabase/functions/create-inventory-document/index.ts
@@ -343,25 +343,35 @@ serve(async (req: Request) => {
companyId
);
- const [receiptLine] = await Promise.all([
+ const [receiptLine, trackedEntities] = await Promise.all([
client
.from("receiptLine")
.select("*")
.eq("id", receiptLineId)
.single(),
+ client
+ .from("trackedEntity")
+ .select("*")
+ .eq("attributes->> Receipt Line", receiptLineId),
]);
- if (!receiptLine.data) throw new Error("Shipment line not found");
+ console.log({
+ trackedEntities,
+ });
+
+ if (!receiptLine.data) throw new Error("Receipt line not found");
await db.transaction().execute(async (trx) => {
const { id, ...data } = receiptLine.data;
- if (receiptLine.data.requiresSerialTracking) {
+ if (
+ receiptLine.data.requiresSerialTracking &&
+ trackedEntities.data?.length
+ ) {
+ // TODO: update the Receipt Line and Index attributes to point to the new line
await trx
- .deleteFrom("itemTracking")
- .where("sourceDocument", "=", "Receipt")
- .where("sourceDocumentId", "=", receiptId)
- .where("sourceDocumentLineId", "=", receiptLineId)
+ .deleteFrom("trackedEntity")
+ .where("id", "in", trackedEntities.data?.map((d) => d.id) ?? [])
.execute();
}
@@ -894,12 +904,17 @@ serve(async (req: Request) => {
companyId
);
- const [shipmentLine] = await Promise.all([
+ const [shipmentLine, trackedEntities] = await Promise.all([
client
.from("shipmentLine")
.select("*")
.eq("id", shipmentLineId)
.single(),
+ client
+ .from("trackedEntity")
+ .select("*, trackedEntityAttribute(*)")
+ .eq("trackedEntityAttribute.name", "Shipment Line")
+ .eq("trackedEntityAttribute.textValue", shipmentLineId),
]);
if (!shipmentLine.data) throw new Error("Shipment line not found");
@@ -908,11 +923,10 @@ serve(async (req: Request) => {
const { id, ...data } = shipmentLine.data;
if (shipmentLine.data.requiresSerialTracking) {
+ // TODO: update the Shipment Line and Index attributes to point to the new line
await trx
- .deleteFrom("itemTracking")
- .where("sourceDocument", "=", "Shipment")
- .where("sourceDocumentId", "=", shipmentId)
- .where("sourceDocumentLineId", "=", shipmentLineId)
+ .deleteFrom("trackedEntity")
+ .where("id", "in", trackedEntities.data?.map((d) => d.id) ?? [])
.execute();
}
diff --git a/packages/database/supabase/functions/lib/types.ts b/packages/database/supabase/functions/lib/types.ts
index 60393fbda1..0c7a2d661a 100644
--- a/packages/database/supabase/functions/lib/types.ts
+++ b/packages/database/supabase/functions/lib/types.ts
@@ -2064,21 +2064,27 @@ export type Database = {
digitalQuoteIncludesPurchaseOrders: boolean
digitalQuoteNotificationGroup: string[]
id: string
+ productLabelSize: string | null
rfqReadyNotificationGroup: string[]
+ shelfLabelSize: string | null
}
Insert: {
digitalQuoteEnabled?: boolean
digitalQuoteIncludesPurchaseOrders?: boolean
digitalQuoteNotificationGroup?: string[]
id: string
+ productLabelSize?: string | null
rfqReadyNotificationGroup?: string[]
+ shelfLabelSize?: string | null
}
Update: {
digitalQuoteEnabled?: boolean
digitalQuoteIncludesPurchaseOrders?: boolean
digitalQuoteNotificationGroup?: string[]
id?: string
+ productLabelSize?: string | null
rfqReadyNotificationGroup?: string[]
+ shelfLabelSize?: string | null
}
Relationships: [
{
@@ -6795,6 +6801,7 @@ export type Database = {
postingDate: string
quantity: number
shelfId: string | null
+ trackedEntityId: string | null
}
Insert: {
companyId: string
@@ -6815,6 +6822,7 @@ export type Database = {
postingDate?: string
quantity: number
shelfId?: string | null
+ trackedEntityId?: string | null
}
Update: {
companyId?: string
@@ -6835,6 +6843,7 @@ export type Database = {
postingDate?: string
quantity?: number
shelfId?: string | null
+ trackedEntityId?: string | null
}
Relationships: [
{
@@ -6893,6 +6902,13 @@ export type Database = {
referencedRelation: "shelf"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "itemLedger_trackedEntityId_fkey"
+ columns: ["trackedEntityId"]
+ isOneToOne: false
+ referencedRelation: "trackedEntity"
+ referencedColumns: ["id"]
+ },
{
foreignKeyName: "partLeger_companyId_fkey"
columns: ["companyId"]
@@ -26008,6 +26024,7 @@ export type Database = {
}
trackedActivity: {
Row: {
+ attributes: Json
companyId: string
createdAt: string
createdBy: string
@@ -26018,6 +26035,7 @@ export type Database = {
type: string
}
Insert: {
+ attributes?: Json
companyId: string
createdAt?: string
createdBy: string
@@ -26028,6 +26046,7 @@ export type Database = {
type: string
}
Update: {
+ attributes?: Json
companyId?: string
createdAt?: string
createdBy?: string
@@ -26103,110 +26122,6 @@ export type Database = {
},
]
}
- trackedActivityAttribute: {
- Row: {
- booleanValue: boolean | null
- companyId: string
- createdAt: string
- createdBy: string
- name: string
- numericValue: number | null
- textValue: string | null
- trackedActivityId: string
- }
- Insert: {
- booleanValue?: boolean | null
- companyId: string
- createdAt?: string
- createdBy: string
- name: string
- numericValue?: number | null
- textValue?: string | null
- trackedActivityId: string
- }
- Update: {
- booleanValue?: boolean | null
- companyId?: string
- createdAt?: string
- createdBy?: string
- name?: string
- numericValue?: number | null
- textValue?: string | null
- trackedActivityId?: string
- }
- Relationships: [
- {
- foreignKeyName: "trackedActivityAttribute_companyId_fkey"
- columns: ["companyId"]
- isOneToOne: false
- referencedRelation: "companies"
- referencedColumns: ["id"]
- },
- {
- foreignKeyName: "trackedActivityAttribute_companyId_fkey"
- columns: ["companyId"]
- isOneToOne: false
- referencedRelation: "company"
- referencedColumns: ["id"]
- },
- {
- foreignKeyName: "trackedActivityAttribute_companyId_fkey"
- columns: ["companyId"]
- isOneToOne: false
- referencedRelation: "customFieldTables"
- referencedColumns: ["companyId"]
- },
- {
- foreignKeyName: "trackedActivityAttribute_companyId_fkey"
- columns: ["companyId"]
- isOneToOne: false
- referencedRelation: "integrations"
- referencedColumns: ["companyId"]
- },
- {
- foreignKeyName: "trackedActivityAttribute_createdBy_fkey"
- columns: ["createdBy"]
- isOneToOne: false
- referencedRelation: "employees"
- referencedColumns: ["id"]
- },
- {
- foreignKeyName: "trackedActivityAttribute_createdBy_fkey"
- columns: ["createdBy"]
- isOneToOne: false
- referencedRelation: "employeesAcrossCompanies"
- referencedColumns: ["id"]
- },
- {
- foreignKeyName: "trackedActivityAttribute_createdBy_fkey"
- columns: ["createdBy"]
- isOneToOne: false
- referencedRelation: "employeeSummary"
- referencedColumns: ["id"]
- },
- {
- foreignKeyName: "trackedActivityAttribute_createdBy_fkey"
- columns: ["createdBy"]
- isOneToOne: false
- referencedRelation: "user"
- referencedColumns: ["id"]
- },
- {
- foreignKeyName: "trackedActivityAttribute_createdBy_fkey"
- columns: ["createdBy"]
- isOneToOne: false
- referencedRelation: "userDefaults"
- referencedColumns: ["userId"]
- },
- {
- foreignKeyName: "trackedActivityAttribute_trackedActivityId_fkey"
- columns: ["trackedActivityId"]
- isOneToOne: false
- referencedRelation: "trackedActivity"
- referencedColumns: ["id"]
- },
- ]
- }
trackedActivityInput: {
Row: {
companyId: string
@@ -26422,6 +26337,7 @@ export type Database = {
}
trackedEntity: {
Row: {
+ attributes: Json
companyId: string
createdAt: string
createdBy: string
@@ -26430,8 +26346,10 @@ export type Database = {
sourceDocument: string
sourceDocumentId: string
sourceDocumentReadableId: string | null
+ status: Database["public"]["Enums"]["trackedEntityStatus"]
}
Insert: {
+ attributes?: Json
companyId: string
createdAt?: string
createdBy: string
@@ -26440,8 +26358,10 @@ export type Database = {
sourceDocument: string
sourceDocumentId: string
sourceDocumentReadableId?: string | null
+ status?: Database["public"]["Enums"]["trackedEntityStatus"]
}
Update: {
+ attributes?: Json
companyId?: string
createdAt?: string
createdBy?: string
@@ -26450,6 +26370,7 @@ export type Database = {
sourceDocument?: string
sourceDocumentId?: string
sourceDocumentReadableId?: string | null
+ status?: Database["public"]["Enums"]["trackedEntityStatus"]
}
Relationships: [
{
@@ -26517,110 +26438,6 @@ export type Database = {
},
]
}
- trackedEntityAttribute: {
- Row: {
- booleanValue: boolean | null
- companyId: string
- createdAt: string
- createdBy: string
- name: string
- numericValue: number | null
- textValue: string | null
- trackedEntityId: string
- }
- Insert: {
- booleanValue?: boolean | null
- companyId: string
- createdAt?: string
- createdBy: string
- name: string
- numericValue?: number | null
- textValue?: string | null
- trackedEntityId: string
- }
- Update: {
- booleanValue?: boolean | null
- companyId?: string
- createdAt?: string
- createdBy?: string
- name?: string
- numericValue?: number | null
- textValue?: string | null
- trackedEntityId?: string
- }
- Relationships: [
- {
- foreignKeyName: "trackedEntityAttribute_companyId_fkey"
- columns: ["companyId"]
- isOneToOne: false
- referencedRelation: "companies"
- referencedColumns: ["id"]
- },
- {
- foreignKeyName: "trackedEntityAttribute_companyId_fkey"
- columns: ["companyId"]
- isOneToOne: false
- referencedRelation: "company"
- referencedColumns: ["id"]
- },
- {
- foreignKeyName: "trackedEntityAttribute_companyId_fkey"
- columns: ["companyId"]
- isOneToOne: false
- referencedRelation: "customFieldTables"
- referencedColumns: ["companyId"]
- },
- {
- foreignKeyName: "trackedEntityAttribute_companyId_fkey"
- columns: ["companyId"]
- isOneToOne: false
- referencedRelation: "integrations"
- referencedColumns: ["companyId"]
- },
- {
- foreignKeyName: "trackedEntityAttribute_createdBy_fkey"
- columns: ["createdBy"]
- isOneToOne: false
- referencedRelation: "employees"
- referencedColumns: ["id"]
- },
- {
- foreignKeyName: "trackedEntityAttribute_createdBy_fkey"
- columns: ["createdBy"]
- isOneToOne: false
- referencedRelation: "employeesAcrossCompanies"
- referencedColumns: ["id"]
- },
- {
- foreignKeyName: "trackedEntityAttribute_createdBy_fkey"
- columns: ["createdBy"]
- isOneToOne: false
- referencedRelation: "employeeSummary"
- referencedColumns: ["id"]
- },
- {
- foreignKeyName: "trackedEntityAttribute_createdBy_fkey"
- columns: ["createdBy"]
- isOneToOne: false
- referencedRelation: "user"
- referencedColumns: ["id"]
- },
- {
- foreignKeyName: "trackedEntityAttribute_createdBy_fkey"
- columns: ["createdBy"]
- isOneToOne: false
- referencedRelation: "userDefaults"
- referencedColumns: ["userId"]
- },
- {
- foreignKeyName: "trackedEntityAttribute_trackedEntityId_fkey"
- columns: ["trackedEntityId"]
- isOneToOne: false
- referencedRelation: "trackedEntity"
- referencedColumns: ["id"]
- },
- ]
- }
unitOfMeasure: {
Row: {
active: boolean
@@ -33488,14 +33305,14 @@ export type Database = {
Relationships: [
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["customerCountryCode"]
+ columns: ["paymentCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
},
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["paymentCountryCode"]
+ columns: ["customerCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
@@ -36701,7 +36518,6 @@ export type Database = {
| "Consumable"
| "Material"
| "Fixture"
- serialStatus: "Available" | "Reserved" | "Consumed"
serviceType: "Internal" | "External"
shipmentSourceDocument:
| "Sales Order"
@@ -36723,6 +36539,7 @@ export type Database = {
| "Refund"
supplierQuoteStatus: "Active" | "Expired"
tableViewType: "Public" | "Private"
+ trackedEntityStatus: "Available" | "Reserved" | "On Hold" | "Consumed"
trackingSource: "Purchased" | "Manufactured"
}
CompositeTypes: {
diff --git a/packages/database/supabase/functions/lib/utils.ts b/packages/database/supabase/functions/lib/utils.ts
index a392c826c1..fd4fb9a9ab 100644
--- a/packages/database/supabase/functions/lib/utils.ts
+++ b/packages/database/supabase/functions/lib/utils.ts
@@ -1,3 +1,12 @@
+export interface TrackedEntityAttributes {
+ [key: string]: any;
+ "Receipt Line"?: string;
+ "Batch Number"?: string;
+ "Serial Number"?: string;
+ Receipt?: string;
+ Index?: number;
+}
+
// used to generate sequences
export const interpolateSequenceDate = (value?: string | null) => {
// replace all instances of %{year} with the current year
diff --git a/packages/database/supabase/functions/post-receipt/index.ts b/packages/database/supabase/functions/post-receipt/index.ts
index 0b1d4ca1e1..e9e0d48aca 100644
--- a/packages/database/supabase/functions/post-receipt/index.ts
+++ b/packages/database/supabase/functions/post-receipt/index.ts
@@ -6,7 +6,12 @@ import { DB, getConnectionPool, getDatabaseClient } from "../lib/database.ts";
import { corsHeaders } from "../lib/headers.ts";
import { getSupabaseServiceRole } from "../lib/supabase.ts";
import type { Database } from "../lib/types.ts";
-import { credit, debit, journalReference } from "../lib/utils.ts";
+import {
+ credit,
+ debit,
+ journalReference,
+ TrackedEntityAttributes,
+} from "../lib/utils.ts";
import { getCurrentAccountingPeriod } from "../shared/get-accounting-period.ts";
import {
getInventoryPostingGroup,
@@ -53,12 +58,9 @@ serve(async (req: Request) => {
client.from("receipt").select("*").eq("id", receiptId).single(),
client.from("receiptLine").select("*").eq("receiptId", receiptId),
client
- .from("itemTracking")
- .select(
- "id, quantity, sourceDocumentLineId, sourceDocument, serialNumber(number), batchNumber(number)"
- )
- .eq("sourceDocument", "Receipt")
- .eq("sourceDocumentId", receiptId),
+ .from("trackedEntity")
+ .select("*")
+ .eq("attributes->> Receipt", receiptId),
]);
if (receipt.error) throw new Error("Failed to fetch receipt");
@@ -154,16 +156,19 @@ serve(async (req: Request) => {
return acc;
}, {});
- const itemTrackingUpdates =
+ const trackedEntityUpdates =
receiptLineTracking.data?.reduce<
Record<
string,
- Database["public"]["Tables"]["itemTracking"]["Update"]
+ Database["public"]["Tables"]["trackedEntity"]["Update"]
>
>((acc, itemTracking) => {
const receiptLine = receiptLines.data?.find(
(receiptLine) =>
- receiptLine.id === itemTracking.sourceDocumentLineId
+ receiptLine.id ===
+ (itemTracking.attributes as TrackedEntityAttributes)?.[
+ "Receipt Line"
+ ]?.toString()
);
const quantity = receiptLine?.requiresSerialTracking
@@ -171,7 +176,7 @@ serve(async (req: Request) => {
: receiptLine?.receivedQuantity ?? itemTracking.quantity;
acc[itemTracking.id] = {
- posted: true,
+ status: "Available",
quantity: quantity,
};
@@ -677,6 +682,8 @@ serve(async (req: Request) => {
}
if (receiptLine.requiresBatchTracking) {
+
+
itemLedgerInserts.push({
postingDate: today,
itemId: receiptLine.itemId,
@@ -687,11 +694,11 @@ serve(async (req: Request) => {
entryType: "Positive Adjmt.",
documentType: "Purchase Receipt",
documentId: receipt.data?.id ?? undefined,
- batchNumber: receiptLineTracking.data?.find(
+ trackedEntityId: receiptLineTracking.data?.find(
(tracking) =>
- tracking.sourceDocument === "Receipt" &&
- tracking.sourceDocumentLineId === receiptLine.lineId
- )?.batchNumber?.number,
+ (tracking.attributes as TrackedEntityAttributes | undefined)
+ ?.["Receipt Line"] === receiptLine.id
+ )?.id,
externalDocumentId: receipt.data?.externalDocumentId ?? undefined,
createdBy: userId,
companyId,
@@ -701,28 +708,35 @@ serve(async (req: Request) => {
if (receiptLine.requiresSerialTracking) {
const lineTracking = receiptLineTracking.data?.filter(
(tracking) =>
- tracking.sourceDocument === "Receipt" &&
- tracking.sourceDocumentLineId === receiptLine.id
+ (tracking.attributes as TrackedEntityAttributes | undefined)
+ ?.["Receipt Line"] === receiptLine.id
);
- lineTracking?.forEach((tracking) => {
- itemLedgerInserts.push({
- postingDate: today,
- itemId: receiptLine.itemId,
- itemReadableId: receiptLine.itemReadableId ?? "",
- quantity: 1,
- locationId: receiptLine.locationId,
- shelfId: receiptLine.shelfId,
- entryType: "Positive Adjmt.",
- documentType: "Purchase Receipt",
- documentId: receipt.data?.id ?? undefined,
- serialNumber: tracking.serialNumber?.number,
- externalDocumentId:
- receipt.data?.externalDocumentId ?? undefined,
- createdBy: userId,
- companyId,
- });
- });
+ const receivedQuantity = receiptLine.receivedQuantity || 0;
+
+ for (let i = 0; i < receivedQuantity; i++) {
+ const trackingWithIndex = lineTracking?.find(
+ (tracking) => (tracking.attributes as TrackedEntityAttributes | undefined)?.["Index"] === i
+ );
+
+ if (trackingWithIndex) {
+ itemLedgerInserts.push({
+ postingDate: today,
+ itemId: receiptLine.itemId,
+ itemReadableId: receiptLine.itemReadableId ?? "",
+ quantity: 1,
+ locationId: receiptLine.locationId,
+ shelfId: receiptLine.shelfId,
+ entryType: "Positive Adjmt.",
+ documentType: "Purchase Receipt",
+ documentId: receipt.data?.id ?? undefined,
+ trackedEntityId: trackingWithIndex.id,
+ externalDocumentId: receipt.data?.externalDocumentId ?? undefined,
+ createdBy: userId,
+ companyId,
+ });
+ }
+ }
}
}
@@ -834,12 +848,12 @@ serve(async (req: Request) => {
.where("id", "=", receiptId)
.execute();
- if (Object.keys(itemTrackingUpdates).length > 0) {
+ if (Object.keys(trackedEntityUpdates).length > 0) {
for await (const [id, update] of Object.entries(
- itemTrackingUpdates
+ trackedEntityUpdates
)) {
await trx
- .updateTable("itemTracking")
+ .updateTable("trackedEntity")
.set(update)
.where("id", "=", id)
.execute();
diff --git a/packages/database/supabase/migrations/20250225145619_tracked-entities.sql b/packages/database/supabase/migrations/20250225145619_tracked-entities.sql
index 4e51ae4165..320b2eb038 100644
--- a/packages/database/supabase/migrations/20250225145619_tracked-entities.sql
+++ b/packages/database/supabase/migrations/20250225145619_tracked-entities.sql
@@ -13,13 +13,18 @@ DROP FUNCTION IF EXISTS update_shipment_line_serial_tracking;
DROP VIEW IF EXISTS "batchNumbers";
DROP VIEW IF EXISTS "serialNumbers";
+DROP TYPE IF EXISTS "serialStatus";
+CREATE TYPE "trackedEntityStatus" AS ENUM('Available', 'Reserved', 'On Hold', 'Consumed');
+
-- Create tracked entity table
CREATE TABLE "trackedEntity" (
"id" TEXT NOT NULL DEFAULT xid(),
"quantity" NUMERIC NOT NULL,
+ "status" "trackedEntityStatus" NOT NULL DEFAULT 'Available',
"sourceDocument" TEXT NOT NULL,
"sourceDocumentId" TEXT NOT NULL,
"sourceDocumentReadableId" TEXT,
+ "attributes" JSONB NOT NULL DEFAULT '{}',
"companyId" TEXT NOT NULL,
"createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
"createdBy" TEXT NOT NULL,
@@ -32,28 +37,6 @@ CREATE TABLE "trackedEntity" (
ALTER TABLE "itemLedger" ADD COLUMN "trackedEntityId" TEXT;
ALTER TABLE "itemLedger" ADD CONSTRAINT "itemLedger_trackedEntityId_fkey" FOREIGN KEY ("trackedEntityId") REFERENCES "trackedEntity"("id") ON DELETE SET NULL ON UPDATE CASCADE;
--- Create tracked entity attribute table
-CREATE TABLE "trackedEntityAttribute" (
- "trackedEntityId" TEXT NOT NULL,
- "name" TEXT NOT NULL,
- "textValue" TEXT,
- "numericValue" NUMERIC,
- "booleanValue" BOOLEAN,
- "companyId" TEXT NOT NULL,
- "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
- "createdBy" TEXT NOT NULL,
-
- CONSTRAINT "trackedEntityAttribute_pkey" PRIMARY KEY ("trackedEntityId", "name"),
- CONSTRAINT "trackedEntityAttribute_trackedEntityId_fkey" FOREIGN KEY ("trackedEntityId") REFERENCES "trackedEntity"("id") ON DELETE CASCADE ON UPDATE CASCADE,
- CONSTRAINT "trackedEntityAttribute_companyId_fkey" FOREIGN KEY ("companyId") REFERENCES "company"("id") ON DELETE CASCADE ON UPDATE CASCADE,
- CONSTRAINT "trackedEntityAttribute_createdBy_fkey" FOREIGN KEY ("createdBy") REFERENCES "user"("id") ON UPDATE CASCADE,
- CONSTRAINT "trackedEntityAttribute_value_check" CHECK (
- (("textValue" IS NOT NULL)::INTEGER +
- ("numericValue" IS NOT NULL)::INTEGER +
- ("booleanValue" IS NOT NULL)::INTEGER) = 1
- )
-);
-
-- Create trackedActivity table
CREATE TABLE "trackedActivity" (
"id" TEXT NOT NULL DEFAULT xid(),
@@ -61,6 +44,7 @@ CREATE TABLE "trackedActivity" (
"sourceDocument" TEXT,
"sourceDocumentId" TEXT,
"sourceDocumentReadableId" TEXT,
+ "attributes" JSONB NOT NULL DEFAULT '{}',
"companyId" TEXT NOT NULL,
"createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
"createdBy" TEXT NOT NULL,
@@ -70,28 +54,6 @@ CREATE TABLE "trackedActivity" (
CONSTRAINT "trackedActivity_createdBy_fkey" FOREIGN KEY ("createdBy") REFERENCES "user"("id") ON UPDATE CASCADE
);
--- Create trackedActivity attribute table
-CREATE TABLE "trackedActivityAttribute" (
- "trackedActivityId" TEXT NOT NULL,
- "name" TEXT NOT NULL,
- "textValue" TEXT,
- "numericValue" NUMERIC,
- "booleanValue" BOOLEAN,
- "companyId" TEXT NOT NULL,
- "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
- "createdBy" TEXT NOT NULL,
-
- CONSTRAINT "trackedActivityAttribute_pkey" PRIMARY KEY ("trackedActivityId", "name"),
- CONSTRAINT "trackedActivityAttribute_trackedActivityId_fkey" FOREIGN KEY ("trackedActivityId") REFERENCES "trackedActivity"("id") ON DELETE CASCADE ON UPDATE CASCADE,
- CONSTRAINT "trackedActivityAttribute_companyId_fkey" FOREIGN KEY ("companyId") REFERENCES "company"("id") ON DELETE CASCADE ON UPDATE CASCADE,
- CONSTRAINT "trackedActivityAttribute_createdBy_fkey" FOREIGN KEY ("createdBy") REFERENCES "user"("id") ON UPDATE CASCADE,
- CONSTRAINT "trackedActivityAttribute_value_check" CHECK (
- (("textValue" IS NOT NULL)::INTEGER +
- ("numericValue" IS NOT NULL)::INTEGER +
- ("booleanValue" IS NOT NULL)::INTEGER) = 1
- )
-);
-
-- Create trackedActivity input table
CREATE TABLE "trackedActivityInput" (
"trackedActivityId" TEXT NOT NULL,
@@ -128,12 +90,11 @@ CREATE TABLE "trackedActivityOutput" (
-- Create indexes for performance
CREATE INDEX "idx_trackedEntity_sourceDocument_sourceDocumentId" ON "trackedEntity"("sourceDocument", "sourceDocumentId");
CREATE INDEX "idx_trackedEntity_companyId" ON "trackedEntity"("companyId");
-CREATE INDEX "idx_trackedEntityAttribute_companyId" ON "trackedEntityAttribute"("companyId");
-CREATE INDEX "idx_trackedEntityAttribute_trackedEntityId" ON "trackedEntityAttribute"("trackedEntityId");
+CREATE INDEX "idx_trackedEntity_attributes" ON "trackedEntity" USING GIN ("attributes");
CREATE INDEX "idx_trackedActivity_type" ON "trackedActivity"("type");
CREATE INDEX "idx_trackedActivity_sourceDocument_sourceDocumentId" ON "trackedActivity"("sourceDocument", "sourceDocumentId");
CREATE INDEX "idx_trackedActivity_companyId" ON "trackedActivity"("companyId");
-CREATE INDEX "idx_trackedActivityAttribute_companyId" ON "trackedActivityAttribute"("companyId");
+CREATE INDEX "idx_trackedActivity_attributes" ON "trackedActivity" USING GIN ("attributes");
CREATE INDEX "idx_trackedActivityInput_trackedEntityId" ON "trackedActivityInput"("trackedEntityId");
CREATE INDEX "idx_trackedActivityInput_companyId" ON "trackedActivityInput"("companyId");
CREATE INDEX "idx_trackedActivityOutput_trackedEntityId" ON "trackedActivityOutput"("trackedEntityId");
@@ -141,9 +102,7 @@ CREATE INDEX "idx_trackedActivityOutput_companyId" ON "trackedActivityOutput"("c
-- Add RLS policies
ALTER TABLE "trackedEntity" ENABLE ROW LEVEL SECURITY;
-ALTER TABLE "trackedEntityAttribute" ENABLE ROW LEVEL SECURITY;
ALTER TABLE "trackedActivity" ENABLE ROW LEVEL SECURITY;
-ALTER TABLE "trackedActivityAttribute" ENABLE ROW LEVEL SECURITY;
ALTER TABLE "trackedActivityInput" ENABLE ROW LEVEL SECURITY;
ALTER TABLE "trackedActivityOutput" ENABLE ROW LEVEL SECURITY;
@@ -157,16 +116,6 @@ FOR SELECT USING (
)
);
-CREATE POLICY "SELECT" ON "public"."trackedEntityAttribute"
-FOR SELECT USING (
- "companyId" = ANY (
- (
- SELECT
- get_companies_with_employee_role()
- )::text[]
- )
-);
-
CREATE POLICY "SELECT" ON "public"."trackedActivity"
FOR SELECT USING (
"companyId" = ANY (
@@ -177,16 +126,6 @@ FOR SELECT USING (
)
);
-CREATE POLICY "SELECT" ON "public"."trackedActivityAttribute"
-FOR SELECT USING (
- "companyId" = ANY (
- (
- SELECT
- get_companies_with_employee_role()
- )::text[]
- )
-);
-
CREATE POLICY "SELECT" ON "public"."trackedActivityInput"
FOR SELECT USING (
"companyId" = ANY (
@@ -217,16 +156,6 @@ FOR INSERT WITH CHECK (
)
);
-CREATE POLICY "INSERT" ON "public"."trackedEntityAttribute"
-FOR INSERT WITH CHECK (
- "companyId" = ANY (
- (
- SELECT
- get_companies_with_employee_role()
- )::text[]
- )
-);
-
CREATE POLICY "INSERT" ON "public"."trackedActivity"
FOR INSERT WITH CHECK (
"companyId" = ANY (
@@ -237,16 +166,6 @@ FOR INSERT WITH CHECK (
)
);
-CREATE POLICY "INSERT" ON "public"."trackedActivityAttribute"
-FOR INSERT WITH CHECK (
- "companyId" = ANY (
- (
- SELECT
- get_companies_with_employee_role()
- )::text[]
- )
-);
-
CREATE POLICY "INSERT" ON "public"."trackedActivityInput"
FOR INSERT WITH CHECK (
"companyId" = ANY (
@@ -318,7 +237,7 @@ DECLARE
v_company_id TEXT;
v_created_by TEXT;
v_supplier_id TEXT;
- property RECORD;
+ v_attributes JSONB;
BEGIN
v_tracked_entity_id := COALESCE(p_tracked_entity_id, xid());
-- Get receipt line details
@@ -338,44 +257,47 @@ BEGIN
JOIN "receipt" r ON r.id = rl."receiptId"
WHERE rl.id = p_receipt_line_id;
- -- First upsert the batch number
- INSERT INTO "trackedEntity" ("id", "quantity", "sourceDocument", "sourceDocumentId", "sourceDocumentReadableId", "companyId", "createdBy")
+ -- Build attributes JSONB
+ v_attributes := jsonb_build_object(
+ 'Batch Number', p_batch_number,
+ 'Receipt Line', p_receipt_line_id,
+ 'Receipt', p_receipt_id
+ );
+
+ -- Add supplier if available
+ IF v_supplier_id IS NOT NULL THEN
+ v_attributes := v_attributes || jsonb_build_object('Supplier', v_supplier_id);
+ END IF;
+
+ -- Merge any additional properties
+ v_attributes := v_attributes || p_properties;
+
+ -- Upsert the tracked entity with attributes
+ INSERT INTO "trackedEntity" (
+ "id",
+ "quantity",
+ "status",
+ "sourceDocument",
+ "sourceDocumentId",
+ "sourceDocumentReadableId",
+ "attributes",
+ "companyId",
+ "createdBy"
+ )
VALUES (
v_tracked_entity_id,
p_quantity,
+ 'On Hold',
'Item',
v_item_id,
v_item_readable_id,
+ v_attributes,
v_company_id,
v_created_by
)
ON CONFLICT (id) DO UPDATE SET
- "quantity" = EXCLUDED."quantity";
-
- -- Delete any existing tracking records for this receipt line
- DELETE FROM "trackedEntityAttribute"
- WHERE "trackedEntityId" = p_tracked_entity_id;
-
- -- Insert tracked attributes for the batch number, the receipt line and any properties
- INSERT INTO "trackedEntityAttribute" ("trackedEntityId", "name", "textValue", "numericValue", "booleanValue", "companyId", "createdBy")
- VALUES
- (p_tracked_entity_id, 'Batch Number', p_batch_number, NULL, NULL, v_company_id, v_created_by),
- (p_tracked_entity_id, 'Receipt Line', p_receipt_line_id, NULL, NULL, v_company_id, v_created_by),
- (p_tracked_entity_id, 'Supplier', v_supplier_id, NULL, NULL, v_company_id, v_created_by);
-
- -- Insert tracked attributes for any properties
- FOR property IN SELECT * FROM jsonb_each(p_properties) LOOP
- INSERT INTO "trackedEntityAttribute" ("trackedEntityId", "name", "textValue", "numericValue", "booleanValue", "companyId", "createdBy")
- VALUES (
- p_tracked_entity_id,
- property.key,
- CASE WHEN jsonb_typeof(property.value) = 'string' THEN property.value::text END,
- CASE WHEN jsonb_typeof(property.value) = 'number' THEN property.value::numeric END,
- CASE WHEN jsonb_typeof(property.value) = 'boolean' THEN property.value::boolean END,
- v_company_id,
- v_created_by
- );
- END LOOP;
+ "quantity" = EXCLUDED."quantity",
+ "attributes" = EXCLUDED."attributes";
END;
$$ LANGUAGE plpgsql;
@@ -395,6 +317,7 @@ DECLARE
v_company_id TEXT;
v_created_by TEXT;
v_supplier_id TEXT;
+ v_attributes JSONB;
BEGIN
-- Get receipt line details
SELECT
@@ -416,29 +339,44 @@ BEGIN
-- First create the tracked entity for this serial number
v_serial_id := COALESCE(p_tracked_entity_id, xid());
- INSERT INTO "trackedEntity" ("id", "quantity", "sourceDocument", "sourceDocumentId", "sourceDocumentReadableId", "companyId", "createdBy")
+ -- Build attributes JSONB
+ v_attributes := jsonb_build_object(
+ 'Serial Number', p_serial_number,
+ 'Receipt Line', p_receipt_line_id,
+ 'Receipt', p_receipt_id,
+ 'Index', p_index
+ );
+
+ -- Add supplier if available
+ IF v_supplier_id IS NOT NULL THEN
+ v_attributes := v_attributes || jsonb_build_object('Supplier', v_supplier_id);
+ END IF;
+
+ INSERT INTO "trackedEntity" (
+ "id",
+ "quantity",
+ "status",
+ "sourceDocument",
+ "sourceDocumentId",
+ "sourceDocumentReadableId",
+ "attributes",
+ "companyId",
+ "createdBy"
+ )
VALUES (
v_serial_id,
1,
+ 'On Hold',
'Item',
v_item_id,
v_item_readable_id,
+ v_attributes,
v_company_id,
v_created_by
)
ON CONFLICT (id) DO UPDATE SET
- "quantity" = EXCLUDED."quantity";
-
- DELETE FROM "trackedEntityAttribute"
- WHERE "trackedEntityId" = v_serial_id;
-
- -- Insert tracked attributes for the serial number and receipt line
- INSERT INTO "trackedEntityAttribute" ("trackedEntityId", "name", "textValue", "numericValue", "booleanValue", "companyId", "createdBy")
- VALUES
- (v_serial_id, 'Serial Number', p_serial_number, NULL, NULL, v_company_id, v_created_by),
- (v_serial_id, 'Receipt Line', p_receipt_line_id, NULL, NULL, v_company_id, v_created_by),
- (v_serial_id, 'Index', NULL, p_index::numeric, NULL, v_company_id, v_created_by),
- (v_serial_id, 'Supplier', v_supplier_id, NULL, NULL, v_company_id, v_created_by);
+ "quantity" = EXCLUDED."quantity",
+ "attributes" = EXCLUDED."attributes";
END;
$$ LANGUAGE plpgsql;
\ No newline at end of file
diff --git a/packages/database/supabase/migrations/20250226204834_label-settings.sql b/packages/database/supabase/migrations/20250226204834_label-settings.sql
new file mode 100644
index 0000000000..5ce56d1dc4
--- /dev/null
+++ b/packages/database/supabase/migrations/20250226204834_label-settings.sql
@@ -0,0 +1,2 @@
+ALTER TABLE "companySettings" ADD COLUMN "productLabelSize" TEXT DEFAULT 'avery5160';
+ALTER TABLE "companySettings" ADD COLUMN "shelfLabelSize" TEXT DEFAULT 'avery5160';
\ No newline at end of file
diff --git a/packages/documents/src/pdf/ProductLabelPDF.tsx b/packages/documents/src/pdf/ProductLabelPDF.tsx
new file mode 100644
index 0000000000..fa3411f461
--- /dev/null
+++ b/packages/documents/src/pdf/ProductLabelPDF.tsx
@@ -0,0 +1,237 @@
+import { Document, Page, View, Text, Image } from "@react-pdf/renderer";
+import bwipjs from "@bwip-js/node";
+import { createTw } from "react-pdf-tailwind";
+
+interface Item {
+ itemId: string;
+ revision?: string;
+ quantity?: number;
+ number?: string;
+ trackedEntityId?: string;
+ trackingType?: string;
+}
+
+interface LabelSize {
+ width: number;
+ height: number;
+ rows?: number;
+ columns?: number;
+ rotated?: boolean;
+}
+
+interface ProductLabelProps {
+ items: Item[];
+ labelSize: LabelSize;
+}
+
+// Initialize tailwind-styled-components
+const tw = createTw({
+ theme: {
+ fontFamily: {
+ sans: ["Helvetica", "Arial", "sans-serif"],
+ },
+ extend: {
+ colors: {
+ gray: {
+ 500: "#7d7d7d",
+ },
+ },
+ },
+ },
+});
+
+const ProductLabelPDF = ({ items, labelSize }: ProductLabelProps) => {
+ // Default to 1 row and 1 column if not specified
+ const rows = labelSize.rows || 1;
+ const columns = labelSize.columns || 1;
+ const rotated = labelSize.rotated || false;
+
+ // Standard letter size paper (8.5 x 11 inches in points)
+ const LETTER_WIDTH = 8.5 * 72;
+ const LETTER_HEIGHT = 11 * 72;
+
+ // Calculate dimensions in points (72 points per inch)
+ const labelWidthPt = labelSize.width * 72;
+ const labelHeightPt = labelSize.height * 72;
+
+ // Account for rotation when calculating effective dimensions
+ const effectiveLabelWidthPt = rotated ? labelHeightPt : labelWidthPt;
+ const effectiveLabelHeightPt = rotated ? labelWidthPt : labelHeightPt;
+
+ // Determine page size based on rows and columns
+ let pageWidth, pageHeight;
+
+ if (rows > 1 || columns > 1) {
+ // Using standard letter size paper
+ pageWidth = LETTER_WIDTH;
+ pageHeight = LETTER_HEIGHT;
+ } else {
+ // Single label per page - use effective dimensions for rotated labels
+ pageWidth = effectiveLabelWidthPt;
+ pageHeight = effectiveLabelHeightPt;
+ }
+
+ // Calculate font sizes based on label height
+ // Base sizes are optimized for labelSize.height = 1
+ // Scale up proportionally as height increases, with a cap at height = 4
+ const scaleFactor = Math.min(labelSize.height, 4);
+ const titleFontSize = 10 * Math.sqrt(scaleFactor);
+ const descriptionFontSize = 7 * Math.sqrt(scaleFactor);
+
+ // QR code size based on effective label dimensions accounting for rotation
+ const qrCodeSize = Math.min(
+ effectiveLabelHeightPt * 0.8,
+ effectiveLabelWidthPt * 0.4
+ );
+
+ // Calculate how many pages we need
+ const labelsPerPage = rows * columns;
+ const pageCount = Math.ceil(items.length / labelsPerPage);
+
+ // Calculate margins to center labels on the page
+ // Use effective dimensions for rotated labels
+ const horizontalMargin = (pageWidth - columns * effectiveLabelWidthPt) / 2;
+ const verticalMargin = (pageHeight - rows * effectiveLabelHeightPt) / 2;
+
+ return (
+ <Document>
+ {Array.from({ length: pageCount }).map((_, pageIndex) => (
+ <Page key={pageIndex} size={[pageWidth, pageHeight]} style={tw("p-0")}>
+ {Array.from({ length: rows }).map((_, rowIndex) => (
+ <View
+ key={`row-${rowIndex}`}
+ style={{
+ flexDirection: "row",
+ marginLeft: horizontalMargin,
+ marginTop: rowIndex === 0 ? verticalMargin : 0,
+ }}
+ >
+ {Array.from({ length: columns }).map((_, colIndex) => {
+ const itemIndex =
+ pageIndex * labelsPerPage + rowIndex * columns + colIndex;
+ const item = items[itemIndex];
+
+ if (!item)
+ return (
+ <View
+ key={`empty-${colIndex}`}
+ style={{ width: labelWidthPt, height: labelHeightPt }}
+ />
+ );
+
+ return (
+ <View
+ key={`label-${itemIndex}`}
+ style={{
+ ...tw("relative p-2 flex flex-col pl-[10pt]"),
+ width: labelWidthPt,
+ height: labelHeightPt,
+ transform: rotated ? "rotate(90deg)" : undefined,
+ }}
+ >
+ <View style={tw("flex flex-row justify-between")}>
+ <View
+ style={tw("flex flex-col justify-center flex-1 pr-2")}
+ >
+ <Text
+ style={{
+ overflow: "hidden",
+ textOverflow: "ellipsis",
+ maxWidth: "100%",
+ ...tw("mb-2"),
+ fontWeight: "bold",
+ fontSize: `${titleFontSize}pt`,
+ }}
+ >
+ {item.itemId}
+ </Text>
+
+ {item.revision && (
+ <Text
+ style={{
+ ...tw("mb-1"),
+ fontSize: `${descriptionFontSize}pt`,
+ }}
+ >
+ Rev: {item.revision}
+ </Text>
+ )}
+
+ {["Serial", "Batch"].includes(item.trackingType) && (
+ <Text
+ style={{
+ ...tw("mb-1"),
+ fontSize: `${descriptionFontSize}pt`,
+ }}
+ >
+ Qty: {item.quantity}
+ </Text>
+ )}
+
+ {item.trackingType === "Serial" && (
+ <Text
+ style={{
+ ...tw("mb-1"),
+ fontSize: `${descriptionFontSize}pt`,
+ }}
+ >
+ S/N: {item.number}
+ </Text>
+ )}
+ {item.trackingType === "Batch" && (
+ <Text
+ style={{
+ ...tw("mb-1"),
+ fontSize: `${descriptionFontSize}pt`,
+ }}
+ >
+ Batch: {item.number}
+ </Text>
+ )}
+ </View>
+
+ <View style={tw("flex items-center justify-center")}>
+ <Image
+ src={generateQRCode(item.trackedEntityId)}
+ style={{
+ width: qrCodeSize,
+ height: qrCodeSize,
+ objectFit: "contain",
+ }}
+ />
+ </View>
+ </View>
+
+ {item.trackedEntityId && (
+ <Text
+ style={{
+ ...tw("mt-1 text-center"),
+ fontSize: `${descriptionFontSize - 1}pt`,
+ width: "100%",
+ }}
+ >
+ {item.trackedEntityId}
+ </Text>
+ )}
+ </View>
+ );
+ })}
+ </View>
+ ))}
+ </Page>
+ ))}
+ </Document>
+ );
+};
+
+async function generateQRCode(text: string): Promise<string> {
+ const buffer = await bwipjs.toBuffer({
+ bcid: "qrcode", // QR code type
+ text: text, // Text to encode
+ scale: 3, // Scaling factor
+ includetext: false, // No human-readable text for QR codes
+ });
+ return `data:image/png;base64,${buffer.toString("base64")}`;
+}
+
+export default ProductLabelPDF;
diff --git a/packages/documents/src/pdf/index.ts b/packages/documents/src/pdf/index.ts
index 44e06a6d46..abae59a99c 100644
--- a/packages/documents/src/pdf/index.ts
+++ b/packages/documents/src/pdf/index.ts
@@ -1,6 +1,7 @@
+
import PackingSlipPDF from "./PackingSlipPDF";
import PurchaseOrderPDF from "./PurchaseOrderPDF";
import QuotePDF from "./QuotePDF";
import SalesOrderPDF from "./SalesOrderPDF";
-
-export { PackingSlipPDF, PurchaseOrderPDF, QuotePDF, SalesOrderPDF };
+import ProductLabelPDF from "./ProductLabelPDF";
+export { PackingSlipPDF, PurchaseOrderPDF, QuotePDF, SalesOrderPDF, ProductLabelPDF };
diff --git a/packages/utils/src/index.ts b/packages/utils/src/index.ts
index 6b40c815e4..e5ac0bc763 100644
--- a/packages/utils/src/index.ts
+++ b/packages/utils/src/index.ts
@@ -8,8 +8,9 @@ export * from "./duration";
export * from "./file";
export * from "./geo";
export * from "./keyboard";
+export * from "./labels";
export * from "./math";
export * from "./ssr";
export * from "./themes";
export * from "./types";
-export * from "./url";
+export * from "./url";
\ No newline at end of file
diff --git a/packages/utils/src/labels.ts b/packages/utils/src/labels.ts
new file mode 100644
index 0000000000..1d3512d556
--- /dev/null
+++ b/packages/utils/src/labels.ts
@@ -0,0 +1,64 @@
+export type LabelSize = {
+ id: string;
+ name: string;
+ width: number;
+ height: number;
+ description: string;
+ rows?: number;
+ columns?: number;
+ rotated?: boolean;
+ zpl?: {
+ dpi: number;
+ width: number;
+ height: number;
+ };
+};
+
+export const labelSizes: LabelSize[] = [
+ {
+ id: "avery5160",
+ name: "Avery 5160",
+ width: 2.625, // inches to points (72 points per inch)
+ height: 1,
+ description: 'Address Labels (1" x 2.625")',
+ rows: 10,
+ columns: 3,
+ rotated: false,
+ },
+ {
+ id: "avery5163",
+ name: "Avery 5163",
+ width: 4,
+ height: 2,
+ description: 'Shipping Labels (2" x 4")',
+ rows: 5,
+ columns: 2,
+ rotated: false,
+ },
+ {
+ id: "zebra2x1",
+ name: "Zebra 2x1",
+ width: 2,
+ height: 1,
+ description: 'Thermal Transfer Labels (1" x 2")',
+ rotated: false,
+ zpl: {
+ dpi: 203,
+ width: 2,
+ height: 1,
+ },
+ },
+ {
+ id: "zebra4x2",
+ name: "Zebra 4x2",
+ width: 4,
+ height: 2,
+ description: 'Thermal Transfer Labels (2" x 4")',
+ rotated: false,
+ zpl: {
+ dpi: 203,
+ width: 4,
+ height: 2,
+ },
+ },
+];