Skip to content

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

refactor: rename parts module to items module

Brad Barbin68cb40c9fc0c
diff --git a/apps/carbon/app/components/DocumentPreview.tsx b/apps/carbon/app/components/DocumentPreview.tsx
index 98083c1e18..ce2eec499a 100644
--- a/apps/carbon/app/components/DocumentPreview.tsx
+++ b/apps/carbon/app/components/DocumentPreview.tsx
@@ -20,7 +20,6 @@ const DocumentPreview = forwardRef<
ElementRef<typeof HoverCardContent>,
DocumentPreviewProps
>(({ bucket, pathToFile, type, children, className, ...props }, ref) => {
- console.log({ bucket, pathToFile, type });
return (
<HoverCard>
<HoverCardTrigger>{children}</HoverCardTrigger>
diff --git a/apps/carbon/app/components/Form/Item.tsx b/apps/carbon/app/components/Form/Item.tsx
index 9d1f05e17c..d8054aa625 100644
--- a/apps/carbon/app/components/Form/Item.tsx
+++ b/apps/carbon/app/components/Form/Item.tsx
@@ -1,7 +1,7 @@
import type { Database } from "@carbon/database";
import { useDisclosure } from "@carbon/react";
import { useMemo, useRef, useState } from "react";
-import { PartForm } from "~/modules/parts";
+import { PartForm } from "~/modules/items";
import { useItems } from "~/stores";
import type { ComboboxProps } from "./Combobox";
import CreatableCombobox from "./CreatableCombobox";
diff --git a/apps/carbon/app/components/Form/ItemGroup.tsx b/apps/carbon/app/components/Form/ItemGroup.tsx
index c8793a87a3..eab6828c47 100644
--- a/apps/carbon/app/components/Form/ItemGroup.tsx
+++ b/apps/carbon/app/components/Form/ItemGroup.tsx
@@ -1,8 +1,8 @@
import { useDisclosure, useMount } from "@carbon/react";
import { useFetcher } from "@remix-run/react";
import { useMemo, useRef, useState } from "react";
-import type { getItemGroupsList } from "~/modules/parts";
-import { ItemGroupForm } from "~/modules/parts";
+import type { getItemGroupsList } from "~/modules/items";
+import { ItemGroupForm } from "~/modules/items";
import { path } from "~/utils/path";
import type { ComboboxProps } from "./Combobox";
import CreatableCombobox from "./CreatableCombobox";
diff --git a/apps/carbon/app/components/Form/Part.tsx b/apps/carbon/app/components/Form/Part.tsx
index a011eada7f..995f89710b 100644
--- a/apps/carbon/app/components/Form/Part.tsx
+++ b/apps/carbon/app/components/Form/Part.tsx
@@ -1,6 +1,6 @@
import { useDisclosure } from "@carbon/react";
import { useMemo, useRef, useState } from "react";
-import { PartForm, type ItemReplenishmentSystem } from "~/modules/parts";
+import { PartForm, type ItemReplenishmentSystem } from "~/modules/items";
import { useParts } from "~/stores";
import type { ComboboxProps } from "./Combobox";
import CreatableCombobox from "./CreatableCombobox";
diff --git a/apps/carbon/app/components/Form/Service.tsx b/apps/carbon/app/components/Form/Service.tsx
index 64b325675b..8577cdb396 100644
--- a/apps/carbon/app/components/Form/Service.tsx
+++ b/apps/carbon/app/components/Form/Service.tsx
@@ -1,5 +1,5 @@
import { useMemo } from "react";
-import type { ServiceType } from "~/modules/parts";
+import type { ServiceType } from "~/modules/items";
import { useServices } from "~/stores";
import type { ComboboxProps } from "./Combobox";
import Combobox from "./Combobox";
diff --git a/apps/carbon/app/components/Form/UnitOfMeasure.tsx b/apps/carbon/app/components/Form/UnitOfMeasure.tsx
index 5e65423c1f..9dd01a9f9d 100644
--- a/apps/carbon/app/components/Form/UnitOfMeasure.tsx
+++ b/apps/carbon/app/components/Form/UnitOfMeasure.tsx
@@ -5,8 +5,8 @@ import { useRouteData } from "~/hooks";
import type {
UnitOfMeasureListItem,
getUnitOfMeasuresList,
-} from "~/modules/parts";
-import { UnitOfMeasureForm } from "~/modules/parts";
+} from "~/modules/items";
+import { UnitOfMeasureForm } from "~/modules/items";
import { path } from "~/utils/path";
import type { ComboboxProps } from "./Combobox";
import CreatableCombobox from "./CreatableCombobox";
diff --git a/apps/carbon/app/components/Search/Search/Search.tsx b/apps/carbon/app/components/Search/Search/Search.tsx
index e6b153ee17..8fb6c0a0be 100644
--- a/apps/carbon/app/components/Search/Search/Search.tsx
+++ b/apps/carbon/app/components/Search/Search/Search.tsx
@@ -38,7 +38,7 @@ import { useAccountingSubmodules } from "~/modules/accounting";
import { useDocumentsSubmodules } from "~/modules/documents";
import { useInventorySubmodules } from "~/modules/inventory";
import { useInvoicingSubmodules } from "~/modules/invoicing";
-import { usePartsSubmodules } from "~/modules/parts";
+import { usePartsSubmodules } from "~/modules/items";
import { usePurchasingSubmodules } from "~/modules/purchasing";
import { useResourcesSubmodules } from "~/modules/resources";
import { useSalesSubmodules } from "~/modules/sales";
diff --git a/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceLineForm.tsx b/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceLineForm.tsx
index 98dfa11ae1..53ff2c893e 100644
--- a/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceLineForm.tsx
+++ b/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceLineForm.tsx
@@ -39,7 +39,7 @@ import {
purchaseInvoiceLineType,
purchaseInvoiceLineValidator,
} from "~/modules/invoicing";
-import type { getShelvesList } from "~/modules/parts";
+import type { getShelvesList } from "~/modules/items";
import type { ListItem } from "~/types";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/modules/parts/index.ts b/apps/carbon/app/modules/items/index.ts
similarity index 100%
rename from apps/carbon/app/modules/parts/index.ts
rename to apps/carbon/app/modules/items/index.ts
diff --git a/apps/carbon/app/modules/parts/parts.models.ts b/apps/carbon/app/modules/items/parts.models.ts
similarity index 100%
rename from apps/carbon/app/modules/parts/parts.models.ts
rename to apps/carbon/app/modules/items/parts.models.ts
diff --git a/apps/carbon/app/modules/parts/parts.service.ts b/apps/carbon/app/modules/items/parts.service.ts
similarity index 100%
rename from apps/carbon/app/modules/parts/parts.service.ts
rename to apps/carbon/app/modules/items/parts.service.ts
diff --git a/apps/carbon/app/modules/parts/types.ts b/apps/carbon/app/modules/items/types.ts
similarity index 100%
rename from apps/carbon/app/modules/parts/types.ts
rename to apps/carbon/app/modules/items/types.ts
diff --git a/apps/carbon/app/modules/parts/ui/Part/PartCostingForm.tsx b/apps/carbon/app/modules/items/ui/Item/ItemCostingForm.tsx
similarity index 95%
rename from apps/carbon/app/modules/parts/ui/Part/PartCostingForm.tsx
rename to apps/carbon/app/modules/items/ui/Item/ItemCostingForm.tsx
index 3dab65d66d..2173c43164 100644
--- a/apps/carbon/app/modules/parts/ui/Part/PartCostingForm.tsx
+++ b/apps/carbon/app/modules/items/ui/Item/ItemCostingForm.tsx
@@ -17,15 +17,15 @@ import {
Submit,
} from "~/components/Form";
import { usePermissions } from "~/hooks";
-import { itemCostValidator, itemCostingMethods } from "~/modules/parts";
+import { itemCostValidator, itemCostingMethods } from "~/modules/items";
-type PartCostingFormProps = {
+type ItemCostingFormProps = {
initialValues: z.infer<typeof itemCostValidator>;
};
const currency = "USD"; // TODO: get from settings
-const PartCostingForm = ({ initialValues }: PartCostingFormProps) => {
+const ItemCostingForm = ({ initialValues }: ItemCostingFormProps) => {
const permissions = usePermissions();
const [partCostingMethod, setPartCostingMethod] = useState<string>(
initialValues.costingMethod
@@ -107,4 +107,4 @@ const PartCostingForm = ({ initialValues }: PartCostingFormProps) => {
);
};
-export default PartCostingForm;
+export default ItemCostingForm;
diff --git a/apps/carbon/app/modules/parts/ui/Item/ItemForm.tsx b/apps/carbon/app/modules/items/ui/Item/ItemForm.tsx
similarity index 97%
rename from apps/carbon/app/modules/parts/ui/Item/ItemForm.tsx
rename to apps/carbon/app/modules/items/ui/Item/ItemForm.tsx
index 96aeef084f..f79530a364 100644
--- a/apps/carbon/app/modules/parts/ui/Item/ItemForm.tsx
+++ b/apps/carbon/app/modules/items/ui/Item/ItemForm.tsx
@@ -18,7 +18,7 @@ import {
Submit,
} from "~/components/Form";
import { usePermissions } from "~/hooks";
-import { itemValidator } from "~/modules/parts";
+import { itemValidator } from "~/modules/items";
import { path } from "~/utils/path";
import { capitalize } from "~/utils/string";
diff --git a/apps/carbon/app/modules/parts/ui/Part/PartInventoryForm.tsx b/apps/carbon/app/modules/items/ui/Item/ItemInventoryForm.tsx
similarity index 93%
rename from apps/carbon/app/modules/parts/ui/Part/PartInventoryForm.tsx
rename to apps/carbon/app/modules/items/ui/Item/ItemInventoryForm.tsx
index 150188a068..05af1eed9a 100644
--- a/apps/carbon/app/modules/parts/ui/Part/PartInventoryForm.tsx
+++ b/apps/carbon/app/modules/items/ui/Item/ItemInventoryForm.tsx
@@ -20,24 +20,24 @@ import {
} from "~/components/Form";
import { usePermissions, useUser } from "~/hooks";
import { useSupabase } from "~/lib/supabase";
-import type { ItemQuantities } from "~/modules/parts";
-import { itemInventoryValidator } from "~/modules/parts";
+import type { ItemQuantities } from "~/modules/items";
+import { itemInventoryValidator } from "~/modules/items";
import type { ListItem } from "~/types";
import { path } from "~/utils/path";
-type PartInventoryFormProps = {
+type ItemInventoryFormProps = {
initialValues: z.infer<typeof itemInventoryValidator>;
quantities: ItemQuantities;
locations: ListItem[];
shelves: string[];
};
-const PartInventoryForm = ({
+const ItemInventoryForm = ({
initialValues,
locations,
quantities,
shelves,
-}: PartInventoryFormProps) => {
+}: ItemInventoryFormProps) => {
const permissions = usePermissions();
const { supabase } = useSupabase();
const user = useUser();
@@ -131,4 +131,4 @@ const PartInventoryForm = ({
);
};
-export default PartInventoryForm;
+export default ItemInventoryForm;
diff --git a/apps/carbon/app/modules/parts/ui/Part/PartPlanningForm.tsx b/apps/carbon/app/modules/items/ui/Item/ItemPlanningForm.tsx
similarity index 96%
rename from apps/carbon/app/modules/parts/ui/Part/PartPlanningForm.tsx
rename to apps/carbon/app/modules/items/ui/Item/ItemPlanningForm.tsx
index 25e3923e15..7342722deb 100644
--- a/apps/carbon/app/modules/parts/ui/Part/PartPlanningForm.tsx
+++ b/apps/carbon/app/modules/items/ui/Item/ItemPlanningForm.tsx
@@ -19,19 +19,19 @@ import {
Submit,
} from "~/components/Form";
import { usePermissions } from "~/hooks";
-import { itemPlanningValidator, itemReorderingPolicies } from "~/modules/parts";
+import { itemPlanningValidator, itemReorderingPolicies } from "~/modules/items";
import type { ListItem } from "~/types";
import { path } from "~/utils/path";
-type PartPlanningFormProps = {
+type ItemPlanningFormProps = {
initialValues: z.infer<typeof itemPlanningValidator>;
locations: ListItem[];
};
-const PartPlanningForm = ({
+const ItemPlanningForm = ({
initialValues,
locations,
-}: PartPlanningFormProps) => {
+}: ItemPlanningFormProps) => {
const permissions = usePermissions();
const locationOptions = locations.map((location) => ({
@@ -130,4 +130,4 @@ const PartPlanningForm = ({
);
};
-export default PartPlanningForm;
+export default ItemPlanningForm;
diff --git a/apps/carbon/app/modules/parts/ui/Part/PartPurchasingForm.tsx b/apps/carbon/app/modules/items/ui/Item/ItemPurchasingForm.tsx
similarity index 90%
rename from apps/carbon/app/modules/parts/ui/Part/PartPurchasingForm.tsx
rename to apps/carbon/app/modules/items/ui/Item/ItemPurchasingForm.tsx
index d18cc0662c..a0f160c611 100644
--- a/apps/carbon/app/modules/parts/ui/Part/PartPurchasingForm.tsx
+++ b/apps/carbon/app/modules/items/ui/Item/ItemPurchasingForm.tsx
@@ -19,15 +19,15 @@ import {
UnitOfMeasure,
} from "~/components/Form";
import { usePermissions, useRouteData } from "~/hooks";
-import type { PartSummary } from "~/modules/parts";
-import { itemPurchasingValidator } from "~/modules/parts";
+import type { PartSummary } from "~/modules/items";
+import { itemPurchasingValidator } from "~/modules/items";
import { path } from "~/utils/path";
-type PartPurchasingFormProps = {
+type ItemPurchasingFormProps = {
initialValues: z.infer<typeof itemPurchasingValidator>;
};
-const PartPurchasingForm = ({ initialValues }: PartPurchasingFormProps) => {
+const ItemPurchasingForm = ({ initialValues }: ItemPurchasingFormProps) => {
const permissions = usePermissions();
const { itemId } = useParams();
if (!itemId) throw new Error("itemId not found");
@@ -80,4 +80,4 @@ const PartPurchasingForm = ({ initialValues }: PartPurchasingFormProps) => {
);
};
-export default PartPurchasingForm;
+export default ItemPurchasingForm;
diff --git a/apps/carbon/app/modules/parts/ui/Part/PartSalePriceForm.tsx b/apps/carbon/app/modules/items/ui/Item/ItemSalePriceForm.tsx
similarity index 91%
rename from apps/carbon/app/modules/parts/ui/Part/PartSalePriceForm.tsx
rename to apps/carbon/app/modules/items/ui/Item/ItemSalePriceForm.tsx
index 9cb32a1da5..a9f120881a 100644
--- a/apps/carbon/app/modules/parts/ui/Part/PartSalePriceForm.tsx
+++ b/apps/carbon/app/modules/items/ui/Item/ItemSalePriceForm.tsx
@@ -18,13 +18,13 @@ import {
UnitOfMeasure,
} from "~/components/Form";
import { usePermissions } from "~/hooks";
-import { itemUnitSalePriceValidator } from "~/modules/parts";
+import { itemUnitSalePriceValidator } from "~/modules/items";
-type PartSalePriceFormProps = {
+type ItemSalePriceFormProps = {
initialValues: z.infer<typeof itemUnitSalePriceValidator>;
};
-const PartSalePriceForm = ({ initialValues }: PartSalePriceFormProps) => {
+const ItemSalePriceForm = ({ initialValues }: ItemSalePriceFormProps) => {
const permissions = usePermissions();
const [currency, setCurrency] = useState(initialValues.currencyCode);
@@ -80,4 +80,4 @@ const PartSalePriceForm = ({ initialValues }: PartSalePriceFormProps) => {
);
};
-export default PartSalePriceForm;
+export default ItemSalePriceForm;
diff --git a/apps/carbon/app/modules/parts/ui/Item/ItemSupplierForm.tsx b/apps/carbon/app/modules/items/ui/Item/ItemSupplierForm.tsx
similarity index 97%
rename from apps/carbon/app/modules/parts/ui/Item/ItemSupplierForm.tsx
rename to apps/carbon/app/modules/items/ui/Item/ItemSupplierForm.tsx
index 92a97a8383..e864d8c030 100644
--- a/apps/carbon/app/modules/parts/ui/Item/ItemSupplierForm.tsx
+++ b/apps/carbon/app/modules/items/ui/Item/ItemSupplierForm.tsx
@@ -24,8 +24,8 @@ import {
UnitOfMeasure,
} from "~/components/Form";
import { usePermissions, useRouteData } from "~/hooks";
-import type { PartSummary } from "~/modules/parts";
-import { itemSupplierValidator } from "~/modules/parts";
+import type { PartSummary } from "~/modules/items";
+import { itemSupplierValidator } from "~/modules/items";
import { path } from "~/utils/path";
type ItemSupplierFormProps = {
diff --git a/apps/carbon/app/modules/parts/ui/Item/ItemSuppliers/ItemSuppliers.tsx b/apps/carbon/app/modules/items/ui/Item/ItemSuppliers/ItemSuppliers.tsx
similarity index 99%
rename from apps/carbon/app/modules/parts/ui/Item/ItemSuppliers/ItemSuppliers.tsx
rename to apps/carbon/app/modules/items/ui/Item/ItemSuppliers/ItemSuppliers.tsx
index ebcd6b93c2..f66b03d23b 100644
--- a/apps/carbon/app/modules/parts/ui/Item/ItemSuppliers/ItemSuppliers.tsx
+++ b/apps/carbon/app/modules/items/ui/Item/ItemSuppliers/ItemSuppliers.tsx
@@ -18,7 +18,7 @@ import {
import Grid from "~/components/Grid";
import { useRouteData } from "~/hooks";
import { useCustomColumns } from "~/hooks/useCustomColumns";
-import type { ItemSupplier, UnitOfMeasureListItem } from "~/modules/parts";
+import type { ItemSupplier, UnitOfMeasureListItem } from "~/modules/items";
import { path } from "~/utils/path";
import useItemSuppliers from "./useItemSuppliers";
diff --git a/apps/carbon/app/modules/parts/ui/Item/ItemSuppliers/index.ts b/apps/carbon/app/modules/items/ui/Item/ItemSuppliers/index.ts
similarity index 100%
rename from apps/carbon/app/modules/parts/ui/Item/ItemSuppliers/index.ts
rename to apps/carbon/app/modules/items/ui/Item/ItemSuppliers/index.ts
diff --git a/apps/carbon/app/modules/parts/ui/Item/ItemSuppliers/useItemSuppliers.tsx b/apps/carbon/app/modules/items/ui/Item/ItemSuppliers/useItemSuppliers.tsx
similarity index 93%
rename from apps/carbon/app/modules/parts/ui/Item/ItemSuppliers/useItemSuppliers.tsx
rename to apps/carbon/app/modules/items/ui/Item/ItemSuppliers/useItemSuppliers.tsx
index 47be8b70e7..646517f809 100644
--- a/apps/carbon/app/modules/parts/ui/Item/ItemSuppliers/useItemSuppliers.tsx
+++ b/apps/carbon/app/modules/items/ui/Item/ItemSuppliers/useItemSuppliers.tsx
@@ -1,7 +1,7 @@
import { useCallback } from "react";
import { usePermissions } from "~/hooks";
import { useSupabase } from "~/lib/supabase";
-import type { ItemSupplier } from "~/modules/parts";
+import type { ItemSupplier } from "~/modules/items";
export default function useItemSuppliers() {
const { supabase } = useSupabase();
diff --git a/apps/carbon/app/modules/items/ui/Item/index.ts b/apps/carbon/app/modules/items/ui/Item/index.ts
new file mode 100644
index 0000000000..af6d49c7c9
--- /dev/null
+++ b/apps/carbon/app/modules/items/ui/Item/index.ts
@@ -0,0 +1,19 @@
+import ItemCostingForm from "./ItemCostingForm";
+import ItemForm from "./ItemForm";
+import ItemInventoryForm from "./ItemInventoryForm";
+import ItemPlanningForm from "./ItemPlanningForm";
+import ItemPurchasingForm from "./ItemPurchasingForm";
+import ItemSalePriceForm from "./ItemSalePriceForm";
+import ItemSupplierForm from "./ItemSupplierForm";
+import ItemSuppliers from "./ItemSuppliers";
+
+export {
+ ItemCostingForm,
+ ItemForm,
+ ItemInventoryForm,
+ ItemPlanningForm,
+ ItemPurchasingForm,
+ ItemSalePriceForm,
+ ItemSupplierForm,
+ ItemSuppliers,
+};
diff --git a/apps/carbon/app/modules/parts/ui/ItemGroups/ItemGroupForm.tsx b/apps/carbon/app/modules/items/ui/ItemGroups/ItemGroupForm.tsx
similarity index 98%
rename from apps/carbon/app/modules/parts/ui/ItemGroups/ItemGroupForm.tsx
rename to apps/carbon/app/modules/items/ui/ItemGroups/ItemGroupForm.tsx
index 4c8fb6ffbf..bff7308055 100644
--- a/apps/carbon/app/modules/parts/ui/ItemGroups/ItemGroupForm.tsx
+++ b/apps/carbon/app/modules/items/ui/ItemGroups/ItemGroupForm.tsx
@@ -24,7 +24,7 @@ import {
TextArea,
} from "~/components/Form";
import { usePermissions } from "~/hooks";
-import { itemGroupValidator } from "~/modules/parts";
+import { itemGroupValidator } from "~/modules/items";
import { path } from "~/utils/path";
type ItemGroupFormProps = {
diff --git a/apps/carbon/app/modules/parts/ui/ItemGroups/ItemGroupsTable.tsx b/apps/carbon/app/modules/items/ui/ItemGroups/ItemGroupsTable.tsx
similarity index 98%
rename from apps/carbon/app/modules/parts/ui/ItemGroups/ItemGroupsTable.tsx
rename to apps/carbon/app/modules/items/ui/ItemGroups/ItemGroupsTable.tsx
index ad925d9150..5e62974d26 100644
--- a/apps/carbon/app/modules/parts/ui/ItemGroups/ItemGroupsTable.tsx
+++ b/apps/carbon/app/modules/items/ui/ItemGroups/ItemGroupsTable.tsx
@@ -6,7 +6,7 @@ import { LuPencil, LuTrash } from "react-icons/lu";
import { New, Table } from "~/components";
import { usePermissions, useUrlParams } from "~/hooks";
import { useCustomColumns } from "~/hooks/useCustomColumns";
-import type { ItemGroup } from "~/modules/parts";
+import type { ItemGroup } from "~/modules/items";
import { path } from "~/utils/path";
type ItemGroupsTableProps = {
diff --git a/apps/carbon/app/modules/parts/ui/ItemGroups/index.ts b/apps/carbon/app/modules/items/ui/ItemGroups/index.ts
similarity index 100%
rename from apps/carbon/app/modules/parts/ui/ItemGroups/index.ts
rename to apps/carbon/app/modules/items/ui/ItemGroups/index.ts
diff --git a/apps/carbon/app/modules/parts/ui/Part/PartForm.tsx b/apps/carbon/app/modules/items/ui/Part/PartForm.tsx
similarity index 99%
rename from apps/carbon/app/modules/parts/ui/Part/PartForm.tsx
rename to apps/carbon/app/modules/items/ui/Part/PartForm.tsx
index cb179dca3a..b512703f47 100644
--- a/apps/carbon/app/modules/parts/ui/Part/PartForm.tsx
+++ b/apps/carbon/app/modules/items/ui/Part/PartForm.tsx
@@ -33,7 +33,7 @@ import {
itemInventoryTypes,
partReplenishmentSystems,
partValidator,
-} from "~/modules/parts";
+} from "~/modules/items";
import { path } from "~/utils/path";
type PartFormProps = {
diff --git a/apps/carbon/app/modules/parts/ui/Part/PartHeader.tsx b/apps/carbon/app/modules/items/ui/Part/PartHeader.tsx
similarity index 96%
rename from apps/carbon/app/modules/parts/ui/Part/PartHeader.tsx
rename to apps/carbon/app/modules/items/ui/Part/PartHeader.tsx
index fd0656a86f..57499f4864 100644
--- a/apps/carbon/app/modules/parts/ui/Part/PartHeader.tsx
+++ b/apps/carbon/app/modules/items/ui/Part/PartHeader.tsx
@@ -18,7 +18,7 @@ import {
import { useParams } from "@remix-run/react";
import { Assign, EmployeeAvatar, useOptimisticAssignment } from "~/components";
import { usePermissions, useRouteData } from "~/hooks";
-import type { PartSummary } from "~/modules/parts";
+import type { PartSummary } from "~/modules/items";
import { path } from "~/utils/path";
const PartHeader = () => {
@@ -97,7 +97,7 @@ const PartHeader = () => {
<CardAttribute>
<CardAttributeLabel>UoM</CardAttributeLabel>
<CardAttributeValue>
- {routeData?.partSummary?.unitOfMeasureCode}
+ <Enumerable value={routeData?.partSummary?.unitOfMeasure} />
</CardAttributeValue>
</CardAttribute>
</CardAttributes>
diff --git a/apps/carbon/app/modules/parts/ui/Part/PartManufacturingForm.tsx b/apps/carbon/app/modules/items/ui/Part/PartManufacturingForm.tsx
similarity index 98%
rename from apps/carbon/app/modules/parts/ui/Part/PartManufacturingForm.tsx
rename to apps/carbon/app/modules/items/ui/Part/PartManufacturingForm.tsx
index 90b9e1cf5f..da1dd40be1 100644
--- a/apps/carbon/app/modules/parts/ui/Part/PartManufacturingForm.tsx
+++ b/apps/carbon/app/modules/items/ui/Part/PartManufacturingForm.tsx
@@ -19,7 +19,7 @@ import { usePermissions } from "~/hooks";
import {
partManufacturingPolicies,
partManufacturingValidator,
-} from "~/modules/parts";
+} from "~/modules/items";
type PartManufacturingFormProps = {
initialValues: z.infer<typeof partManufacturingValidator>;
diff --git a/apps/carbon/app/modules/parts/ui/Part/PartSidebar/PartSidebar.tsx b/apps/carbon/app/modules/items/ui/Part/PartSidebar/PartSidebar.tsx
similarity index 92%
rename from apps/carbon/app/modules/parts/ui/Part/PartSidebar/PartSidebar.tsx
rename to apps/carbon/app/modules/items/ui/Part/PartSidebar/PartSidebar.tsx
index 6b4942e4f5..6a3709d902 100644
--- a/apps/carbon/app/modules/parts/ui/Part/PartSidebar/PartSidebar.tsx
+++ b/apps/carbon/app/modules/items/ui/Part/PartSidebar/PartSidebar.tsx
@@ -1,7 +1,7 @@
import { useParams } from "@remix-run/react";
import { DetailSidebar } from "~/components/Layout";
import { useRouteData } from "~/hooks";
-import type { PartSummary } from "~/modules/parts/types";
+import type { PartSummary } from "~/modules/items/types";
import { path } from "~/utils/path";
import { usePartSidebar } from "./usePartSidebar";
diff --git a/apps/carbon/app/modules/parts/ui/Part/PartSidebar/index.ts b/apps/carbon/app/modules/items/ui/Part/PartSidebar/index.ts
similarity index 100%
rename from apps/carbon/app/modules/parts/ui/Part/PartSidebar/index.ts
rename to apps/carbon/app/modules/items/ui/Part/PartSidebar/index.ts
diff --git a/apps/carbon/app/modules/parts/ui/Part/PartSidebar/usePartSidebar.tsx b/apps/carbon/app/modules/items/ui/Part/PartSidebar/usePartSidebar.tsx
similarity index 97%
rename from apps/carbon/app/modules/parts/ui/Part/PartSidebar/usePartSidebar.tsx
rename to apps/carbon/app/modules/items/ui/Part/PartSidebar/usePartSidebar.tsx
index ff2a935574..984d097fbe 100644
--- a/apps/carbon/app/modules/parts/ui/Part/PartSidebar/usePartSidebar.tsx
+++ b/apps/carbon/app/modules/items/ui/Part/PartSidebar/usePartSidebar.tsx
@@ -10,7 +10,7 @@ import {
LuTags,
} from "react-icons/lu";
import { usePermissions } from "~/hooks";
-import type { ItemReplenishmentSystem } from "~/modules/parts/types";
+import type { ItemReplenishmentSystem } from "~/modules/items/types";
import type { Role } from "~/types";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/modules/items/ui/Part/index.ts b/apps/carbon/app/modules/items/ui/Part/index.ts
new file mode 100644
index 0000000000..cda679f44c
--- /dev/null
+++ b/apps/carbon/app/modules/items/ui/Part/index.ts
@@ -0,0 +1,6 @@
+import PartForm from "./PartForm";
+import PartHeader from "./PartHeader";
+import PartManufacturingForm from "./PartManufacturingForm";
+import PartSidebar from "./PartSidebar";
+
+export { PartForm, PartHeader, PartManufacturingForm, PartSidebar };
diff --git a/apps/carbon/app/modules/parts/ui/Parts/PartsTable.tsx b/apps/carbon/app/modules/items/ui/Parts/PartsTable.tsx
similarity index 99%
rename from apps/carbon/app/modules/parts/ui/Parts/PartsTable.tsx
rename to apps/carbon/app/modules/items/ui/Parts/PartsTable.tsx
index a3752e872c..56cb6979fe 100644
--- a/apps/carbon/app/modules/parts/ui/Parts/PartsTable.tsx
+++ b/apps/carbon/app/modules/items/ui/Parts/PartsTable.tsx
@@ -7,8 +7,8 @@ import { LuPencil } from "react-icons/lu";
import { EmployeeAvatar, Hyperlink, New, Table } from "~/components";
import { usePermissions, useUrlParams } from "~/hooks";
import { useCustomColumns } from "~/hooks/useCustomColumns";
-import type { Part } from "~/modules/parts";
-import { itemInventoryTypes, partReplenishmentSystems } from "~/modules/parts";
+import type { Part } from "~/modules/items";
+import { itemInventoryTypes, partReplenishmentSystems } from "~/modules/items";
import { usePeople } from "~/stores";
import type { ListItem } from "~/types";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/modules/parts/ui/Parts/index.ts b/apps/carbon/app/modules/items/ui/Parts/index.ts
similarity index 100%
rename from apps/carbon/app/modules/parts/ui/Parts/index.ts
rename to apps/carbon/app/modules/items/ui/Parts/index.ts
diff --git a/apps/carbon/app/modules/parts/ui/Routing/PartsTree.tsx b/apps/carbon/app/modules/items/ui/Routing/PartsTree.tsx
similarity index 100%
rename from apps/carbon/app/modules/parts/ui/Routing/PartsTree.tsx
rename to apps/carbon/app/modules/items/ui/Routing/PartsTree.tsx
diff --git a/apps/carbon/app/modules/parts/ui/Routing/index.ts b/apps/carbon/app/modules/items/ui/Routing/index.ts
similarity index 100%
rename from apps/carbon/app/modules/parts/ui/Routing/index.ts
rename to apps/carbon/app/modules/items/ui/Routing/index.ts
diff --git a/apps/carbon/app/modules/parts/ui/Service/ServiceForm.tsx b/apps/carbon/app/modules/items/ui/Service/ServiceForm.tsx
similarity index 98%
rename from apps/carbon/app/modules/parts/ui/Service/ServiceForm.tsx
rename to apps/carbon/app/modules/items/ui/Service/ServiceForm.tsx
index fedba114d0..3e14b3779d 100644
--- a/apps/carbon/app/modules/parts/ui/Service/ServiceForm.tsx
+++ b/apps/carbon/app/modules/items/ui/Service/ServiceForm.tsx
@@ -23,7 +23,7 @@ import {
} from "~/components/Form";
import { usePermissions, useUser } from "~/hooks";
import { useSupabase } from "~/lib/supabase";
-import { serviceType, serviceValidator } from "~/modules/parts";
+import { serviceType, serviceValidator } from "~/modules/items";
type ServiceFormProps = {
initialValues: z.infer<typeof serviceValidator>;
diff --git a/apps/carbon/app/modules/parts/ui/Service/ServiceHeader.tsx b/apps/carbon/app/modules/items/ui/Service/ServiceHeader.tsx
similarity index 98%
rename from apps/carbon/app/modules/parts/ui/Service/ServiceHeader.tsx
rename to apps/carbon/app/modules/items/ui/Service/ServiceHeader.tsx
index eaa1345f4f..d18c13a968 100644
--- a/apps/carbon/app/modules/parts/ui/Service/ServiceHeader.tsx
+++ b/apps/carbon/app/modules/items/ui/Service/ServiceHeader.tsx
@@ -18,7 +18,7 @@ import {
import { useParams } from "@remix-run/react";
import { Assign, EmployeeAvatar, useOptimisticAssignment } from "~/components";
import { usePermissions, useRouteData } from "~/hooks";
-import type { Service } from "~/modules/parts";
+import type { Service } from "~/modules/items";
import { path } from "~/utils/path";
const ServiceHeader = () => {
diff --git a/apps/carbon/app/modules/parts/ui/Service/ServiceSidebar/ServiceSidebar.tsx b/apps/carbon/app/modules/items/ui/Service/ServiceSidebar/ServiceSidebar.tsx
similarity index 92%
rename from apps/carbon/app/modules/parts/ui/Service/ServiceSidebar/ServiceSidebar.tsx
rename to apps/carbon/app/modules/items/ui/Service/ServiceSidebar/ServiceSidebar.tsx
index ff2fd5204f..104c18f315 100644
--- a/apps/carbon/app/modules/parts/ui/Service/ServiceSidebar/ServiceSidebar.tsx
+++ b/apps/carbon/app/modules/items/ui/Service/ServiceSidebar/ServiceSidebar.tsx
@@ -1,7 +1,7 @@
import { useParams } from "@remix-run/react";
import { DetailSidebar } from "~/components/Layout";
import { useRouteData } from "~/hooks";
-import type { Service } from "~/modules/parts/types";
+import type { Service } from "~/modules/items/types";
import { path } from "~/utils/path";
import { useServiceSidebar } from "./useServiceSidebar";
diff --git a/apps/carbon/app/modules/parts/ui/Service/ServiceSidebar/index.ts b/apps/carbon/app/modules/items/ui/Service/ServiceSidebar/index.ts
similarity index 100%
rename from apps/carbon/app/modules/parts/ui/Service/ServiceSidebar/index.ts
rename to apps/carbon/app/modules/items/ui/Service/ServiceSidebar/index.ts
diff --git a/apps/carbon/app/modules/parts/ui/Service/ServiceSidebar/useServiceSidebar.tsx b/apps/carbon/app/modules/items/ui/Service/ServiceSidebar/useServiceSidebar.tsx
similarity index 91%
rename from apps/carbon/app/modules/parts/ui/Service/ServiceSidebar/useServiceSidebar.tsx
rename to apps/carbon/app/modules/items/ui/Service/ServiceSidebar/useServiceSidebar.tsx
index f755f53a19..945d602bef 100644
--- a/apps/carbon/app/modules/parts/ui/Service/ServiceSidebar/useServiceSidebar.tsx
+++ b/apps/carbon/app/modules/items/ui/Service/ServiceSidebar/useServiceSidebar.tsx
@@ -1,6 +1,6 @@
import { LuFileText, LuShare2 } from "react-icons/lu";
import { usePermissions } from "~/hooks";
-import type { ServiceType } from "~/modules/parts/types";
+import type { ServiceType } from "~/modules/items/types";
import type { Role } from "~/types";
export function useServiceSidebar(type: ServiceType) {
diff --git a/apps/carbon/app/modules/parts/ui/Service/index.ts b/apps/carbon/app/modules/items/ui/Service/index.ts
similarity index 100%
rename from apps/carbon/app/modules/parts/ui/Service/index.ts
rename to apps/carbon/app/modules/items/ui/Service/index.ts
diff --git a/apps/carbon/app/modules/parts/ui/Services/ServicesTable.tsx b/apps/carbon/app/modules/items/ui/Services/ServicesTable.tsx
similarity index 98%
rename from apps/carbon/app/modules/parts/ui/Services/ServicesTable.tsx
rename to apps/carbon/app/modules/items/ui/Services/ServicesTable.tsx
index f2d474d8b3..0501348079 100644
--- a/apps/carbon/app/modules/parts/ui/Services/ServicesTable.tsx
+++ b/apps/carbon/app/modules/items/ui/Services/ServicesTable.tsx
@@ -7,8 +7,8 @@ import { LuPencil } from "react-icons/lu";
import { EmployeeAvatar, Hyperlink, New, Table } from "~/components";
import { usePermissions } from "~/hooks";
import { useCustomColumns } from "~/hooks/useCustomColumns";
-import type { Service } from "~/modules/parts";
-import { serviceType } from "~/modules/parts";
+import type { Service } from "~/modules/items";
+import { serviceType } from "~/modules/items";
import { usePeople } from "~/stores";
import type { ListItem } from "~/types";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/modules/parts/ui/Services/index.ts b/apps/carbon/app/modules/items/ui/Services/index.ts
similarity index 100%
rename from apps/carbon/app/modules/parts/ui/Services/index.ts
rename to apps/carbon/app/modules/items/ui/Services/index.ts
diff --git a/apps/carbon/app/modules/parts/ui/UnitOfMeasure/UnitOfMeasureForm.tsx b/apps/carbon/app/modules/items/ui/UnitOfMeasure/UnitOfMeasureForm.tsx
similarity index 98%
rename from apps/carbon/app/modules/parts/ui/UnitOfMeasure/UnitOfMeasureForm.tsx
rename to apps/carbon/app/modules/items/ui/UnitOfMeasure/UnitOfMeasureForm.tsx
index adb0284190..8cdc699f3f 100644
--- a/apps/carbon/app/modules/parts/ui/UnitOfMeasure/UnitOfMeasureForm.tsx
+++ b/apps/carbon/app/modules/items/ui/UnitOfMeasure/UnitOfMeasureForm.tsx
@@ -24,7 +24,7 @@ import {
Submit,
} from "~/components/Form";
import { usePermissions } from "~/hooks";
-import { unitOfMeasureValidator } from "~/modules/parts";
+import { unitOfMeasureValidator } from "~/modules/items";
import { path } from "~/utils/path";
type UnitOfMeasureFormProps = {
diff --git a/apps/carbon/app/modules/parts/ui/UnitOfMeasure/UnitOfMeasuresTable.tsx b/apps/carbon/app/modules/items/ui/UnitOfMeasure/UnitOfMeasuresTable.tsx
similarity index 98%
rename from apps/carbon/app/modules/parts/ui/UnitOfMeasure/UnitOfMeasuresTable.tsx
rename to apps/carbon/app/modules/items/ui/UnitOfMeasure/UnitOfMeasuresTable.tsx
index 7b1c62da5f..4c9fd687a1 100644
--- a/apps/carbon/app/modules/parts/ui/UnitOfMeasure/UnitOfMeasuresTable.tsx
+++ b/apps/carbon/app/modules/items/ui/UnitOfMeasure/UnitOfMeasuresTable.tsx
@@ -6,7 +6,7 @@ import { LuPencil, LuTrash } from "react-icons/lu";
import { New, Table } from "~/components";
import { usePermissions, useUrlParams } from "~/hooks";
import { useCustomColumns } from "~/hooks/useCustomColumns";
-import type { UnitOfMeasure } from "~/modules/parts";
+import type { UnitOfMeasure } from "~/modules/items";
import { path } from "~/utils/path";
type UnitOfMeasuresTableProps = {
diff --git a/apps/carbon/app/modules/parts/ui/UnitOfMeasure/index.ts b/apps/carbon/app/modules/items/ui/UnitOfMeasure/index.ts
similarity index 100%
rename from apps/carbon/app/modules/parts/ui/UnitOfMeasure/index.ts
rename to apps/carbon/app/modules/items/ui/UnitOfMeasure/index.ts
diff --git a/apps/carbon/app/modules/parts/ui/index.ts b/apps/carbon/app/modules/items/ui/index.ts
similarity index 100%
rename from apps/carbon/app/modules/parts/ui/index.ts
rename to apps/carbon/app/modules/items/ui/index.ts
diff --git a/apps/carbon/app/modules/parts/ui/usePartsSubmodules.tsx b/apps/carbon/app/modules/items/ui/usePartsSubmodules.tsx
similarity index 100%
rename from apps/carbon/app/modules/parts/ui/usePartsSubmodules.tsx
rename to apps/carbon/app/modules/items/ui/usePartsSubmodules.tsx
diff --git a/apps/carbon/app/modules/parts/ui/Item/index.ts b/apps/carbon/app/modules/parts/ui/Item/index.ts
deleted file mode 100644
index d8ac715557..0000000000
--- a/apps/carbon/app/modules/parts/ui/Item/index.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-import ItemForm from "./ItemForm";
-import ItemSupplierForm from "./ItemSupplierForm";
-import ItemSuppliers from "./ItemSuppliers";
-
-export { ItemForm, ItemSupplierForm, ItemSuppliers };
diff --git a/apps/carbon/app/modules/parts/ui/Part/index.ts b/apps/carbon/app/modules/parts/ui/Part/index.ts
deleted file mode 100644
index 18c5957caf..0000000000
--- a/apps/carbon/app/modules/parts/ui/Part/index.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import PartCostingForm from "./PartCostingForm";
-import PartForm from "./PartForm";
-import PartHeader from "./PartHeader";
-import PartInventoryForm from "./PartInventoryForm";
-import PartManufacturingForm from "./PartManufacturingForm";
-import PartPlanningForm from "./PartPlanningForm";
-import PartPurchasingForm from "./PartPurchasingForm";
-import PartSalePriceForm from "./PartSalePriceForm";
-import PartSidebar from "./PartSidebar";
-
-export {
- PartCostingForm,
- PartForm,
- PartHeader,
- PartInventoryForm,
- PartManufacturingForm,
- PartPlanningForm,
- PartPurchasingForm,
- PartSalePriceForm,
- PartSidebar,
-};
diff --git a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderLineForm.tsx b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderLineForm.tsx
index b543f8fab6..6bbe69b873 100644
--- a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderLineForm.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderLineForm.tsx
@@ -31,7 +31,7 @@ import {
} from "~/components/Form";
import { usePermissions, useRouteData, useUser } from "~/hooks";
import { useSupabase } from "~/lib/supabase";
-import type { getShelvesList } from "~/modules/parts";
+import type { getShelvesList } from "~/modules/items";
import type {
PurchaseOrder,
PurchaseOrderLineType,
diff --git a/apps/carbon/app/modules/sales/ui/SalesOrder/SalesOrderLineForm.tsx b/apps/carbon/app/modules/sales/ui/SalesOrder/SalesOrderLineForm.tsx
index 5317a6e2a7..31240b1c96 100644
--- a/apps/carbon/app/modules/sales/ui/SalesOrder/SalesOrderLineForm.tsx
+++ b/apps/carbon/app/modules/sales/ui/SalesOrder/SalesOrderLineForm.tsx
@@ -26,7 +26,7 @@ import {
} from "~/components/Form";
import { usePermissions, useRouteData, useUser } from "~/hooks";
import { useSupabase } from "~/lib/supabase";
-import type { getShelvesList } from "~/modules/parts";
+import type { getShelvesList } from "~/modules/items";
import type { SalesOrder, SalesOrderLineType } from "~/modules/sales";
import { salesOrderLineType, salesOrderLineValidator } from "~/modules/sales";
import type { ListItem } from "~/types";
diff --git a/apps/carbon/app/routes/api+/item.$type.ts b/apps/carbon/app/routes/api+/item.$type.ts
index 5204507058..fdc368a0ec 100644
--- a/apps/carbon/app/routes/api+/item.$type.ts
+++ b/apps/carbon/app/routes/api+/item.$type.ts
@@ -1,6 +1,6 @@
import { validationError, validator } from "@carbon/remix-validated-form";
import { json, type ActionFunctionArgs } from "@remix-run/node";
-import { itemValidator, updateItem } from "~/modules/parts";
+import { itemValidator, updateItem } from "~/modules/items";
import { requirePermissions } from "~/services/auth/auth.server";
import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
diff --git a/apps/carbon/app/routes/api+/items.groups.ts b/apps/carbon/app/routes/api+/items.groups.ts
index 51638db9c9..0c13a60194 100644
--- a/apps/carbon/app/routes/api+/items.groups.ts
+++ b/apps/carbon/app/routes/api+/items.groups.ts
@@ -1,6 +1,6 @@
import type { LoaderFunctionArgs } from "@remix-run/node";
import { json } from "@remix-run/node";
-import { getItemGroupsList } from "~/modules/parts";
+import { getItemGroupsList } from "~/modules/items";
import { requirePermissions } from "~/services/auth/auth.server";
export async function loader({ request }: LoaderFunctionArgs) {
diff --git a/apps/carbon/app/routes/api+/items.parts.ts b/apps/carbon/app/routes/api+/items.parts.ts
index 23807ae7bc..d648b592ea 100644
--- a/apps/carbon/app/routes/api+/items.parts.ts
+++ b/apps/carbon/app/routes/api+/items.parts.ts
@@ -1,7 +1,7 @@
import type { LoaderFunctionArgs } from "@remix-run/node";
import { json } from "@remix-run/node";
-import type { ItemReplenishmentSystem } from "~/modules/parts";
-import { getPartsList } from "~/modules/parts";
+import type { ItemReplenishmentSystem } from "~/modules/items";
+import { getPartsList } from "~/modules/items";
import { requirePermissions } from "~/services/auth/auth.server";
import { flash } from "~/services/session.server";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/api+/items.services.ts b/apps/carbon/app/routes/api+/items.services.ts
index 46bf3a9043..6e084dd6be 100644
--- a/apps/carbon/app/routes/api+/items.services.ts
+++ b/apps/carbon/app/routes/api+/items.services.ts
@@ -1,7 +1,7 @@
import type { LoaderFunctionArgs } from "@remix-run/node";
import { json } from "@remix-run/node";
-import type { ServiceType } from "~/modules/parts";
-import { getServicesList } from "~/modules/parts";
+import type { ServiceType } from "~/modules/items";
+import { getServicesList } from "~/modules/items";
import { requirePermissions } from "~/services/auth/auth.server";
import { flash } from "~/services/session.server";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/api+/items.shelf.ts b/apps/carbon/app/routes/api+/items.shelf.ts
index c6322ee45a..6d136495c0 100644
--- a/apps/carbon/app/routes/api+/items.shelf.ts
+++ b/apps/carbon/app/routes/api+/items.shelf.ts
@@ -1,6 +1,6 @@
import type { LoaderFunctionArgs } from "@remix-run/node";
import { json } from "@remix-run/node";
-import { getShelvesList } from "~/modules/parts";
+import { getShelvesList } from "~/modules/items";
import { requirePermissions } from "~/services/auth/auth.server";
export async function loader({ request }: LoaderFunctionArgs) {
diff --git a/apps/carbon/app/routes/api+/items.uoms.ts b/apps/carbon/app/routes/api+/items.uoms.ts
index 63f362a75e..a421b6ff52 100644
--- a/apps/carbon/app/routes/api+/items.uoms.ts
+++ b/apps/carbon/app/routes/api+/items.uoms.ts
@@ -1,6 +1,6 @@
import type { LoaderFunctionArgs } from "@remix-run/node";
import { json } from "@remix-run/node";
-import { getUnitOfMeasuresList } from "~/modules/parts";
+import { getUnitOfMeasuresList } from "~/modules/items";
import { requirePermissions } from "~/services/auth/auth.server";
export async function loader({ request }: LoaderFunctionArgs) {
diff --git a/apps/carbon/app/routes/x+/accounting+/groups.inventory.tsx b/apps/carbon/app/routes/x+/accounting+/groups.inventory.tsx
index e2d790c8c0..e1ea50c3d8 100644
--- a/apps/carbon/app/routes/x+/accounting+/groups.inventory.tsx
+++ b/apps/carbon/app/routes/x+/accounting+/groups.inventory.tsx
@@ -8,7 +8,7 @@ import {
InventoryPostingGroupsTable,
getInventoryPostingGroups,
} from "~/modules/accounting";
-import { getItemGroupsList } from "~/modules/parts";
+import { getItemGroupsList } from "~/modules/items";
import { getLocationsList } from "~/modules/resources";
import { requirePermissions } from "~/services/auth/auth.server";
import { flash } from "~/services/session.server";
diff --git a/apps/carbon/app/routes/x+/accounting+/groups.purchasing.tsx b/apps/carbon/app/routes/x+/accounting+/groups.purchasing.tsx
index 6e4226c8f0..f3e43ba61a 100644
--- a/apps/carbon/app/routes/x+/accounting+/groups.purchasing.tsx
+++ b/apps/carbon/app/routes/x+/accounting+/groups.purchasing.tsx
@@ -8,7 +8,7 @@ import {
PurchasingPostingGroupsTable,
getPurchasingPostingGroups,
} from "~/modules/accounting";
-import { getItemGroupsList } from "~/modules/parts";
+import { getItemGroupsList } from "~/modules/items";
import { getSupplierTypesList } from "~/modules/purchasing";
import { requirePermissions } from "~/services/auth/auth.server";
import { flash } from "~/services/session.server";
diff --git a/apps/carbon/app/routes/x+/accounting+/groups.sales.tsx b/apps/carbon/app/routes/x+/accounting+/groups.sales.tsx
index 740b880542..d759cef51e 100644
--- a/apps/carbon/app/routes/x+/accounting+/groups.sales.tsx
+++ b/apps/carbon/app/routes/x+/accounting+/groups.sales.tsx
@@ -8,7 +8,7 @@ import {
SalesPostingGroupsTable,
getSalesPostingGroups,
} from "~/modules/accounting";
-import { getItemGroupsList } from "~/modules/parts";
+import { getItemGroupsList } from "~/modules/items";
import { getCustomerTypesList } from "~/modules/sales";
import { requirePermissions } from "~/services/auth/auth.server";
import { flash } from "~/services/session.server";
diff --git a/apps/carbon/app/routes/x+/items+/_layout.tsx b/apps/carbon/app/routes/x+/items+/_layout.tsx
index 29d4c75562..3f7c986010 100644
--- a/apps/carbon/app/routes/x+/items+/_layout.tsx
+++ b/apps/carbon/app/routes/x+/items+/_layout.tsx
@@ -2,7 +2,7 @@ import { VStack } from "@carbon/react";
import type { MetaFunction } from "@remix-run/node";
import { Outlet } from "@remix-run/react";
import { GroupedContentSidebar } from "~/components/Layout";
-import { usePartsSubmodules } from "~/modules/parts";
+import { usePartsSubmodules } from "~/modules/items";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/routes/x+/items+/groups.$groupId.tsx b/apps/carbon/app/routes/x+/items+/groups.$groupId.tsx
index 6610ac0dd8..dbb064a0f6 100644
--- a/apps/carbon/app/routes/x+/items+/groups.$groupId.tsx
+++ b/apps/carbon/app/routes/x+/items+/groups.$groupId.tsx
@@ -7,7 +7,7 @@ import {
getItemGroup,
itemGroupValidator,
upsertItemGroup,
-} from "~/modules/parts";
+} from "~/modules/items";
import { requirePermissions } from "~/services/auth/auth.server";
import { flash } from "~/services/session.server";
import { getCustomFields, setCustomFields } from "~/utils/form";
diff --git a/apps/carbon/app/routes/x+/items+/groups.delete.$groupId.tsx b/apps/carbon/app/routes/x+/items+/groups.delete.$groupId.tsx
index aef7e5449b..b5403bc7fd 100644
--- a/apps/carbon/app/routes/x+/items+/groups.delete.$groupId.tsx
+++ b/apps/carbon/app/routes/x+/items+/groups.delete.$groupId.tsx
@@ -2,7 +2,7 @@ import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";
import { json, redirect } from "@remix-run/node";
import { useLoaderData, useNavigate, useParams } from "@remix-run/react";
import { ConfirmDelete } from "~/components/Modals";
-import { deleteItemGroup, getItemGroup } from "~/modules/parts";
+import { deleteItemGroup, getItemGroup } from "~/modules/items";
import { requirePermissions } from "~/services/auth/auth.server";
import { flash } from "~/services/session.server";
import { notFound } from "~/utils/http";
diff --git a/apps/carbon/app/routes/x+/items+/groups.new.tsx b/apps/carbon/app/routes/x+/items+/groups.new.tsx
index 41e01a5e22..a2da270e04 100644
--- a/apps/carbon/app/routes/x+/items+/groups.new.tsx
+++ b/apps/carbon/app/routes/x+/items+/groups.new.tsx
@@ -6,7 +6,7 @@ import {
ItemGroupForm,
itemGroupValidator,
upsertItemGroup,
-} from "~/modules/parts";
+} from "~/modules/items";
import { requirePermissions } from "~/services/auth/auth.server";
import { flash } from "~/services/session.server";
import { setCustomFields } from "~/utils/form";
diff --git a/apps/carbon/app/routes/x+/items+/groups.tsx b/apps/carbon/app/routes/x+/items+/groups.tsx
index 28b19df1b5..c61cd0a103 100644
--- a/apps/carbon/app/routes/x+/items+/groups.tsx
+++ b/apps/carbon/app/routes/x+/items+/groups.tsx
@@ -3,7 +3,7 @@ import type { LoaderFunctionArgs } from "@remix-run/node";
import { json, redirect } from "@remix-run/node";
import { Outlet, useLoaderData } from "@remix-run/react";
import { getAccountsList } from "~/modules/accounting";
-import { ItemGroupsTable, getItemGroups } from "~/modules/parts";
+import { ItemGroupsTable, getItemGroups } from "~/modules/items";
import { requirePermissions } from "~/services/auth/auth.server";
import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
diff --git a/apps/carbon/app/routes/x+/items+/parts.tsx b/apps/carbon/app/routes/x+/items+/parts.tsx
index 103d0f5668..2f978cad55 100644
--- a/apps/carbon/app/routes/x+/items+/parts.tsx
+++ b/apps/carbon/app/routes/x+/items+/parts.tsx
@@ -2,7 +2,7 @@ import { VStack } from "@carbon/react";
import type { LoaderFunctionArgs } from "@remix-run/node";
import { json, redirect } from "@remix-run/node";
import { Outlet, useLoaderData } from "@remix-run/react";
-import { PartsTable, getItemGroupsList, getParts } from "~/modules/parts";
+import { PartsTable, getItemGroupsList, getParts } from "~/modules/items";
import { requirePermissions } from "~/services/auth/auth.server";
import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
diff --git a/apps/carbon/app/routes/x+/items+/services.tsx b/apps/carbon/app/routes/x+/items+/services.tsx
index 0b58b0ba8b..3a12f40112 100644
--- a/apps/carbon/app/routes/x+/items+/services.tsx
+++ b/apps/carbon/app/routes/x+/items+/services.tsx
@@ -2,7 +2,7 @@ import { VStack } from "@carbon/react";
import type { LoaderFunctionArgs } from "@remix-run/node";
import { json, redirect } from "@remix-run/node";
import { Outlet, useLoaderData } from "@remix-run/react";
-import { ServicesTable, getItemGroupsList, getServices } from "~/modules/parts";
+import { ServicesTable, getItemGroupsList, getServices } from "~/modules/items";
import { requirePermissions } from "~/services/auth/auth.server";
import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
diff --git a/apps/carbon/app/routes/x+/items+/uom.$uomId.tsx b/apps/carbon/app/routes/x+/items+/uom.$uomId.tsx
index 24ee529b8a..7d6ce45aa4 100644
--- a/apps/carbon/app/routes/x+/items+/uom.$uomId.tsx
+++ b/apps/carbon/app/routes/x+/items+/uom.$uomId.tsx
@@ -7,7 +7,7 @@ import {
getUnitOfMeasure,
unitOfMeasureValidator,
upsertUnitOfMeasure,
-} from "~/modules/parts";
+} from "~/modules/items";
import { requirePermissions } from "~/services/auth/auth.server";
import { flash } from "~/services/session.server";
import { getCustomFields, setCustomFields } from "~/utils/form";
diff --git a/apps/carbon/app/routes/x+/items+/uom.delete.$uomId.tsx b/apps/carbon/app/routes/x+/items+/uom.delete.$uomId.tsx
index 9e43013ef3..aa2c8882df 100644
--- a/apps/carbon/app/routes/x+/items+/uom.delete.$uomId.tsx
+++ b/apps/carbon/app/routes/x+/items+/uom.delete.$uomId.tsx
@@ -2,7 +2,7 @@ import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";
import { json, redirect } from "@remix-run/node";
import { useLoaderData, useNavigate, useParams } from "@remix-run/react";
import { ConfirmDelete } from "~/components/Modals";
-import { deleteUnitOfMeasure, getUnitOfMeasure } from "~/modules/parts";
+import { deleteUnitOfMeasure, getUnitOfMeasure } from "~/modules/items";
import { requirePermissions } from "~/services/auth/auth.server";
import { flash } from "~/services/session.server";
import { notFound } from "~/utils/http";
diff --git a/apps/carbon/app/routes/x+/items+/uom.new.tsx b/apps/carbon/app/routes/x+/items+/uom.new.tsx
index 46938a868d..40d93f9d38 100644
--- a/apps/carbon/app/routes/x+/items+/uom.new.tsx
+++ b/apps/carbon/app/routes/x+/items+/uom.new.tsx
@@ -6,7 +6,7 @@ import {
UnitOfMeasureForm,
unitOfMeasureValidator,
upsertUnitOfMeasure,
-} from "~/modules/parts";
+} from "~/modules/items";
import { requirePermissions } from "~/services/auth/auth.server";
import { flash } from "~/services/session.server";
import { setCustomFields } from "~/utils/form";
diff --git a/apps/carbon/app/routes/x+/items+/uom.tsx b/apps/carbon/app/routes/x+/items+/uom.tsx
index 50ecc81092..df6fdda921 100644
--- a/apps/carbon/app/routes/x+/items+/uom.tsx
+++ b/apps/carbon/app/routes/x+/items+/uom.tsx
@@ -2,7 +2,7 @@ import { VStack } from "@carbon/react";
import type { LoaderFunctionArgs } from "@remix-run/node";
import { json } from "@remix-run/node";
import { Outlet, useLoaderData } from "@remix-run/react";
-import { UnitOfMeasuresTable, getUnitOfMeasures } from "~/modules/parts";
+import { UnitOfMeasuresTable, getUnitOfMeasures } from "~/modules/items";
import { requirePermissions } from "~/services/auth/auth.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/routes/x+/part+/$itemId.costing.tsx b/apps/carbon/app/routes/x+/part+/$itemId.costing.tsx
index 6517ceb836..ef4d410f36 100644
--- a/apps/carbon/app/routes/x+/part+/$itemId.costing.tsx
+++ b/apps/carbon/app/routes/x+/part+/$itemId.costing.tsx
@@ -4,11 +4,11 @@ import { json, redirect } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
import { getAccountsList } from "~/modules/accounting";
import {
- PartCostingForm,
+ ItemCostingForm,
getItemCost,
itemCostValidator,
upsertItemCost,
-} from "~/modules/parts";
+} from "~/modules/items";
import { requirePermissions } from "~/services/auth/auth.server";
import { flash } from "~/services/session.server";
import { getCustomFields, setCustomFields } from "~/utils/form";
@@ -89,7 +89,7 @@ export async function action({ request, params }: ActionFunctionArgs) {
export default function PartCostingRoute() {
const { itemCost } = useLoaderData<typeof loader>();
return (
- <PartCostingForm
+ <ItemCostingForm
key={itemCost.itemId}
initialValues={{ ...itemCost, ...getCustomFields(itemCost.customFields) }}
/>
diff --git a/apps/carbon/app/routes/x+/part+/$itemId.details.tsx b/apps/carbon/app/routes/x+/part+/$itemId.details.tsx
index 7568e7dde2..e0bce46545 100644
--- a/apps/carbon/app/routes/x+/part+/$itemId.details.tsx
+++ b/apps/carbon/app/routes/x+/part+/$itemId.details.tsx
@@ -4,8 +4,8 @@ import type { ActionFunctionArgs } from "@remix-run/node";
import { redirect } from "@remix-run/node";
import { useParams } from "@remix-run/react";
import { useRouteData } from "~/hooks";
-import type { PartSummary } from "~/modules/parts";
-import { PartForm, partValidator, upsertPart } from "~/modules/parts";
+import type { PartSummary } from "~/modules/items";
+import { PartForm, partValidator, upsertPart } from "~/modules/items";
import { requirePermissions } from "~/services/auth/auth.server";
import { flash } from "~/services/session.server";
import { getCustomFields, setCustomFields } from "~/utils/form";
diff --git a/apps/carbon/app/routes/x+/part+/$itemId.inventory.tsx b/apps/carbon/app/routes/x+/part+/$itemId.inventory.tsx
index a8b45d9838..94f349357b 100644
--- a/apps/carbon/app/routes/x+/part+/$itemId.inventory.tsx
+++ b/apps/carbon/app/routes/x+/part+/$itemId.inventory.tsx
@@ -4,13 +4,13 @@ import { json, redirect } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
import { useRouteData } from "~/hooks";
import {
- PartInventoryForm,
+ ItemInventoryForm,
getItemInventory,
getItemQuantities,
getShelvesList,
itemInventoryValidator,
upsertItemInventory,
-} from "~/modules/parts";
+} from "~/modules/items";
import { getLocationsList } from "~/modules/resources";
import { getUserDefaults } from "~/modules/users/users.server";
import { requirePermissions } from "~/services/auth/auth.server";
@@ -183,7 +183,7 @@ export default function PartInventoryRoute() {
...getCustomFields(partInventory.customFields ?? {}),
};
return (
- <PartInventoryForm
+ <ItemInventoryForm
key={initialValues.itemId}
initialValues={initialValues}
quantities={quantities}
diff --git a/apps/carbon/app/routes/x+/part+/$itemId.manufacturing.tsx b/apps/carbon/app/routes/x+/part+/$itemId.manufacturing.tsx
index e027bef472..e5a89a4dc4 100644
--- a/apps/carbon/app/routes/x+/part+/$itemId.manufacturing.tsx
+++ b/apps/carbon/app/routes/x+/part+/$itemId.manufacturing.tsx
@@ -7,7 +7,7 @@ import {
getItemManufacturing,
partManufacturingValidator,
upsertItemManufacturing,
-} from "~/modules/parts";
+} from "~/modules/items";
import { requirePermissions } from "~/services/auth/auth.server";
import { flash } from "~/services/session.server";
import { getCustomFields, setCustomFields } from "~/utils/form";
diff --git a/apps/carbon/app/routes/x+/part+/$itemId.planning.tsx b/apps/carbon/app/routes/x+/part+/$itemId.planning.tsx
index 4b3d0cebe3..96bf8af220 100644
--- a/apps/carbon/app/routes/x+/part+/$itemId.planning.tsx
+++ b/apps/carbon/app/routes/x+/part+/$itemId.planning.tsx
@@ -4,11 +4,11 @@ import { json, redirect } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
import { useRouteData } from "~/hooks";
import {
- PartPlanningForm,
+ ItemPlanningForm,
getItemPlanning,
itemPlanningValidator,
upsertItemPlanning,
-} from "~/modules/parts";
+} from "~/modules/items";
import { getLocationsList } from "~/modules/resources";
import { getUserDefaults } from "~/modules/users/users.server";
import { requirePermissions } from "~/services/auth/auth.server";
@@ -150,7 +150,7 @@ export default function PartPlanningRoute() {
if (!sharedPartsData) throw new Error("Could not load shared parts data");
return (
- <PartPlanningForm
+ <ItemPlanningForm
key={partPlanning.itemId}
initialValues={{
...partPlanning,
diff --git a/apps/carbon/app/routes/x+/part+/$itemId.purchasing.tsx b/apps/carbon/app/routes/x+/part+/$itemId.purchasing.tsx
index ded30d61ec..a9688c2523 100644
--- a/apps/carbon/app/routes/x+/part+/$itemId.purchasing.tsx
+++ b/apps/carbon/app/routes/x+/part+/$itemId.purchasing.tsx
@@ -3,11 +3,11 @@ import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";
import { json, redirect } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
import {
- PartPurchasingForm,
+ ItemPurchasingForm,
getItemReplenishment,
itemPurchasingValidator,
upsertItemPurchasing,
-} from "~/modules/parts";
+} from "~/modules/items";
import { requirePermissions } from "~/services/auth/auth.server";
import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
@@ -92,7 +92,7 @@ export default function PartPurchasingRoute() {
};
return (
- <PartPurchasingForm
+ <ItemPurchasingForm
key={initialValues.itemId}
initialValues={initialValues}
/>
diff --git a/apps/carbon/app/routes/x+/part+/$itemId.sale-price.tsx b/apps/carbon/app/routes/x+/part+/$itemId.sale-price.tsx
index 4067b4e4dd..d7c662988b 100644
--- a/apps/carbon/app/routes/x+/part+/$itemId.sale-price.tsx
+++ b/apps/carbon/app/routes/x+/part+/$itemId.sale-price.tsx
@@ -3,11 +3,11 @@ import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";
import { json, redirect } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
import {
- PartSalePriceForm,
+ ItemSalePriceForm,
getItemUnitSalePrice,
itemUnitSalePriceValidator,
upsertItemUnitSalePrice,
-} from "~/modules/parts";
+} from "~/modules/items";
import { requirePermissions } from "~/services/auth/auth.server";
import { flash } from "~/services/session.server";
import { getCustomFields, setCustomFields } from "~/utils/form";
@@ -92,7 +92,7 @@ export default function PartSalePriceRoute() {
};
return (
- <PartSalePriceForm
+ <ItemSalePriceForm
key={initialValues.itemId}
initialValues={initialValues}
/>
diff --git a/apps/carbon/app/routes/x+/part+/$itemId.suppliers.new.tsx b/apps/carbon/app/routes/x+/part+/$itemId.suppliers.new.tsx
index c6edf5b0d8..b54ff8bc90 100644
--- a/apps/carbon/app/routes/x+/part+/$itemId.suppliers.new.tsx
+++ b/apps/carbon/app/routes/x+/part+/$itemId.suppliers.new.tsx
@@ -6,7 +6,7 @@ import {
ItemSupplierForm,
itemSupplierValidator,
upsertItemSupplier,
-} from "~/modules/parts";
+} from "~/modules/items";
import { requirePermissions } from "~/services/auth/auth.server";
import { flash } from "~/services/session.server";
import { setCustomFields } from "~/utils/form";
diff --git a/apps/carbon/app/routes/x+/part+/$itemId.suppliers.tsx b/apps/carbon/app/routes/x+/part+/$itemId.suppliers.tsx
index 6249b2ea8a..d70d7ea8a4 100644
--- a/apps/carbon/app/routes/x+/part+/$itemId.suppliers.tsx
+++ b/apps/carbon/app/routes/x+/part+/$itemId.suppliers.tsx
@@ -1,7 +1,7 @@
import type { LoaderFunctionArgs } from "@remix-run/node";
import { json, redirect } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
-import { ItemSuppliers, getItemSuppliers } from "~/modules/parts";
+import { ItemSuppliers, getItemSuppliers } from "~/modules/items";
import { requirePermissions } from "~/services/auth/auth.server";
import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/routes/x+/part+/$itemId.tsx b/apps/carbon/app/routes/x+/part+/$itemId.tsx
index 8c3826e337..a1747dad17 100644
--- a/apps/carbon/app/routes/x+/part+/$itemId.tsx
+++ b/apps/carbon/app/routes/x+/part+/$itemId.tsx
@@ -1,7 +1,7 @@
import type { LoaderFunctionArgs } from "@remix-run/node";
import { json, redirect } from "@remix-run/node";
import { Outlet } from "@remix-run/react";
-import { PartHeader, PartSidebar, getPart } from "~/modules/parts";
+import { PartHeader, PartSidebar, getPart } from "~/modules/items";
import { requirePermissions } from "~/services/auth/auth.server";
import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/routes/x+/part+/_layout.tsx b/apps/carbon/app/routes/x+/part+/_layout.tsx
index 5469b22111..1a4d0aba1f 100644
--- a/apps/carbon/app/routes/x+/part+/_layout.tsx
+++ b/apps/carbon/app/routes/x+/part+/_layout.tsx
@@ -1,7 +1,7 @@
import { VStack } from "@carbon/react";
import type { LoaderFunctionArgs, MetaFunction } from "@remix-run/node";
import { Outlet } from "@remix-run/react";
-import { getUnitOfMeasuresList } from "~/modules/parts";
+import { getUnitOfMeasuresList } from "~/modules/items";
import { getLocationsList } from "~/modules/resources";
import { requirePermissions } from "~/services/auth/auth.server";
import type { Handle } from "~/utils/handle";
diff --git a/apps/carbon/app/routes/x+/part+/new.tsx b/apps/carbon/app/routes/x+/part+/new.tsx
index bfc07be195..3a05b560f2 100644
--- a/apps/carbon/app/routes/x+/part+/new.tsx
+++ b/apps/carbon/app/routes/x+/part+/new.tsx
@@ -1,7 +1,7 @@
import { validationError, validator } from "@carbon/remix-validated-form";
import type { ActionFunctionArgs } from "@remix-run/node";
import { json, redirect } from "@remix-run/node";
-import { PartForm, partValidator, upsertPart } from "~/modules/parts";
+import { PartForm, partValidator, upsertPart } from "~/modules/items";
import { requirePermissions } from "~/services/auth/auth.server";
import { flash } from "~/services/session.server";
import { setCustomFields } from "~/utils/form";
diff --git a/apps/carbon/app/routes/x+/receipt+/_layout.tsx b/apps/carbon/app/routes/x+/receipt+/_layout.tsx
index 03b5de1045..54383ab1b6 100644
--- a/apps/carbon/app/routes/x+/receipt+/_layout.tsx
+++ b/apps/carbon/app/routes/x+/receipt+/_layout.tsx
@@ -1,7 +1,7 @@
import { VStack } from "@carbon/react";
import type { LoaderFunctionArgs, MetaFunction } from "@remix-run/node";
import { Outlet } from "@remix-run/react";
-import { getUnitOfMeasuresList } from "~/modules/parts";
+import { getUnitOfMeasuresList } from "~/modules/items";
import { getLocationsList } from "~/modules/resources";
import { requirePermissions } from "~/services/auth/auth.server";
import type { Handle } from "~/utils/handle";
diff --git a/apps/carbon/app/routes/x+/service+/$itemId.details.tsx b/apps/carbon/app/routes/x+/service+/$itemId.details.tsx
index bb1d82afc4..19f0f33783 100644
--- a/apps/carbon/app/routes/x+/service+/$itemId.details.tsx
+++ b/apps/carbon/app/routes/x+/service+/$itemId.details.tsx
@@ -4,8 +4,8 @@ import type { ActionFunctionArgs } from "@remix-run/node";
import { redirect } from "@remix-run/node";
import { useParams } from "@remix-run/react";
import { useRouteData } from "~/hooks";
-import type { Service } from "~/modules/parts";
-import { ServiceForm, serviceValidator, upsertService } from "~/modules/parts";
+import type { Service } from "~/modules/items";
+import { ServiceForm, serviceValidator, upsertService } from "~/modules/items";
import { requirePermissions } from "~/services/auth/auth.server";
import { flash } from "~/services/session.server";
import { getCustomFields, setCustomFields } from "~/utils/form";
diff --git a/apps/carbon/app/routes/x+/service+/$itemId.suppliers.new.tsx b/apps/carbon/app/routes/x+/service+/$itemId.suppliers.new.tsx
index d1dda326f8..5b7e459460 100644
--- a/apps/carbon/app/routes/x+/service+/$itemId.suppliers.new.tsx
+++ b/apps/carbon/app/routes/x+/service+/$itemId.suppliers.new.tsx
@@ -6,7 +6,7 @@ import {
ItemSupplierForm,
itemSupplierValidator,
upsertItemSupplier,
-} from "~/modules/parts";
+} from "~/modules/items";
import { requirePermissions } from "~/services/auth/auth.server";
import { flash } from "~/services/session.server";
import { setCustomFields } from "~/utils/form";
diff --git a/apps/carbon/app/routes/x+/service+/$itemId.suppliers.tsx b/apps/carbon/app/routes/x+/service+/$itemId.suppliers.tsx
index ae8612cc84..95cfe1e457 100644
--- a/apps/carbon/app/routes/x+/service+/$itemId.suppliers.tsx
+++ b/apps/carbon/app/routes/x+/service+/$itemId.suppliers.tsx
@@ -1,8 +1,8 @@
import type { LoaderFunctionArgs } from "@remix-run/node";
import { json, redirect } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
-import { getItemSuppliers } from "~/modules/parts";
-import ItemSuppliers from "~/modules/parts/ui/Item/ItemSuppliers/ItemSuppliers";
+import { getItemSuppliers } from "~/modules/items";
+import ItemSuppliers from "~/modules/items/ui/Item/ItemSuppliers/ItemSuppliers";
import { requirePermissions } from "~/services/auth/auth.server";
import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/routes/x+/service+/$itemId.tsx b/apps/carbon/app/routes/x+/service+/$itemId.tsx
index ab917f7733..2148cf93d5 100644
--- a/apps/carbon/app/routes/x+/service+/$itemId.tsx
+++ b/apps/carbon/app/routes/x+/service+/$itemId.tsx
@@ -1,7 +1,7 @@
import type { LoaderFunctionArgs } from "@remix-run/node";
import { json, redirect } from "@remix-run/node";
import { Outlet } from "@remix-run/react";
-import { ServiceHeader, ServiceSidebar, getService } from "~/modules/parts";
+import { ServiceHeader, ServiceSidebar, getService } from "~/modules/items";
import { requirePermissions } from "~/services/auth/auth.server";
import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
diff --git a/apps/carbon/app/routes/x+/service+/_layout.tsx b/apps/carbon/app/routes/x+/service+/_layout.tsx
index d8eeccca5c..a1d9de3a5d 100644
--- a/apps/carbon/app/routes/x+/service+/_layout.tsx
+++ b/apps/carbon/app/routes/x+/service+/_layout.tsx
@@ -1,7 +1,7 @@
import { VStack } from "@carbon/react";
import type { LoaderFunctionArgs, MetaFunction } from "@remix-run/node";
import { Outlet } from "@remix-run/react";
-import { getItemGroupsList } from "~/modules/parts";
+import { getItemGroupsList } from "~/modules/items";
import { getLocationsList } from "~/modules/resources";
import { requirePermissions } from "~/services/auth/auth.server";
import type { Handle } from "~/utils/handle";
diff --git a/apps/carbon/app/routes/x+/service+/new.tsx b/apps/carbon/app/routes/x+/service+/new.tsx
index abd3b33420..e3e000b9b9 100644
--- a/apps/carbon/app/routes/x+/service+/new.tsx
+++ b/apps/carbon/app/routes/x+/service+/new.tsx
@@ -1,7 +1,7 @@
import { validationError, validator } from "@carbon/remix-validated-form";
import type { ActionFunctionArgs } from "@remix-run/node";
import { redirect } from "@remix-run/node";
-import { ServiceForm, serviceValidator, upsertService } from "~/modules/parts";
+import { ServiceForm, serviceValidator, upsertService } from "~/modules/items";
import { requirePermissions } from "~/services/auth/auth.server";
import { flash } from "~/services/session.server";
import { setCustomFields } from "~/utils/form";
diff --git a/packages/database/src/types.ts b/packages/database/src/types.ts
index dd4c943a85..98cd6a8c62 100644
--- a/packages/database/src/types.ts
+++ b/packages/database/src/types.ts
@@ -19737,6 +19737,7 @@ export type Database = {
| null
supplierIds: string[] | null
toDate: string | null
+ unitOfMeasure: string | null
unitOfMeasureCode: string | null
updatedAt: string | null
updatedBy: string | null
diff --git a/packages/database/supabase/functions/lib/types.ts b/packages/database/supabase/functions/lib/types.ts
index dd4c943a85..98cd6a8c62 100644
--- a/packages/database/supabase/functions/lib/types.ts
+++ b/packages/database/supabase/functions/lib/types.ts
@@ -19737,6 +19737,7 @@ export type Database = {
| null
supplierIds: string[] | null
toDate: string | null
+ unitOfMeasure: string | null
unitOfMeasureCode: string | null
updatedAt: string | null
updatedBy: string | null
diff --git a/packages/database/supabase/migrations/20230330024716_parts.sql b/packages/database/supabase/migrations/20230330024716_parts.sql
index 09f6859a47..91e2d1ea80 100644
--- a/packages/database/supabase/migrations/20230330024716_parts.sql
+++ b/packages/database/supabase/migrations/20230330024716_parts.sql
@@ -96,6 +96,38 @@ CREATE INDEX "item_companyId_idx" ON "item" ("companyId");
CREATE INDEX "item_name_companyId_idx" ON "item" ("name", "companyId");
CREATE INDEX "item_type_companyId_idx" ON "item" ("type", "companyId");
+ALTER TABLE "item" ENABLE ROW LEVEL SECURITY;
+
+CREATE POLICY "Employees can view items" ON "item"
+ FOR SELECT
+ USING (
+ has_role('employee')
+ AND "companyId" = ANY(
+ select "companyId" from "userToCompany" where "userId" = auth.uid()::text
+ )
+ );
+
+CREATE POLICY "Employees with parts_create can insert items" ON "item"
+ FOR INSERT
+ WITH CHECK (
+ has_role('employee') AND
+ has_company_permission('parts_create', "companyId")
+ );
+
+CREATE POLICY "Employees with parts_update can update items" ON "item"
+ FOR UPDATE
+ USING (
+ has_role('employee') AND
+ has_company_permission('parts_update', "companyId")
+ );
+
+CREATE POLICY "Employees with parts_delete can delete items" ON "item"
+ FOR DELETE
+ USING (
+ has_role('employee') AND
+ has_company_permission('parts_delete', "companyId")
+ );
+
CREATE TYPE "itemReplenishmentSystem" AS ENUM (
'Buy',
diff --git a/packages/database/supabase/migrations/20230704161623_parts-view.sql b/packages/database/supabase/migrations/20230704161623_parts-view.sql
index a9ba849e32..6a0f1274b4 100644
--- a/packages/database/supabase/migrations/20230704161623_parts-view.sql
+++ b/packages/database/supabase/migrations/20230704161623_parts-view.sql
@@ -7,6 +7,7 @@ CREATE OR REPLACE VIEW "parts" AS
i."itemGroupId",
i."itemInventoryType",
pg.name AS "itemGroup",
+ uom.name as "unitOfMeasure",
p."replenishmentSystem",
i.active,
i.blocked,
@@ -17,6 +18,7 @@ CREATE OR REPLACE VIEW "parts" AS
INNER JOIN "item" i ON i.id = p."itemId"
LEFT JOIN "itemGroup" pg ON pg.id = i."itemGroupId"
LEFT JOIN "itemSupplier" s ON s."itemId" = p."itemId"
+ LEFT JOIN "unitOfMeasure" uom ON uom.code = p."unitOfMeasureCode" AND uom."companyId" = p."companyId"
GROUP BY p.id,
i.name,
i.description,
@@ -27,5 +29,6 @@ CREATE OR REPLACE VIEW "parts" AS
i.active,
i.blocked,
p."customFields",
- p."companyId";
+ p."companyId",
+ uom.name;
diff --git a/packages/database/supabase/migrations/20240324175747_assignee.sql b/packages/database/supabase/migrations/20240324175747_assignee.sql
index c57b2de370..4b77b9284e 100644
--- a/packages/database/supabase/migrations/20240324175747_assignee.sql
+++ b/packages/database/supabase/migrations/20240324175747_assignee.sql
@@ -19,7 +19,8 @@ CREATE OR REPLACE VIEW "parts" WITH(SECURITY_INVOKER=true) AS
i.blocked,
p.*,
pg.name AS "itemGroup",
- ps."supplierIds"
+ ps."supplierIds",
+ uom.name as "unitOfMeasure"
FROM "part" p
INNER JOIN "item" i ON i.id = p."itemId"
LEFT JOIN "itemGroup" pg ON pg.id = i."itemGroupId"
@@ -29,7 +30,8 @@ CREATE OR REPLACE VIEW "parts" WITH(SECURITY_INVOKER=true) AS
array_agg(ps."supplierId") AS "supplierIds"
FROM "itemSupplier" ps
GROUP BY "itemId"
- ) ps ON ps."itemId" = p."itemId";
+ ) ps ON ps."itemId" = p."itemId"
+ LEFT JOIN "unitOfMeasure" uom ON uom.code = p."unitOfMeasureCode" AND uom."companyId" = p."companyId";
DROP VIEW "purchaseOrders";
CREATE OR REPLACE VIEW "purchaseOrders" WITH(SECURITY_INVOKER=true) AS