all the haul

This commit is contained in:
2026-04-07 23:56:31 +00:00
parent 87cce83030
commit 24f303355b
244 changed files with 33743 additions and 11249 deletions
+58
View File
@@ -0,0 +1,58 @@
import { ProductCatalog as CwProductCatalog } from "../../generated/prisma/client";
import { CatalogItem as ApiCatalogItem } from "../../../api/generated/prisma/client";
import { Translation } from "./types";
export const catalogItemTranslation: Translation<
CwProductCatalog,
ApiCatalogItem
> = {
values: [
{ from: "catalogRecId", to: "id" },
{ from: "itemId", to: "identifier" },
{
from: "description",
to: "name",
process: (value) => (value ? value : "Unnamed Item"),
},
{ from: "longDescription", to: "description" },
{ from: "longDescription", to: "customerDescription" },
{ from: "notes", to: "internalNotes" },
{
from: "subcategoryRecId",
to: "subcategoryId",
process: (value) => {
if (value == null) {
throw new Error(
"CatalogItem subcategoryId is required but subcategoryRecId is null"
);
}
return value;
},
},
{ from: "manufacturerRecId", to: "manufacturerId" },
{ from: "manufacturerPartNum", to: "partNumber" },
{ from: "vendorSku", to: "vendorSku" },
{ from: "vendorRecId", to: "vendorCwId" },
{
from: "listPrice",
to: "price",
process: (value) => Number(value),
},
{
from: "currentCost",
to: "cost",
process: (value) => (value == null ? 0 : Number(value)),
},
{ from: "inactiveFlag", to: "inactive" },
{ from: "taxableFlag", to: "salesTaxable" },
{
from: "minimumStock",
to: "onHand",
process: (value) => (value == null ? 0 : value),
},
{ from: "classId", to: "classId" },
{ from: "dateEnteredUtc", to: "createdAt" },
{ from: "lastUpdatedUtc", to: "cwLastUpdated" },
{ from: "lastUpdatedUtc", to: "updatedAt" },
],
};