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.
TypeScript ai-agentsbill-of-materialserpinventory-managementleanmanufacturingmanufacturing-execution-systemmcp-servermesmrpopen-source-erppostgresqlproduction-planningqmsquality-management-systemreact-routerself-hostedsupabasetraceabilitytypescript
Partners (#24)
Brad Barbin25c2c977a1c5
diff --git a/SCHEMA.md b/SCHEMA.mdindex c65fa6f70c..95d642f798 100644--- a/SCHEMA.md+++ b/SCHEMA.md@@ -2251,6 +2251,7 @@ CREATE TABLE "employeeJob" ("shiftId" TEXT,"managerId" TEXT,"title" TEXT,+ "startDate" DATE,CONSTRAINT "employeeJob_pkey" PRIMARY KEY ("id"),CONSTRAINT "employeeJob_id_fkey" FOREIGN KEY ("id") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE CASCADE,@@ -2480,3 +2481,24 @@ CREATE TABLE "holiday" (CREATE VIEW "holiday_years" AS SELECT DISTINCT "year" FROM "holiday";```+++## `partners`++```sql+CREATE TABLE "partner" (+ "id" TEXT NOT NULL,+ "hoursPerWeek" INTEGER NOT NULL DEFAULT 0,+ "active" BOOLEAN NOT NULL DEFAULT true,+ "createdBy" TEXT NOT NULL,+ "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),+ "updatedBy" TEXT,+ "updatedAt" TIMESTAMP WITH TIME ZONE,++ CONSTRAINT "partner_pkey" PRIMARY KEY ("id"),+ CONSTRAINT "partner_id_fkey" FOREIGN KEY ("id") REFERENCES "supplier"("id"),+ CONSTRAINT "partner_createdBy_fkey" FOREIGN KEY ("createdBy") REFERENCES "user"("id"),+ CONSTRAINT "partner_updatedBy_fkey" FOREIGN KEY ("updatedBy") REFERENCES "user"("id")+);+```+diff --git a/apps/carbon/app/components/Form/Ability.tsx b/apps/carbon/app/components/Form/Ability.tsxindex 822405dd6b..25397fb801 100644--- a/apps/carbon/app/components/Form/Ability.tsx+++ b/apps/carbon/app/components/Form/Ability.tsx@@ -9,7 +9,7 @@ import {import { useFetcher } from "@remix-run/react";import { useEffect, useMemo } from "react";import { useField } from "remix-validated-form";-import type { getAbilitiesList } from "~/services/resources";+import type { getAbilitiesList } from "~/modules/resources";import { mapRowsToOptions } from "~/utils/form";import type { SelectProps } from "./Select";diff --git a/apps/carbon/app/components/Form/Customer.tsx b/apps/carbon/app/components/Form/Customer.tsxindex 0ecd12b484..f4afcf815d 100644--- a/apps/carbon/app/components/Form/Customer.tsx+++ b/apps/carbon/app/components/Form/Customer.tsx@@ -9,7 +9,7 @@ import {import { useFetcher } from "@remix-run/react";import { useEffect, useMemo } from "react";import { useField } from "remix-validated-form";-import type { getCustomersList } from "~/services/sales";+import type { getCustomersList } from "~/modules/sales";import { mapRowsToOptions } from "~/utils/form";import type { SelectProps } from "./Select";diff --git a/apps/carbon/app/components/Form/CustomerContact.tsx b/apps/carbon/app/components/Form/CustomerContact.tsxindex 12385a7d26..256a696a0d 100644--- a/apps/carbon/app/components/Form/CustomerContact.tsx+++ b/apps/carbon/app/components/Form/CustomerContact.tsx@@ -9,8 +9,8 @@ import {import { useFetcher } from "@remix-run/react";import { useEffect, useMemo, useRef } from "react";import { useControlField, useField } from "remix-validated-form";-import type { CustomerContact as CustomerContactType } from "~/interfaces/Sales/types";-import type { getCustomerContacts } from "~/services/sales";+import type { CustomerContact as CustomerContactType } from "~/modules/sales";+import type { getCustomerContacts } from "~/modules/sales";import type { SelectProps } from "./Select";type CustomerContactSelectProps = Omit<SelectProps, "options" | "onChange"> & {diff --git a/apps/carbon/app/components/Form/Department.tsx b/apps/carbon/app/components/Form/Department.tsxindex 14c1072333..1718ec2392 100644--- a/apps/carbon/app/components/Form/Department.tsx+++ b/apps/carbon/app/components/Form/Department.tsx@@ -9,7 +9,7 @@ import {import { useFetcher } from "@remix-run/react";import { useEffect, useMemo } from "react";import { useField } from "remix-validated-form";-import type { getDepartmentsList } from "~/services/resources";+import type { getDepartmentsList } from "~/modules/resources";import { mapRowsToOptions } from "~/utils/form";import type { SelectProps } from "./Select";diff --git a/apps/carbon/app/components/Form/Location.tsx b/apps/carbon/app/components/Form/Location.tsxindex 4535dca23c..ae8530dbe1 100644--- a/apps/carbon/app/components/Form/Location.tsx+++ b/apps/carbon/app/components/Form/Location.tsx@@ -9,7 +9,7 @@ import {import { useFetcher } from "@remix-run/react";import { useEffect, useMemo } from "react";import { useField } from "remix-validated-form";-import type { getLocationsList } from "~/services/resources";+import type { getLocationsList } from "~/modules/resources";import { mapRowsToOptions } from "~/utils/form";import type { SelectProps } from "./Select";diff --git a/apps/carbon/app/components/Form/Supplier.tsx b/apps/carbon/app/components/Form/Supplier.tsxindex 330384efac..e893daa8ed 100644--- a/apps/carbon/app/components/Form/Supplier.tsx+++ b/apps/carbon/app/components/Form/Supplier.tsx@@ -9,7 +9,7 @@ import {import { useFetcher } from "@remix-run/react";import { useEffect, useMemo } from "react";import { useField } from "remix-validated-form";-import type { getSuppliersList } from "~/services/purchasing";+import type { getSuppliersList } from "~/modules/purchasing";import { mapRowsToOptions } from "~/utils/form";import type { SelectProps } from "./Select";diff --git a/apps/carbon/app/components/Form/SupplierContact.tsx b/apps/carbon/app/components/Form/SupplierContact.tsxindex 3681d695b8..f81ed7f999 100644--- a/apps/carbon/app/components/Form/SupplierContact.tsx+++ b/apps/carbon/app/components/Form/SupplierContact.tsx@@ -9,8 +9,10 @@ import {import { useFetcher } from "@remix-run/react";import { useEffect, useMemo, useRef } from "react";import { useControlField, useField } from "remix-validated-form";-import type { SupplierContact as SupplierContactType } from "~/interfaces/Purchasing/types";-import type { getSupplierContacts } from "~/services/purchasing";+import type {+ SupplierContact as SupplierContactType,+ getSupplierContacts,+} from "~/modules/purchasing";import type { SelectProps } from "./Select";type SupplierContactSelectProps = Omit<SelectProps, "options" | "onChange"> & {diff --git a/apps/carbon/app/components/Layout/Sidebar/CollapsibleSidebar.tsx b/apps/carbon/app/components/Layout/Sidebar/CollapsibleSidebar.tsxindex 10c993ef0a..470b7bbf78 100644--- a/apps/carbon/app/components/Layout/Sidebar/CollapsibleSidebar.tsx+++ b/apps/carbon/app/components/Layout/Sidebar/CollapsibleSidebar.tsx@@ -31,7 +31,6 @@ export const CollapsibleSidebar = ({ children }: PropsWithChildren<{}>) => {borderRightStyle="solid"position="relative"h="calc(100vh - 50px)"- overflowY="scroll"><Tooltip label={sidebar.isOpen ? "Collapse" : "Expand"} placement="right"><IconButtondiff --git a/apps/carbon/app/components/Layout/Sidebar/ContentSidebar.tsx b/apps/carbon/app/components/Layout/Sidebar/ContentSidebar.tsxindex 42014b5b14..238b021b25 100644--- a/apps/carbon/app/components/Layout/Sidebar/ContentSidebar.tsx+++ b/apps/carbon/app/components/Layout/Sidebar/ContentSidebar.tsx@@ -19,8 +19,7 @@ const ContentSidebar = ({ links }: { links: Route[] }) => {borderBottomStyle={"solid"}borderBottomWidth={1}borderBottomColor={borderColor}- px={2}- py={4}+ p={2}w="full">{links.map((route) => {@@ -33,6 +32,7 @@ const ContentSidebar = ({ links }: { links: Route[] }) => {as={Link}to={route.to}variant={isActive ? "solid" : "ghost"}+ border="none"fontWeight={isActive ? "bold" : "normal"}justifyContent="start"w="full"diff --git a/apps/carbon/app/components/Layout/Sidebar/GroupedContentSidebar.tsx b/apps/carbon/app/components/Layout/Sidebar/GroupedContentSidebar.tsxindex d163ceb2b2..a609d29a50 100644--- a/apps/carbon/app/components/Layout/Sidebar/GroupedContentSidebar.tsx+++ b/apps/carbon/app/components/Layout/Sidebar/GroupedContentSidebar.tsx@@ -22,8 +22,7 @@ const GroupedContentSidebar = ({ groups }: { groups: RouteGroup[] }) => {borderBottomStyle={"solid"}borderBottomWidth={1}borderBottomColor={borderColor}- px={2}- py={4}+ p={2}w="full"><Text@@ -46,6 +45,7 @@ const GroupedContentSidebar = ({ groups }: { groups: RouteGroup[] }) => {as={Link}to={route.to}variant={isActive ? "solid" : "ghost"}+ border="none"fontWeight={isActive ? "bold" : "normal"}leftIcon={route.icon}justifyContent="start"diff --git a/apps/carbon/app/components/Search/Search/Search.tsx b/apps/carbon/app/components/Search/Search/Search.tsxindex 68bffcf1b9..15465b63a3 100644--- a/apps/carbon/app/components/Search/Search/Search.tsx+++ b/apps/carbon/app/components/Search/Search/Search.tsx@@ -82,8 +82,6 @@ const SearchModal = ({? tokens.map((token) => `"${token}"`).join(" <-> "): q;- console.log(supabase);-const result = await supabase?.from("search").select()diff --git a/apps/carbon/app/components/Selectors/CustomerSelect/CustomerSelect.tsx b/apps/carbon/app/components/Selectors/CustomerSelect/CustomerSelect.tsxindex aecd9b839e..8e69095c9f 100644--- a/apps/carbon/app/components/Selectors/CustomerSelect/CustomerSelect.tsx+++ b/apps/carbon/app/components/Selectors/CustomerSelect/CustomerSelect.tsx@@ -1,7 +1,7 @@import { Select, createFilter } from "@carbon/react";import { useFetcher } from "@remix-run/react";import { useEffect } from "react";-import type { getCustomersList } from "~/services/sales";+import type { getCustomersList } from "~/modules/sales";import { mapRowsToOptions } from "~/utils/form";type CustomerSelectProps = {diff --git a/apps/carbon/app/components/Selectors/SupplierSelect/SupplierSelect.tsx b/apps/carbon/app/components/Selectors/SupplierSelect/SupplierSelect.tsxindex b4ec40eca2..d272ecb01b 100644--- a/apps/carbon/app/components/Selectors/SupplierSelect/SupplierSelect.tsx+++ b/apps/carbon/app/components/Selectors/SupplierSelect/SupplierSelect.tsx@@ -1,7 +1,7 @@import { Select, createFilter } from "@carbon/react";import { useFetcher } from "@remix-run/react";import { useEffect } from "react";-import type { getSuppliersList } from "~/services/purchasing";+import type { getSuppliersList } from "~/modules/purchasing";import { mapRowsToOptions } from "~/utils/form";type SupplierSelectProps = {diff --git a/apps/carbon/app/components/Selectors/UserSelect/types.ts b/apps/carbon/app/components/Selectors/UserSelect/types.tsindex 6b93ee87aa..1e794244eb 100644--- a/apps/carbon/app/components/Selectors/UserSelect/types.ts+++ b/apps/carbon/app/components/Selectors/UserSelect/types.ts@@ -8,7 +8,7 @@ import type {RefObject,} from "react";-import type { User, Group } from "~/interfaces/Users/types";+import type { User, Group } from "~/modules/users";export type ComboBoxRefs = {containerRef: RefObject<HTMLDivElement>;diff --git a/apps/carbon/app/components/Selectors/UserSelect/useUserSelect.ts b/apps/carbon/app/components/Selectors/UserSelect/useUserSelect.tsindex 9a36de571c..0f70f5e8a4 100644--- a/apps/carbon/app/components/Selectors/UserSelect/useUserSelect.ts+++ b/apps/carbon/app/components/Selectors/UserSelect/useUserSelect.ts@@ -5,7 +5,7 @@ import debounce from "lodash/debounce";import words from "lodash/words";import type { AriaAttributes, ChangeEvent, KeyboardEvent } from "react";import { useEffect, useState, useMemo, useCallback, useRef } from "react";-import type { Group } from "~/interfaces/Users/types";+import type { Group } from "~/modules/users";import type {OptionGroup,diff --git a/apps/carbon/app/hooks/usePermissions.tsx b/apps/carbon/app/hooks/usePermissions.tsxindex f5c66a7c76..021893e2bb 100644--- a/apps/carbon/app/hooks/usePermissions.tsx+++ b/apps/carbon/app/hooks/usePermissions.tsx@@ -1,5 +1,5 @@import { useCallback } from "react";-import type { Permission } from "~/interfaces/Users/types";+import type { Permission } from "~/modules/users";import type { Role } from "~/types";import { useRouteData } from "./useRouteData";diff --git a/apps/carbon/app/interfaces/Account/index.ts b/apps/carbon/app/interfaces/Account/index.tsdeleted file mode 100644index f97d900f06..0000000000--- a/apps/carbon/app/interfaces/Account/index.ts+++ /dev/null@@ -1,3 +0,0 @@-import useAccountSidebar from "./useAccountSidebar";--export { useAccountSidebar };diff --git a/apps/carbon/app/interfaces/Resources/index.ts b/apps/carbon/app/interfaces/Resources/index.tsdeleted file mode 100644index ff16b414fc..0000000000--- a/apps/carbon/app/interfaces/Resources/index.ts+++ /dev/null@@ -1,3 +0,0 @@-import useResourcesSidebar from "./useResourcesSidebar";--export { useResourcesSidebar };diff --git a/apps/carbon/app/modules/account/index.ts b/apps/carbon/app/modules/account/index.tsnew file mode 100644index 0000000000..684aed031a--- /dev/null+++ b/apps/carbon/app/modules/account/index.ts@@ -0,0 +1,3 @@+export * from "./services";+export * from "./interfaces";+export * from "./types";diff --git a/apps/carbon/app/interfaces/Account/Password/PasswordForm/PasswordForm.tsx b/apps/carbon/app/modules/account/interfaces/Password/PasswordForm/PasswordForm.tsxsimilarity index 96%rename from apps/carbon/app/interfaces/Account/Password/PasswordForm/PasswordForm.tsxrename to apps/carbon/app/modules/account/interfaces/Password/PasswordForm/PasswordForm.tsxindex 7630ef2a14..0dca5c2002 100644--- a/apps/carbon/app/interfaces/Account/Password/PasswordForm/PasswordForm.tsx+++ b/apps/carbon/app/modules/account/interfaces/Password/PasswordForm/PasswordForm.tsx@@ -2,7 +2,7 @@ import { Box, VStack } from "@chakra-ui/react";import { useRef, useState } from "react";import { ValidatedForm } from "remix-validated-form";import { Password, Submit } from "~/components/Form";-import { accountPasswordValidator } from "~/services/account";+import { accountPasswordValidator } from "~/modules/account";const PasswordForm = () => {const [passwordsMatch, setPasswordsMatch] = useState(false);diff --git a/apps/carbon/app/interfaces/Account/Password/PasswordForm/index.ts b/apps/carbon/app/modules/account/interfaces/Password/PasswordForm/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Account/Password/PasswordForm/index.tsrename to apps/carbon/app/modules/account/interfaces/Password/PasswordForm/index.tsdiff --git a/apps/carbon/app/interfaces/Account/Password/index.ts b/apps/carbon/app/modules/account/interfaces/Password/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Account/Password/index.tsrename to apps/carbon/app/modules/account/interfaces/Password/index.tsdiff --git a/apps/carbon/app/interfaces/Account/Personal/PersonalDataForm/PersonalDataForm.tsx b/apps/carbon/app/modules/account/interfaces/Personal/PersonalDataForm/PersonalDataForm.tsxsimilarity index 85%rename from apps/carbon/app/interfaces/Account/Personal/PersonalDataForm/PersonalDataForm.tsxrename to apps/carbon/app/modules/account/interfaces/Personal/PersonalDataForm/PersonalDataForm.tsxindex aa3e88c19a..d1c9c5e8f6 100644--- a/apps/carbon/app/interfaces/Account/Personal/PersonalDataForm/PersonalDataForm.tsx+++ b/apps/carbon/app/modules/account/interfaces/Personal/PersonalDataForm/PersonalDataForm.tsx@@ -1,8 +1,8 @@import { Box, Grid, VStack } from "@chakra-ui/react";import { ValidatedForm } from "remix-validated-form";import { Submit } from "~/components/Form";-import type { PersonalData } from "~/interfaces/Account/types";-import { accountPersonalDataValidator } from "~/services/account";+import type { PersonalData } from "~/modules/account";+import { accountPersonalDataValidator } from "~/modules/account";type PersonalDataFormProps = {personalData: PersonalData;diff --git a/apps/carbon/app/interfaces/Account/Personal/PersonalDataForm/index.ts b/apps/carbon/app/modules/account/interfaces/Personal/PersonalDataForm/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Account/Personal/PersonalDataForm/index.tsrename to apps/carbon/app/modules/account/interfaces/Personal/PersonalDataForm/index.tsdiff --git a/apps/carbon/app/interfaces/Account/Personal/index.ts b/apps/carbon/app/modules/account/interfaces/Personal/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Account/Personal/index.tsrename to apps/carbon/app/modules/account/interfaces/Personal/index.tsdiff --git a/apps/carbon/app/interfaces/Account/Profile/ProfileForm/ProfileForm.tsx b/apps/carbon/app/modules/account/interfaces/Profile/ProfileForm/ProfileForm.tsxsimilarity index 91%rename from apps/carbon/app/interfaces/Account/Profile/ProfileForm/ProfileForm.tsxrename to apps/carbon/app/modules/account/interfaces/Profile/ProfileForm/ProfileForm.tsxindex 0452fda498..86251563c2 100644--- a/apps/carbon/app/interfaces/Account/Profile/ProfileForm/ProfileForm.tsx+++ b/apps/carbon/app/modules/account/interfaces/Profile/ProfileForm/ProfileForm.tsx@@ -3,8 +3,8 @@ import { useParams } from "@remix-run/react";import { ValidatedForm } from "remix-validated-form";import { Hidden, Input, Submit, TextArea } from "~/components/Form";import { SectionTitle } from "~/components/Layout";-import type { User } from "~/interfaces/Users/types";-import { accountProfileValidator } from "~/services/account";+import { accountProfileValidator } from "~/modules/account";+import type { User } from "~/modules/users";type ProfileFormProps = {user: User;diff --git a/apps/carbon/app/interfaces/Account/Profile/ProfileForm/index.ts b/apps/carbon/app/modules/account/interfaces/Profile/ProfileForm/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Account/Profile/ProfileForm/index.tsrename to apps/carbon/app/modules/account/interfaces/Profile/ProfileForm/index.tsdiff --git a/apps/carbon/app/interfaces/Account/Profile/ProfilePhotoForm/ProfilePhotoForm.tsx b/apps/carbon/app/modules/account/interfaces/Profile/ProfilePhotoForm/ProfilePhotoForm.tsxsimilarity index 97%rename from apps/carbon/app/interfaces/Account/Profile/ProfilePhotoForm/ProfilePhotoForm.tsxrename to apps/carbon/app/modules/account/interfaces/Profile/ProfilePhotoForm/ProfilePhotoForm.tsxindex ab98c828f3..25827c1e47 100644--- a/apps/carbon/app/interfaces/Account/Profile/ProfilePhotoForm/ProfilePhotoForm.tsx+++ b/apps/carbon/app/modules/account/interfaces/Profile/ProfilePhotoForm/ProfilePhotoForm.tsx@@ -5,7 +5,7 @@ import type { ChangeEvent } from "react";import { useRef } from "react";import { Avatar } from "~/components";import { useSupabase } from "~/lib/supabase";-import type { Account } from "~/interfaces/Account/types";+import type { Account } from "~/modules/account";type ProfilePhotoFormProps = {user: Account;diff --git a/apps/carbon/app/interfaces/Account/Profile/ProfilePhotoForm/index.ts b/apps/carbon/app/modules/account/interfaces/Profile/ProfilePhotoForm/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Account/Profile/ProfilePhotoForm/index.tsrename to apps/carbon/app/modules/account/interfaces/Profile/ProfilePhotoForm/index.tsdiff --git a/apps/carbon/app/interfaces/Account/Profile/index.ts b/apps/carbon/app/modules/account/interfaces/Profile/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Account/Profile/index.tsrename to apps/carbon/app/modules/account/interfaces/Profile/index.tsdiff --git a/apps/carbon/app/interfaces/Account/UserAttributes/UserAttributesForm.tsx b/apps/carbon/app/modules/account/interfaces/UserAttributes/UserAttributesForm.tsxsimilarity index 99%rename from apps/carbon/app/interfaces/Account/UserAttributes/UserAttributesForm.tsxrename to apps/carbon/app/modules/account/interfaces/UserAttributes/UserAttributesForm.tsxindex ed0199ae48..d9cbe46cdc 100644--- a/apps/carbon/app/interfaces/Account/UserAttributes/UserAttributesForm.tsx+++ b/apps/carbon/app/modules/account/interfaces/UserAttributes/UserAttributesForm.tsx@@ -25,15 +25,15 @@ import {} from "~/components/Form";import { UserSelect } from "~/components/Selectors";import { usePermissions, useUser } from "~/hooks";-import type { PublicAttributes } from "~/interfaces/Account/types";-import { DataType } from "~/interfaces/Users/types";import {attributeBooleanValidator,attributeNumericValidator,attributeTextValidator,attributeUserValidator,deleteUserAttributeValueValidator,-} from "~/services/account";+} from "~/modules/account";+import type { PublicAttributes } from "~/modules/account";+import { DataType } from "~/modules/users";type UserAttributesFormProps = {attributeCategory?: PublicAttributes;diff --git a/apps/carbon/app/interfaces/Account/UserAttributes/index.ts b/apps/carbon/app/modules/account/interfaces/UserAttributes/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Account/UserAttributes/index.tsrename to apps/carbon/app/modules/account/interfaces/UserAttributes/index.tsdiff --git a/apps/carbon/app/modules/account/interfaces/index.ts b/apps/carbon/app/modules/account/interfaces/index.tsnew file mode 100644index 0000000000..454cdb48a2--- /dev/null+++ b/apps/carbon/app/modules/account/interfaces/index.ts@@ -0,0 +1,7 @@+import useAccountSidebar from "./useAccountSidebar";++export { useAccountSidebar };+export * from "./Password";+export * from "./Personal";+export * from "./Profile";+export * from "./UserAttributes";diff --git a/apps/carbon/app/interfaces/Account/useAccountSidebar.tsx b/apps/carbon/app/modules/account/interfaces/useAccountSidebar.tsxsimilarity index 100%rename from apps/carbon/app/interfaces/Account/useAccountSidebar.tsxrename to apps/carbon/app/modules/account/interfaces/useAccountSidebar.tsxdiff --git a/apps/carbon/app/services/account/account.form.ts b/apps/carbon/app/modules/account/services/account.form.tssimilarity index 100%rename from apps/carbon/app/services/account/account.form.tsrename to apps/carbon/app/modules/account/services/account.form.tsdiff --git a/apps/carbon/app/services/account/account.server.ts b/apps/carbon/app/modules/account/services/account.server.tssimilarity index 100%rename from apps/carbon/app/services/account/account.server.tsrename to apps/carbon/app/modules/account/services/account.server.tsdiff --git a/apps/carbon/app/services/account/index.ts b/apps/carbon/app/modules/account/services/index.tssimilarity index 100%rename from apps/carbon/app/services/account/index.tsrename to apps/carbon/app/modules/account/services/index.tsdiff --git a/apps/carbon/app/interfaces/Account/types.ts b/apps/carbon/app/modules/account/types.tssimilarity index 79%rename from apps/carbon/app/interfaces/Account/types.tsrename to apps/carbon/app/modules/account/types.tsindex a734ca0a9e..7b148dd8fb 100644--- a/apps/carbon/app/interfaces/Account/types.ts+++ b/apps/carbon/app/modules/account/types.ts@@ -1,4 +1,4 @@-import type { getAccount, getPublicAttributes } from "~/services/account";+import type { getAccount, getPublicAttributes } from "./services";export type Account = NonNullable<Awaited<ReturnType<typeof getAccount>>["data"]diff --git a/apps/carbon/app/modules/parts/index.ts b/apps/carbon/app/modules/parts/index.tsnew file mode 100644index 0000000000..afccf2b240--- /dev/null+++ b/apps/carbon/app/modules/parts/index.ts@@ -0,0 +1,3 @@+// export * from "./services";+export * from "./interfaces";+// export * from "./types";diff --git a/apps/carbon/app/interfaces/Parts/Toolbar/PartsTree.tsx b/apps/carbon/app/modules/parts/interfaces/Toolbar/PartsTree.tsxsimilarity index 100%rename from apps/carbon/app/interfaces/Parts/Toolbar/PartsTree.tsxrename to apps/carbon/app/modules/parts/interfaces/Toolbar/PartsTree.tsxdiff --git a/apps/carbon/app/interfaces/Parts/Toolbar/index.ts b/apps/carbon/app/modules/parts/interfaces/Toolbar/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Parts/Toolbar/index.tsrename to apps/carbon/app/modules/parts/interfaces/Toolbar/index.tsdiff --git a/apps/carbon/app/interfaces/Parts/index.ts b/apps/carbon/app/modules/parts/interfaces/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Parts/index.tsrename to apps/carbon/app/modules/parts/interfaces/index.tsdiff --git a/apps/carbon/app/modules/purchasing/index.ts b/apps/carbon/app/modules/purchasing/index.tsnew file mode 100644index 0000000000..684aed031a--- /dev/null+++ b/apps/carbon/app/modules/purchasing/index.ts@@ -0,0 +1,3 @@+export * from "./services";+export * from "./interfaces";+export * from "./types";diff --git a/apps/carbon/app/interfaces/Purchasing/SupplierTypes/SupplierTypeForm/SupplierTypeForm.tsx b/apps/carbon/app/modules/purchasing/interfaces/SupplierTypes/SupplierTypeForm/SupplierTypeForm.tsxsimilarity index 97%rename from apps/carbon/app/interfaces/Purchasing/SupplierTypes/SupplierTypeForm/SupplierTypeForm.tsxrename to apps/carbon/app/modules/purchasing/interfaces/SupplierTypes/SupplierTypeForm/SupplierTypeForm.tsxindex 3ae1020af4..8cae6f8f61 100644--- a/apps/carbon/app/interfaces/Purchasing/SupplierTypes/SupplierTypeForm/SupplierTypeForm.tsx+++ b/apps/carbon/app/modules/purchasing/interfaces/SupplierTypes/SupplierTypeForm/SupplierTypeForm.tsx@@ -14,7 +14,7 @@ import { useNavigate } from "@remix-run/react";import { ValidatedForm } from "remix-validated-form";import { Color, Hidden, Input, Submit } from "~/components/Form";import { usePermissions } from "~/hooks";-import { supplierTypeValidator } from "~/services/purchasing";+import { supplierTypeValidator } from "~/modules/purchasing";import type { TypeOfValidator } from "~/types/validators";type SupplierTypeFormProps = {diff --git a/apps/carbon/app/interfaces/Purchasing/SupplierTypes/SupplierTypeForm/index.ts b/apps/carbon/app/modules/purchasing/interfaces/SupplierTypes/SupplierTypeForm/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Purchasing/SupplierTypes/SupplierTypeForm/index.tsrename to apps/carbon/app/modules/purchasing/interfaces/SupplierTypes/SupplierTypeForm/index.tsdiff --git a/apps/carbon/app/interfaces/Purchasing/SupplierTypes/SupplierTypesTable/SupplierTypesTable.tsx b/apps/carbon/app/modules/purchasing/interfaces/SupplierTypes/SupplierTypesTable/SupplierTypesTable.tsxsimilarity index 97%rename from apps/carbon/app/interfaces/Purchasing/SupplierTypes/SupplierTypesTable/SupplierTypesTable.tsxrename to apps/carbon/app/modules/purchasing/interfaces/SupplierTypes/SupplierTypesTable/SupplierTypesTable.tsxindex 5852354d97..4ace8b0d0a 100644--- a/apps/carbon/app/interfaces/Purchasing/SupplierTypes/SupplierTypesTable/SupplierTypesTable.tsx+++ b/apps/carbon/app/modules/purchasing/interfaces/SupplierTypes/SupplierTypesTable/SupplierTypesTable.tsx@@ -6,7 +6,7 @@ import { BsPencilSquare, BsPeopleFill } from "react-icons/bs";import { IoMdTrash } from "react-icons/io";import { Table } from "~/components";import { usePermissions, useUrlParams } from "~/hooks";-import type { SupplierType } from "~/interfaces/Purchasing/types";+import type { SupplierType } from "~/modules/purchasing";type SupplierTypesTableProps = {data: SupplierType[];diff --git a/apps/carbon/app/interfaces/Purchasing/SupplierTypes/SupplierTypesTable/index.ts b/apps/carbon/app/modules/purchasing/interfaces/SupplierTypes/SupplierTypesTable/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Purchasing/SupplierTypes/SupplierTypesTable/index.tsrename to apps/carbon/app/modules/purchasing/interfaces/SupplierTypes/SupplierTypesTable/index.tsdiff --git a/apps/carbon/app/interfaces/Purchasing/SupplierTypes/SupplierTypesTableFilters/SupplierTypesTableFilters.tsx b/apps/carbon/app/modules/purchasing/interfaces/SupplierTypes/SupplierTypesTableFilters/SupplierTypesTableFilters.tsxsimilarity index 96%rename from apps/carbon/app/interfaces/Purchasing/SupplierTypes/SupplierTypesTableFilters/SupplierTypesTableFilters.tsxrename to apps/carbon/app/modules/purchasing/interfaces/SupplierTypes/SupplierTypesTableFilters/SupplierTypesTableFilters.tsxindex 0060e46a5a..e1c5e8108c 100644--- a/apps/carbon/app/interfaces/Purchasing/SupplierTypes/SupplierTypesTableFilters/SupplierTypesTableFilters.tsx+++ b/apps/carbon/app/modules/purchasing/interfaces/SupplierTypes/SupplierTypesTableFilters/SupplierTypesTableFilters.tsx@@ -24,7 +24,7 @@ const SupplierTypesTableFilters = () => {param="name"size="sm"minW={180}- placeholder="Search by name"+ placeholder="Filter by name"/></HStack><HStack spacing={2}>diff --git a/apps/carbon/app/interfaces/Purchasing/SupplierTypes/SupplierTypesTableFilters/index.ts b/apps/carbon/app/modules/purchasing/interfaces/SupplierTypes/SupplierTypesTableFilters/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Purchasing/SupplierTypes/SupplierTypesTableFilters/index.tsrename to apps/carbon/app/modules/purchasing/interfaces/SupplierTypes/SupplierTypesTableFilters/index.tsdiff --git a/apps/carbon/app/interfaces/Purchasing/SupplierTypes/index.ts b/apps/carbon/app/modules/purchasing/interfaces/SupplierTypes/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Purchasing/SupplierTypes/index.tsrename to apps/carbon/app/modules/purchasing/interfaces/SupplierTypes/index.tsdiff --git a/apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/SupplierForm.tsx b/apps/carbon/app/modules/purchasing/interfaces/Suppliers/SupplierForm/SupplierForm.tsxsimilarity index 97%rename from apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/SupplierForm.tsxrename to apps/carbon/app/modules/purchasing/interfaces/Suppliers/SupplierForm/SupplierForm.tsxindex 5ce438fa73..827bc688e1 100644--- a/apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/SupplierForm.tsx+++ b/apps/carbon/app/modules/purchasing/interfaces/Suppliers/SupplierForm/SupplierForm.tsx@@ -22,17 +22,17 @@ import {TextArea,Hidden,} from "~/components/Form";-import { supplierValidator } from "~/services/purchasing";+import { usePermissions, useRouteData } from "~/hooks";+import { supplierValidator } from "~/modules/purchasing";import type {SupplierContact,SupplierLocation,SupplierStatus,SupplierType,-} from "~/interfaces/Purchasing/types";+} from "~/modules/purchasing";import { mapRowsToOptions } from "~/utils/form";-import { usePermissions, useRouteData } from "~/hooks";-import { SupplierContacts, SupplierLocations } from "./components";import type { TypeOfValidator } from "~/types/validators";+import { SupplierContacts, SupplierLocations } from "./components";type SupplierFormProps = {initialValues: TypeOfValidator<typeof supplierValidator>;diff --git a/apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/components/SupplierContacts.tsx b/apps/carbon/app/modules/purchasing/interfaces/Suppliers/SupplierForm/components/SupplierContacts.tsxsimilarity index 97%rename from apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/components/SupplierContacts.tsxrename to apps/carbon/app/modules/purchasing/interfaces/Suppliers/SupplierForm/components/SupplierContacts.tsxindex 7ded7b29fc..7edcc1f155 100644--- a/apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/components/SupplierContacts.tsx+++ b/apps/carbon/app/modules/purchasing/interfaces/Suppliers/SupplierForm/components/SupplierContacts.tsx@@ -12,14 +12,11 @@ import {import { useNavigate, useParams } from "@remix-run/react";import { useState } from "react";import { IoMdAdd } from "react-icons/io";-import type {- SupplierContact,- SupplierLocation,-} from "~/interfaces/Purchasing/types";import { Contact } from "~/components";import { ConfirmDelete } from "~/components/Modals";-import SupplierContactForm from "./SupplierContactsForm";import { usePermissions } from "~/hooks";+import type { SupplierContact, SupplierLocation } from "~/modules/purchasing";+import SupplierContactForm from "./SupplierContactsForm";type SupplierContactProps = {contacts?: SupplierContact[];diff --git a/apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/components/SupplierContactsForm.tsx b/apps/carbon/app/modules/purchasing/interfaces/Suppliers/SupplierForm/components/SupplierContactsForm.tsxsimilarity index 96%rename from apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/components/SupplierContactsForm.tsxrename to apps/carbon/app/modules/purchasing/interfaces/Suppliers/SupplierForm/components/SupplierContactsForm.tsxindex 3d79ed6f63..c0eeb6b047 100644--- a/apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/components/SupplierContactsForm.tsx+++ b/apps/carbon/app/modules/purchasing/interfaces/Suppliers/SupplierForm/components/SupplierContactsForm.tsx@@ -21,11 +21,8 @@ import {TextArea,} from "~/components/Form";import { usePermissions } from "~/hooks";-import type {- SupplierContact,- SupplierLocation,-} from "~/interfaces/Purchasing/types";-import { supplierContactValidator } from "~/services/purchasing";+import type { SupplierContact, SupplierLocation } from "~/modules/purchasing";+import { supplierContactValidator } from "~/modules/purchasing";type SupplierContactFormProps = {contact?: SupplierContact;diff --git a/apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/components/SupplierLocationForm.tsx b/apps/carbon/app/modules/purchasing/interfaces/Suppliers/SupplierForm/components/SupplierLocationForm.tsxsimilarity index 95%rename from apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/components/SupplierLocationForm.tsxrename to apps/carbon/app/modules/purchasing/interfaces/Suppliers/SupplierForm/components/SupplierLocationForm.tsxindex 465eda6d2e..e126a5551f 100644--- a/apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/components/SupplierLocationForm.tsx+++ b/apps/carbon/app/modules/purchasing/interfaces/Suppliers/SupplierForm/components/SupplierLocationForm.tsx@@ -14,8 +14,8 @@ import { useParams } from "@remix-run/react";import { ValidatedForm } from "remix-validated-form";import { Hidden, Input, Submit } from "~/components/Form";import { usePermissions } from "~/hooks";-import type { SupplierLocation } from "~/interfaces/Purchasing/types";-import { supplierLocationValidator } from "~/services/purchasing";+import type { SupplierLocation } from "~/modules/purchasing";+import { supplierLocationValidator } from "~/modules/purchasing";type SupplierLocationFormProps = {location?: SupplierLocation;diff --git a/apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/components/SupplierLocations.tsx b/apps/carbon/app/modules/purchasing/interfaces/Suppliers/SupplierForm/components/SupplierLocations.tsxsimilarity index 98%rename from apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/components/SupplierLocations.tsxrename to apps/carbon/app/modules/purchasing/interfaces/Suppliers/SupplierForm/components/SupplierLocations.tsxindex 2bfc59f955..36fb15e3e1 100644--- a/apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/components/SupplierLocations.tsx+++ b/apps/carbon/app/modules/purchasing/interfaces/Suppliers/SupplierForm/components/SupplierLocations.tsx@@ -15,7 +15,7 @@ import { IoMdAdd } from "react-icons/io";import { Address } from "~/components";import { ConfirmDelete } from "~/components/Modals";import { usePermissions } from "~/hooks";-import type { SupplierLocation } from "~/interfaces/Purchasing/types";+import type { SupplierLocation } from "~/modules/purchasing";import SupplierLocationForm from "./SupplierLocationForm";type SupplierLocationProps = {diff --git a/apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/components/index.ts b/apps/carbon/app/modules/purchasing/interfaces/Suppliers/SupplierForm/components/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/components/index.tsrename to apps/carbon/app/modules/purchasing/interfaces/Suppliers/SupplierForm/components/index.tsdiff --git a/apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/index.ts b/apps/carbon/app/modules/purchasing/interfaces/Suppliers/SupplierForm/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/index.tsrename to apps/carbon/app/modules/purchasing/interfaces/Suppliers/SupplierForm/index.tsdiff --git a/apps/carbon/app/interfaces/Purchasing/Suppliers/SuppliersTable/SuppliersTable.tsx b/apps/carbon/app/modules/purchasing/interfaces/Suppliers/SuppliersTable/SuppliersTable.tsxsimilarity index 97%rename from apps/carbon/app/interfaces/Purchasing/Suppliers/SuppliersTable/SuppliersTable.tsxrename to apps/carbon/app/modules/purchasing/interfaces/Suppliers/SuppliersTable/SuppliersTable.tsxindex 6e59979dde..c04ea3af80 100644--- a/apps/carbon/app/interfaces/Purchasing/Suppliers/SuppliersTable/SuppliersTable.tsx+++ b/apps/carbon/app/modules/purchasing/interfaces/Suppliers/SuppliersTable/SuppliersTable.tsx@@ -5,7 +5,7 @@ import { memo, useMemo } from "react";import { BsPencilSquare, BsPlus } from "react-icons/bs";import { Table } from "~/components";import { usePermissions, useUrlParams } from "~/hooks";-import type { Supplier } from "~/interfaces/Purchasing/types";+import type { Supplier } from "~/modules/purchasing";type SuppliersTableProps = {data: Supplier[];diff --git a/apps/carbon/app/interfaces/Purchasing/Suppliers/SuppliersTable/index.ts b/apps/carbon/app/modules/purchasing/interfaces/Suppliers/SuppliersTable/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Purchasing/Suppliers/SuppliersTable/index.tsrename to apps/carbon/app/modules/purchasing/interfaces/Suppliers/SuppliersTable/index.tsdiff --git a/apps/carbon/app/interfaces/Purchasing/Suppliers/SuppliersTableFilters/SuppliersTableFilters.tsx b/apps/carbon/app/modules/purchasing/interfaces/Suppliers/SuppliersTableFilters/SuppliersTableFilters.tsxsimilarity index 95%rename from apps/carbon/app/interfaces/Purchasing/Suppliers/SuppliersTableFilters/SuppliersTableFilters.tsxrename to apps/carbon/app/modules/purchasing/interfaces/Suppliers/SuppliersTableFilters/SuppliersTableFilters.tsxindex 4c6167e33b..52c936183b 100644--- a/apps/carbon/app/interfaces/Purchasing/Suppliers/SuppliersTableFilters/SuppliersTableFilters.tsx+++ b/apps/carbon/app/modules/purchasing/interfaces/Suppliers/SuppliersTableFilters/SuppliersTableFilters.tsx@@ -4,10 +4,7 @@ import { Link } from "@remix-run/react";import { IoMdAdd } from "react-icons/io";import { DebouncedInput } from "~/components/Search";import { usePermissions, useUrlParams } from "~/hooks";-import type {- SupplierStatus,- SupplierType,-} from "~/interfaces/Purchasing/types";+import type { SupplierStatus, SupplierType } from "~/modules/purchasing";import { mapRowsToOptions } from "~/utils/form";type SuppliersTableFiltersProps = {@@ -50,7 +47,7 @@ const SuppliersTableFilters = ({param="name"size="sm"minW={180}- placeholder="Search by name"+ placeholder="Filter by name"/>{supplierTypeOptions.length > 0 && (<Selectdiff --git a/apps/carbon/app/interfaces/Purchasing/Suppliers/SuppliersTableFilters/index.ts b/apps/carbon/app/modules/purchasing/interfaces/Suppliers/SuppliersTableFilters/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Purchasing/Suppliers/SuppliersTableFilters/index.tsrename to apps/carbon/app/modules/purchasing/interfaces/Suppliers/SuppliersTableFilters/index.tsdiff --git a/apps/carbon/app/interfaces/Purchasing/Suppliers/index.ts b/apps/carbon/app/modules/purchasing/interfaces/Suppliers/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Purchasing/Suppliers/index.tsrename to apps/carbon/app/modules/purchasing/interfaces/Suppliers/index.tsdiff --git a/apps/carbon/app/interfaces/Purchasing/index.ts b/apps/carbon/app/modules/purchasing/interfaces/index.tssimilarity index 60%rename from apps/carbon/app/interfaces/Purchasing/index.tsrename to apps/carbon/app/modules/purchasing/interfaces/index.tsindex 938fcc8f88..64f6cad37c 100644--- a/apps/carbon/app/interfaces/Purchasing/index.ts+++ b/apps/carbon/app/modules/purchasing/interfaces/index.ts@@ -1,3 +1,5 @@import usePurchasingSidebar from "./usePurchasingSidebar";export { usePurchasingSidebar };+export * from "./Suppliers";+export * from "./SupplierTypes";diff --git a/apps/carbon/app/interfaces/Purchasing/usePurchasingSidebar.tsx b/apps/carbon/app/modules/purchasing/interfaces/usePurchasingSidebar.tsxsimilarity index 100%rename from apps/carbon/app/interfaces/Purchasing/usePurchasingSidebar.tsxrename to apps/carbon/app/modules/purchasing/interfaces/usePurchasingSidebar.tsxdiff --git a/apps/carbon/app/services/purchasing/index.ts b/apps/carbon/app/modules/purchasing/services/index.tssimilarity index 100%rename from apps/carbon/app/services/purchasing/index.tsrename to apps/carbon/app/modules/purchasing/services/index.tsdiff --git a/apps/carbon/app/services/purchasing/purchasing.form.ts b/apps/carbon/app/modules/purchasing/services/purchasing.form.tssimilarity index 100%rename from apps/carbon/app/services/purchasing/purchasing.form.tsrename to apps/carbon/app/modules/purchasing/services/purchasing.form.tsdiff --git a/apps/carbon/app/services/purchasing/purchasing.server.ts b/apps/carbon/app/modules/purchasing/services/purchasing.server.tssimilarity index 100%rename from apps/carbon/app/services/purchasing/purchasing.server.tsrename to apps/carbon/app/modules/purchasing/services/purchasing.server.tsdiff --git a/apps/carbon/app/interfaces/Purchasing/types.ts b/apps/carbon/app/modules/purchasing/types.tssimilarity index 95%rename from apps/carbon/app/interfaces/Purchasing/types.tsrename to apps/carbon/app/modules/purchasing/types.tsindex a166ca66ca..694a1ea4a4 100644--- a/apps/carbon/app/interfaces/Purchasing/types.ts+++ b/apps/carbon/app/modules/purchasing/types.ts@@ -4,7 +4,7 @@ import type {getSuppliers,getSupplierStatuses,getSupplierTypes,-} from "~/services/purchasing";+} from "./services";export type Supplier = NonNullable<Awaited<ReturnType<typeof getSuppliers>>["data"]diff --git a/apps/carbon/app/modules/resources/index.ts b/apps/carbon/app/modules/resources/index.tsnew file mode 100644index 0000000000..684aed031a--- /dev/null+++ b/apps/carbon/app/modules/resources/index.ts@@ -0,0 +1,3 @@+export * from "./services";+export * from "./interfaces";+export * from "./types";diff --git a/apps/carbon/app/interfaces/Resources/Abilities/AbilitiesTable/AbilitiesTable.tsx b/apps/carbon/app/modules/resources/interfaces/Abilities/AbilitiesTable/AbilitiesTable.tsxsimilarity index 98%rename from apps/carbon/app/interfaces/Resources/Abilities/AbilitiesTable/AbilitiesTable.tsxrename to apps/carbon/app/modules/resources/interfaces/Abilities/AbilitiesTable/AbilitiesTable.tsxindex c464d44590..ef1eae292b 100644--- a/apps/carbon/app/interfaces/Resources/Abilities/AbilitiesTable/AbilitiesTable.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Abilities/AbilitiesTable/AbilitiesTable.tsx@@ -7,7 +7,7 @@ import { IoMdTrash } from "react-icons/io";import { Avatar } from "~/components";import { Table } from "~/components";import { usePermissions } from "~/hooks";-import type { Abilities, AbilityDatum } from "~/interfaces/Resources/types";+import type { Abilities, AbilityDatum } from "~/modules/resources";import AbilityChart from "../AbilityChart";type AbilitiesTableProps = {diff --git a/apps/carbon/app/interfaces/Resources/Abilities/AbilitiesTable/index.ts b/apps/carbon/app/modules/resources/interfaces/Abilities/AbilitiesTable/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Abilities/AbilitiesTable/index.tsrename to apps/carbon/app/modules/resources/interfaces/Abilities/AbilitiesTable/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Abilities/AbilitiesTableFilters/AbilitiesTableFilters.tsx b/apps/carbon/app/modules/resources/interfaces/Abilities/AbilitiesTableFilters/AbilitiesTableFilters.tsxsimilarity index 96%rename from apps/carbon/app/interfaces/Resources/Abilities/AbilitiesTableFilters/AbilitiesTableFilters.tsxrename to apps/carbon/app/modules/resources/interfaces/Abilities/AbilitiesTableFilters/AbilitiesTableFilters.tsxindex 1bcb39f251..e0d9d84e76 100644--- a/apps/carbon/app/interfaces/Resources/Abilities/AbilitiesTableFilters/AbilitiesTableFilters.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Abilities/AbilitiesTableFilters/AbilitiesTableFilters.tsx@@ -24,7 +24,7 @@ const AbilitiesTableFilters = () => {param="name"size="sm"minW={180}- placeholder="Search by name"+ placeholder="Filter by name"/></HStack><HStack spacing={2}>diff --git a/apps/carbon/app/interfaces/Resources/Abilities/AbilitiesTableFilters/index.ts b/apps/carbon/app/modules/resources/interfaces/Abilities/AbilitiesTableFilters/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Abilities/AbilitiesTableFilters/index.tsrename to apps/carbon/app/modules/resources/interfaces/Abilities/AbilitiesTableFilters/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Abilities/AbilityChart/AbilityChart.tsx b/apps/carbon/app/modules/resources/interfaces/Abilities/AbilityChart/AbilityChart.tsxsimilarity index 99%rename from apps/carbon/app/interfaces/Resources/Abilities/AbilityChart/AbilityChart.tsxrename to apps/carbon/app/modules/resources/interfaces/Abilities/AbilityChart/AbilityChart.tsxindex b70d4fc8a9..4a50d8d926 100644--- a/apps/carbon/app/interfaces/Resources/Abilities/AbilityChart/AbilityChart.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Abilities/AbilityChart/AbilityChart.tsx@@ -8,7 +8,7 @@ import { PatternLines } from "@visx/pattern";import { scaleLinear } from "@visx/scale";import { AreaClosed, LinePath } from "@visx/shape";import { useRef } from "react";-import type { AbilityDatum } from "~/interfaces/Resources/types";+import type { AbilityDatum } from "~/modules/resources";type AbilityChartProps = {data: AbilityDatum[];diff --git a/apps/carbon/app/interfaces/Resources/Abilities/AbilityChart/index.ts b/apps/carbon/app/modules/resources/interfaces/Abilities/AbilityChart/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Abilities/AbilityChart/index.tsrename to apps/carbon/app/modules/resources/interfaces/Abilities/AbilityChart/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Abilities/AbilityEmployeesTable/AbilityEmployeesTable.tsx b/apps/carbon/app/modules/resources/interfaces/Abilities/AbilityEmployeesTable/AbilityEmployeesTable.tsxsimilarity index 96%rename from apps/carbon/app/interfaces/Resources/Abilities/AbilityEmployeesTable/AbilityEmployeesTable.tsxrename to apps/carbon/app/modules/resources/interfaces/Abilities/AbilityEmployeesTable/AbilityEmployeesTable.tsxindex c64daa1fae..38629e31cb 100644--- a/apps/carbon/app/interfaces/Resources/Abilities/AbilityEmployeesTable/AbilityEmployeesTable.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Abilities/AbilityEmployeesTable/AbilityEmployeesTable.tsx@@ -6,8 +6,8 @@ import { BsPencilSquare } from "react-icons/bs";import { IoMdTrash } from "react-icons/io";import { Avatar, Table } from "~/components";import { usePermissions } from "~/hooks";-import { AbilityEmployeeStatus } from "~/interfaces/Resources/types";-import type { AbilityEmployees } from "~/interfaces/Resources/types";+import { AbilityEmployeeStatus } from "~/modules/resources";+import type { AbilityEmployees } from "~/modules/resources";type AbilityEmployeeTableProps = {employees: AbilityEmployees;diff --git a/apps/carbon/app/interfaces/Resources/Abilities/AbilityEmployeesTable/index.ts b/apps/carbon/app/modules/resources/interfaces/Abilities/AbilityEmployeesTable/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Abilities/AbilityEmployeesTable/index.tsrename to apps/carbon/app/modules/resources/interfaces/Abilities/AbilityEmployeesTable/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Abilities/AbilityForm/AbilityForm.tsx b/apps/carbon/app/modules/resources/interfaces/Abilities/AbilityForm/AbilityForm.tsxsimilarity index 98%rename from apps/carbon/app/interfaces/Resources/Abilities/AbilityForm/AbilityForm.tsxrename to apps/carbon/app/modules/resources/interfaces/Abilities/AbilityForm/AbilityForm.tsxindex d58920d788..50d69507d1 100644--- a/apps/carbon/app/interfaces/Resources/Abilities/AbilityForm/AbilityForm.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Abilities/AbilityForm/AbilityForm.tsx@@ -22,7 +22,7 @@ import {Submit,} from "~/components/Form";import { usePermissions } from "~/hooks";-import { abilityValidator } from "~/services/resources";+import { abilityValidator } from "~/modules/resources";import type { TypeOfValidator } from "~/types/validators";type AbilityFormProps = {diff --git a/apps/carbon/app/interfaces/Resources/Abilities/AbilityForm/index.ts b/apps/carbon/app/modules/resources/interfaces/Abilities/AbilityForm/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Abilities/AbilityForm/index.tsrename to apps/carbon/app/modules/resources/interfaces/Abilities/AbilityForm/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Abilities/EmployeeAbilityForm/EmployeeAbilityForm.tsx b/apps/carbon/app/modules/resources/interfaces/Abilities/EmployeeAbilityForm/EmployeeAbilityForm.tsxsimilarity index 95%rename from apps/carbon/app/interfaces/Resources/Abilities/EmployeeAbilityForm/EmployeeAbilityForm.tsxrename to apps/carbon/app/modules/resources/interfaces/Abilities/EmployeeAbilityForm/EmployeeAbilityForm.tsxindex 11f0025674..52f0325ac8 100644--- a/apps/carbon/app/interfaces/Resources/Abilities/EmployeeAbilityForm/EmployeeAbilityForm.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Abilities/EmployeeAbilityForm/EmployeeAbilityForm.tsx@@ -15,9 +15,9 @@ import { useState } from "react";import { ValidatedForm } from "remix-validated-form";import { Employee, Hidden, Select, Slider, Submit } from "~/components/Form";import { usePermissions } from "~/hooks";-import type { Ability } from "~/interfaces/Resources/types";-import { AbilityEmployeeStatus } from "~/interfaces/Resources/types";-import { employeeAbilityValidator } from "~/services/resources";+import type { Ability } from "~/modules/resources";+import { AbilityEmployeeStatus } from "~/modules/resources";+import { employeeAbilityValidator } from "~/modules/resources";import type { TypeOfValidator } from "~/types/validators";type EmployeeAbilityFormProps = {diff --git a/apps/carbon/app/interfaces/Resources/Abilities/EmployeeAbilityForm/index.ts b/apps/carbon/app/modules/resources/interfaces/Abilities/EmployeeAbilityForm/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Abilities/EmployeeAbilityForm/index.tsrename to apps/carbon/app/modules/resources/interfaces/Abilities/EmployeeAbilityForm/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Abilities/index.ts b/apps/carbon/app/modules/resources/interfaces/Abilities/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Abilities/index.tsrename to apps/carbon/app/modules/resources/interfaces/Abilities/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Attributes/AttributeCategoriesTable/AttributesCategoriesTable.tsx b/apps/carbon/app/modules/resources/interfaces/Attributes/AttributeCategoriesTable/AttributesCategoriesTable.tsxsimilarity index 98%rename from apps/carbon/app/interfaces/Resources/Attributes/AttributeCategoriesTable/AttributesCategoriesTable.tsxrename to apps/carbon/app/modules/resources/interfaces/Attributes/AttributeCategoriesTable/AttributesCategoriesTable.tsxindex cf0ab76904..d79bf8d75d 100644--- a/apps/carbon/app/interfaces/Resources/Attributes/AttributeCategoriesTable/AttributesCategoriesTable.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Attributes/AttributeCategoriesTable/AttributesCategoriesTable.tsx@@ -15,7 +15,7 @@ import { IoMdTrash } from "react-icons/io";import { Table } from "~/components";import { ConfirmDelete } from "~/components/Modals";import { usePermissions, useUrlParams } from "~/hooks";-import type { AttributeCategory } from "~/interfaces/Resources/types";+import type { AttributeCategory } from "~/modules/resources";type AttributeCategoriesTableProps = {data: AttributeCategory[];diff --git a/apps/carbon/app/interfaces/Resources/Attributes/AttributeCategoriesTable/index.ts b/apps/carbon/app/modules/resources/interfaces/Attributes/AttributeCategoriesTable/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Attributes/AttributeCategoriesTable/index.tsrename to apps/carbon/app/modules/resources/interfaces/Attributes/AttributeCategoriesTable/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Attributes/AttributeCategoriesTableFilters/AttributeCategoriesTableFilters.tsx b/apps/carbon/app/modules/resources/interfaces/Attributes/AttributeCategoriesTableFilters/AttributeCategoriesTableFilters.tsxsimilarity index 96%rename from apps/carbon/app/interfaces/Resources/Attributes/AttributeCategoriesTableFilters/AttributeCategoriesTableFilters.tsxrename to apps/carbon/app/modules/resources/interfaces/Attributes/AttributeCategoriesTableFilters/AttributeCategoriesTableFilters.tsxindex fb94022e29..517bd8b7d7 100644--- a/apps/carbon/app/interfaces/Resources/Attributes/AttributeCategoriesTableFilters/AttributeCategoriesTableFilters.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Attributes/AttributeCategoriesTableFilters/AttributeCategoriesTableFilters.tsx@@ -24,7 +24,7 @@ const AttributeCategoriesTableFilters = () => {param="name"size="sm"minW={180}- placeholder="Search by name"+ placeholder="Filter by name"/></HStack><HStack spacing={2}>diff --git a/apps/carbon/app/interfaces/Resources/Attributes/AttributeCategoriesTableFilters/index.ts b/apps/carbon/app/modules/resources/interfaces/Attributes/AttributeCategoriesTableFilters/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Attributes/AttributeCategoriesTableFilters/index.tsrename to apps/carbon/app/modules/resources/interfaces/Attributes/AttributeCategoriesTableFilters/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Attributes/AttributeCategoryDetail/AttributeCategoryDetail.tsx b/apps/carbon/app/modules/resources/interfaces/Attributes/AttributeCategoryDetail/AttributeCategoryDetail.tsxsimilarity index 99%rename from apps/carbon/app/interfaces/Resources/Attributes/AttributeCategoryDetail/AttributeCategoryDetail.tsxrename to apps/carbon/app/modules/resources/interfaces/Attributes/AttributeCategoryDetail/AttributeCategoryDetail.tsxindex 60c2f7bc8e..e5aa1ae0b7 100644--- a/apps/carbon/app/interfaces/Resources/Attributes/AttributeCategoryDetail/AttributeCategoryDetail.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Attributes/AttributeCategoryDetail/AttributeCategoryDetail.tsx@@ -29,7 +29,7 @@ import { ConfirmDelete } from "~/components/Modals";import type {Attribute,AttributeCategoryDetail as AttributeCategoryDetailType,-} from "~/interfaces/Resources/types";+} from "~/modules/resources";import { useUrlParams } from "~/hooks";type AttributeCategoryDetailProps = {diff --git a/apps/carbon/app/interfaces/Resources/Attributes/AttributeCategoryDetail/index.ts b/apps/carbon/app/modules/resources/interfaces/Attributes/AttributeCategoryDetail/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Attributes/AttributeCategoryDetail/index.tsrename to apps/carbon/app/modules/resources/interfaces/Attributes/AttributeCategoryDetail/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Attributes/AttributeCategoryForm/AttributeCategoryForm.tsx b/apps/carbon/app/modules/resources/interfaces/Attributes/AttributeCategoryForm/AttributeCategoryForm.tsxsimilarity index 97%rename from apps/carbon/app/interfaces/Resources/Attributes/AttributeCategoryForm/AttributeCategoryForm.tsxrename to apps/carbon/app/modules/resources/interfaces/Attributes/AttributeCategoryForm/AttributeCategoryForm.tsxindex df457d031a..58532873c1 100644--- a/apps/carbon/app/interfaces/Resources/Attributes/AttributeCategoryForm/AttributeCategoryForm.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Attributes/AttributeCategoryForm/AttributeCategoryForm.tsx@@ -13,7 +13,7 @@ import {import { ValidatedForm } from "remix-validated-form";import { Boolean, Input, Hidden, Submit } from "~/components/Form";import { usePermissions } from "~/hooks";-import { attributeCategoryValidator } from "~/services/resources";+import { attributeCategoryValidator } from "~/modules/resources";import type { TypeOfValidator } from "~/types/validators";type AttributeCategoryFormProps = {diff --git a/apps/carbon/app/interfaces/Resources/Attributes/AttributeCategoryForm/index.ts b/apps/carbon/app/modules/resources/interfaces/Attributes/AttributeCategoryForm/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Attributes/AttributeCategoryForm/index.tsrename to apps/carbon/app/modules/resources/interfaces/Attributes/AttributeCategoryForm/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Attributes/AttributeForm/AttributeForm.tsx b/apps/carbon/app/modules/resources/interfaces/Attributes/AttributeForm/AttributeForm.tsxsimilarity index 96%rename from apps/carbon/app/interfaces/Resources/Attributes/AttributeForm/AttributeForm.tsxrename to apps/carbon/app/modules/resources/interfaces/Attributes/AttributeForm/AttributeForm.tsxindex 08a06085ba..50e19444a2 100644--- a/apps/carbon/app/interfaces/Resources/Attributes/AttributeForm/AttributeForm.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Attributes/AttributeForm/AttributeForm.tsx@@ -21,8 +21,8 @@ import {Select,} from "~/components/Form";import { usePermissions } from "~/hooks";-import { DataType } from "~/interfaces/Users/types";-import { attributeValidator } from "~/services/resources";+import { attributeValidator } from "~/modules/resources";+import { DataType } from "~/modules/users";import type { TypeOfValidator } from "~/types/validators";import { mapRowsToOptions } from "~/utils/form";diff --git a/apps/carbon/app/interfaces/Resources/Attributes/AttributeForm/index.ts b/apps/carbon/app/modules/resources/interfaces/Attributes/AttributeForm/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Attributes/AttributeForm/index.tsrename to apps/carbon/app/modules/resources/interfaces/Attributes/AttributeForm/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Attributes/index.ts b/apps/carbon/app/modules/resources/interfaces/Attributes/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Attributes/index.tsrename to apps/carbon/app/modules/resources/interfaces/Attributes/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Departments/DepartmentForm/DepartmentForm.tsx b/apps/carbon/app/modules/resources/interfaces/Departments/DepartmentForm/DepartmentForm.tsxsimilarity index 97%rename from apps/carbon/app/interfaces/Resources/Departments/DepartmentForm/DepartmentForm.tsxrename to apps/carbon/app/modules/resources/interfaces/Departments/DepartmentForm/DepartmentForm.tsxindex 77667c0c6f..9deda10204 100644--- a/apps/carbon/app/interfaces/Resources/Departments/DepartmentForm/DepartmentForm.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Departments/DepartmentForm/DepartmentForm.tsx@@ -14,7 +14,7 @@ import { useNavigate } from "@remix-run/react";import { ValidatedForm } from "remix-validated-form";import { Color, Department, Hidden, Input, Submit } from "~/components/Form";import { usePermissions } from "~/hooks";-import { departmentValidator } from "~/services/resources";+import { departmentValidator } from "~/modules/resources";import type { TypeOfValidator } from "~/types/validators";type DepartmentFormProps = {diff --git a/apps/carbon/app/interfaces/Resources/Departments/DepartmentForm/index.ts b/apps/carbon/app/modules/resources/interfaces/Departments/DepartmentForm/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Departments/DepartmentForm/index.tsrename to apps/carbon/app/modules/resources/interfaces/Departments/DepartmentForm/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Departments/DepartmentsTable/DepartmentsTable.tsx b/apps/carbon/app/modules/resources/interfaces/Departments/DepartmentsTable/DepartmentsTable.tsxsimilarity index 97%rename from apps/carbon/app/interfaces/Resources/Departments/DepartmentsTable/DepartmentsTable.tsxrename to apps/carbon/app/modules/resources/interfaces/Departments/DepartmentsTable/DepartmentsTable.tsxindex 9966d79751..73a0e5e282 100644--- a/apps/carbon/app/interfaces/Resources/Departments/DepartmentsTable/DepartmentsTable.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Departments/DepartmentsTable/DepartmentsTable.tsx@@ -6,7 +6,7 @@ import { BsPencilSquare } from "react-icons/bs";import { IoMdTrash } from "react-icons/io";import { Table } from "~/components";import { usePermissions, useUrlParams } from "~/hooks";-import type { Department } from "~/interfaces/Resources/types";+import type { Department } from "~/modules/resources";type DepartmentsTableProps = {data: Department[];diff --git a/apps/carbon/app/interfaces/Resources/Departments/DepartmentsTable/index.ts b/apps/carbon/app/modules/resources/interfaces/Departments/DepartmentsTable/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Departments/DepartmentsTable/index.tsrename to apps/carbon/app/modules/resources/interfaces/Departments/DepartmentsTable/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Departments/DepartmentsTableFilters/DepartmentsTableFilters.tsx b/apps/carbon/app/modules/resources/interfaces/Departments/DepartmentsTableFilters/DepartmentsTableFilters.tsxsimilarity index 96%rename from apps/carbon/app/interfaces/Resources/Departments/DepartmentsTableFilters/DepartmentsTableFilters.tsxrename to apps/carbon/app/modules/resources/interfaces/Departments/DepartmentsTableFilters/DepartmentsTableFilters.tsxindex 76af94cf46..d5896328d2 100644--- a/apps/carbon/app/interfaces/Resources/Departments/DepartmentsTableFilters/DepartmentsTableFilters.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Departments/DepartmentsTableFilters/DepartmentsTableFilters.tsx@@ -25,7 +25,7 @@ const DepartmentsTableFilters = () => {param="name"size="sm"minW={180}- placeholder="Search by name"+ placeholder="Filter by name"/></HStack><HStack spacing={2}>diff --git a/apps/carbon/app/interfaces/Resources/Departments/DepartmentsTableFilters/index.ts b/apps/carbon/app/modules/resources/interfaces/Departments/DepartmentsTableFilters/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Departments/DepartmentsTableFilters/index.tsrename to apps/carbon/app/modules/resources/interfaces/Departments/DepartmentsTableFilters/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Departments/index.ts b/apps/carbon/app/modules/resources/interfaces/Departments/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Departments/index.tsrename to apps/carbon/app/modules/resources/interfaces/Departments/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Equipment/EquipmentForm/EquipmentForm.tsx b/apps/carbon/app/modules/resources/interfaces/Equipment/EquipmentForm/EquipmentForm.tsxsimilarity index 97%rename from apps/carbon/app/interfaces/Resources/Equipment/EquipmentForm/EquipmentForm.tsxrename to apps/carbon/app/modules/resources/interfaces/Equipment/EquipmentForm/EquipmentForm.tsxindex 7231dbcf2f..41ffa71ecd 100644--- a/apps/carbon/app/interfaces/Resources/Equipment/EquipmentForm/EquipmentForm.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Equipment/EquipmentForm/EquipmentForm.tsx@@ -26,8 +26,8 @@ import {TextArea,} from "~/components/Form";import { usePermissions } from "~/hooks";-import type { getWorkCellList } from "~/services/resources";-import { equipmentValidator } from "~/services/resources";+import type { getWorkCellList } from "~/modules/resources";+import { equipmentValidator } from "~/modules/resources";import type { TypeOfValidator } from "~/types/validators";import { mapRowsToOptions } from "~/utils/form";diff --git a/apps/carbon/app/interfaces/Resources/Equipment/EquipmentForm/index.ts b/apps/carbon/app/modules/resources/interfaces/Equipment/EquipmentForm/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Equipment/EquipmentForm/index.tsrename to apps/carbon/app/modules/resources/interfaces/Equipment/EquipmentForm/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Equipment/EquipmentTypeDetail/EquipmentTypeDetail.tsx b/apps/carbon/app/modules/resources/interfaces/Equipment/EquipmentTypeDetail/EquipmentTypeDetail.tsxsimilarity index 98%rename from apps/carbon/app/interfaces/Resources/Equipment/EquipmentTypeDetail/EquipmentTypeDetail.tsxrename to apps/carbon/app/modules/resources/interfaces/Equipment/EquipmentTypeDetail/EquipmentTypeDetail.tsxindex 28c4ebf86a..a49e1cf97a 100644--- a/apps/carbon/app/interfaces/Resources/Equipment/EquipmentTypeDetail/EquipmentTypeDetail.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Equipment/EquipmentTypeDetail/EquipmentTypeDetail.tsx@@ -20,7 +20,7 @@ import { useState } from "react";import { BsPencilSquare } from "react-icons/bs";import { IoMdTrash } from "react-icons/io";import { ConfirmDelete } from "~/components/Modals";-import type { EquipmentTypeDetail as EquipmentTypeDetailType } from "~/interfaces/Resources/types";+import type { EquipmentTypeDetail as EquipmentTypeDetailType } from "~/modules/resources";import { useUrlParams } from "~/hooks";type Equipment = {diff --git a/apps/carbon/app/interfaces/Resources/Equipment/EquipmentTypeDetail/index.ts b/apps/carbon/app/modules/resources/interfaces/Equipment/EquipmentTypeDetail/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Equipment/EquipmentTypeDetail/index.tsrename to apps/carbon/app/modules/resources/interfaces/Equipment/EquipmentTypeDetail/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Equipment/EquipmentTypeForm/EquipmentTypeForm.tsx b/apps/carbon/app/modules/resources/interfaces/Equipment/EquipmentTypeForm/EquipmentTypeForm.tsxsimilarity index 97%rename from apps/carbon/app/interfaces/Resources/Equipment/EquipmentTypeForm/EquipmentTypeForm.tsxrename to apps/carbon/app/modules/resources/interfaces/Equipment/EquipmentTypeForm/EquipmentTypeForm.tsxindex 2663858ac3..23983e0375 100644--- a/apps/carbon/app/interfaces/Resources/Equipment/EquipmentTypeForm/EquipmentTypeForm.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Equipment/EquipmentTypeForm/EquipmentTypeForm.tsx@@ -20,7 +20,7 @@ import {Ability,} from "~/components/Form";import { usePermissions } from "~/hooks";-import { equipmentTypeValidator } from "~/services/resources";+import { equipmentTypeValidator } from "~/modules/resources";import type { TypeOfValidator } from "~/types/validators";type EquipmentTypeFormProps = {diff --git a/apps/carbon/app/interfaces/Resources/Equipment/EquipmentTypeForm/index.ts b/apps/carbon/app/modules/resources/interfaces/Equipment/EquipmentTypeForm/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Equipment/EquipmentTypeForm/index.tsrename to apps/carbon/app/modules/resources/interfaces/Equipment/EquipmentTypeForm/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Equipment/EquipmentTypesTable/EquipmentTypesTable.tsx b/apps/carbon/app/modules/resources/interfaces/Equipment/EquipmentTypesTable/EquipmentTypesTable.tsxsimilarity index 98%rename from apps/carbon/app/interfaces/Resources/Equipment/EquipmentTypesTable/EquipmentTypesTable.tsxrename to apps/carbon/app/modules/resources/interfaces/Equipment/EquipmentTypesTable/EquipmentTypesTable.tsxindex 4c6ee53770..e7a49c3bb4 100644--- a/apps/carbon/app/interfaces/Resources/Equipment/EquipmentTypesTable/EquipmentTypesTable.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Equipment/EquipmentTypesTable/EquipmentTypesTable.tsx@@ -23,7 +23,7 @@ import { IoMdTrash } from "react-icons/io";import { Table } from "~/components";import { ConfirmDelete } from "~/components/Modals";import { usePermissions, useUrlParams } from "~/hooks";-import type { EquipmentType } from "~/interfaces/Resources/types";+import type { EquipmentType } from "~/modules/resources";type EquipmentTypesTableProps = {data: EquipmentType[];diff --git a/apps/carbon/app/interfaces/Resources/Equipment/EquipmentTypesTable/index.ts b/apps/carbon/app/modules/resources/interfaces/Equipment/EquipmentTypesTable/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Equipment/EquipmentTypesTable/index.tsrename to apps/carbon/app/modules/resources/interfaces/Equipment/EquipmentTypesTable/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Equipment/EquipmentTypesTableFilters/EquipmentTypesTableFilters.tsx b/apps/carbon/app/modules/resources/interfaces/Equipment/EquipmentTypesTableFilters/EquipmentTypesTableFilters.tsxsimilarity index 96%rename from apps/carbon/app/interfaces/Resources/Equipment/EquipmentTypesTableFilters/EquipmentTypesTableFilters.tsxrename to apps/carbon/app/modules/resources/interfaces/Equipment/EquipmentTypesTableFilters/EquipmentTypesTableFilters.tsxindex ec456557ad..15dd588a40 100644--- a/apps/carbon/app/interfaces/Resources/Equipment/EquipmentTypesTableFilters/EquipmentTypesTableFilters.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Equipment/EquipmentTypesTableFilters/EquipmentTypesTableFilters.tsx@@ -24,7 +24,7 @@ const EquipmentTypesTableFilters = () => {param="name"size="sm"minW={180}- placeholder="Search by name"+ placeholder="Filter by name"/></HStack><HStack spacing={2}>diff --git a/apps/carbon/app/interfaces/Resources/Equipment/EquipmentTypesTableFilters/index.ts b/apps/carbon/app/modules/resources/interfaces/Equipment/EquipmentTypesTableFilters/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Equipment/EquipmentTypesTableFilters/index.tsrename to apps/carbon/app/modules/resources/interfaces/Equipment/EquipmentTypesTableFilters/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Equipment/index.ts b/apps/carbon/app/modules/resources/interfaces/Equipment/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Equipment/index.tsrename to apps/carbon/app/modules/resources/interfaces/Equipment/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Holidays/HolidayForm/HolidayForm.tsx b/apps/carbon/app/modules/resources/interfaces/Holidays/HolidayForm/HolidayForm.tsxsimilarity index 97%rename from apps/carbon/app/interfaces/Resources/Holidays/HolidayForm/HolidayForm.tsxrename to apps/carbon/app/modules/resources/interfaces/Holidays/HolidayForm/HolidayForm.tsxindex aa1e504970..e86258927e 100644--- a/apps/carbon/app/interfaces/Resources/Holidays/HolidayForm/HolidayForm.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Holidays/HolidayForm/HolidayForm.tsx@@ -14,7 +14,7 @@ import { useNavigate } from "@remix-run/react";import { ValidatedForm } from "remix-validated-form";import { DatePicker, Hidden, Input, Submit } from "~/components/Form";import { usePermissions } from "~/hooks";-import { holidayValidator } from "~/services/resources";+import { holidayValidator } from "~/modules/resources";import type { TypeOfValidator } from "~/types/validators";type HolidayFormProps = {diff --git a/apps/carbon/app/interfaces/Resources/Holidays/HolidayForm/index.ts b/apps/carbon/app/modules/resources/interfaces/Holidays/HolidayForm/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Holidays/HolidayForm/index.tsrename to apps/carbon/app/modules/resources/interfaces/Holidays/HolidayForm/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Holidays/HolidaysTable/HolidaysTable.tsx b/apps/carbon/app/modules/resources/interfaces/Holidays/HolidaysTable/HolidaysTable.tsxsimilarity index 97%rename from apps/carbon/app/interfaces/Resources/Holidays/HolidaysTable/HolidaysTable.tsxrename to apps/carbon/app/modules/resources/interfaces/Holidays/HolidaysTable/HolidaysTable.tsxindex a0e2e9d5bd..dbe53ec2de 100644--- a/apps/carbon/app/interfaces/Resources/Holidays/HolidaysTable/HolidaysTable.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Holidays/HolidaysTable/HolidaysTable.tsx@@ -6,7 +6,7 @@ import { BsPencilSquare } from "react-icons/bs";import { IoMdTrash } from "react-icons/io";import { Table } from "~/components";import { usePermissions, useUrlParams } from "~/hooks";-import type { Holiday } from "~/interfaces/Resources/types";+import type { Holiday } from "~/modules/resources";type HolidaysTableProps = {data: Holiday[];diff --git a/apps/carbon/app/interfaces/Resources/Holidays/HolidaysTable/index.ts b/apps/carbon/app/modules/resources/interfaces/Holidays/HolidaysTable/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Holidays/HolidaysTable/index.tsrename to apps/carbon/app/modules/resources/interfaces/Holidays/HolidaysTable/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Holidays/HolidaysTableFilters/HolidaysTableFilters.tsx b/apps/carbon/app/modules/resources/interfaces/Holidays/HolidaysTableFilters/HolidaysTableFilters.tsxsimilarity index 98%rename from apps/carbon/app/interfaces/Resources/Holidays/HolidaysTableFilters/HolidaysTableFilters.tsxrename to apps/carbon/app/modules/resources/interfaces/Holidays/HolidaysTableFilters/HolidaysTableFilters.tsxindex b7302c6cf1..322ccfad39 100644--- a/apps/carbon/app/interfaces/Resources/Holidays/HolidaysTableFilters/HolidaysTableFilters.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Holidays/HolidaysTableFilters/HolidaysTableFilters.tsx@@ -34,7 +34,7 @@ const HolidaysTableFilters = ({ years }: HolidaysTableFiltersProps) => {param="name"size="sm"minW={180}- placeholder="Search by name"+ placeholder="Filter by name"/><Select// @ts-ignorediff --git a/apps/carbon/app/interfaces/Resources/Holidays/HolidaysTableFilters/index.ts b/apps/carbon/app/modules/resources/interfaces/Holidays/HolidaysTableFilters/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Holidays/HolidaysTableFilters/index.tsrename to apps/carbon/app/modules/resources/interfaces/Holidays/HolidaysTableFilters/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Holidays/index.ts b/apps/carbon/app/modules/resources/interfaces/Holidays/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Holidays/index.tsrename to apps/carbon/app/modules/resources/interfaces/Holidays/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Locations/LocationForm/LocationForm.tsx b/apps/carbon/app/modules/resources/interfaces/Locations/LocationForm/LocationForm.tsxsimilarity index 97%rename from apps/carbon/app/interfaces/Resources/Locations/LocationForm/LocationForm.tsxrename to apps/carbon/app/modules/resources/interfaces/Locations/LocationForm/LocationForm.tsxindex cd1bd97e47..05338bc67e 100644--- a/apps/carbon/app/interfaces/Resources/Locations/LocationForm/LocationForm.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Locations/LocationForm/LocationForm.tsx@@ -14,7 +14,7 @@ import { useNavigate } from "@remix-run/react";import { ValidatedForm } from "remix-validated-form";import { Hidden, Input, Number, Submit, Timezone } from "~/components/Form";import { usePermissions } from "~/hooks";-import { locationValidator } from "~/services/resources";+import { locationValidator } from "~/modules/resources";import type { TypeOfValidator } from "~/types/validators";type LocationFormProps = {diff --git a/apps/carbon/app/interfaces/Resources/Locations/LocationForm/index.ts b/apps/carbon/app/modules/resources/interfaces/Locations/LocationForm/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Locations/LocationForm/index.tsrename to apps/carbon/app/modules/resources/interfaces/Locations/LocationForm/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Locations/LocationsTable/LocationsTable.tsx b/apps/carbon/app/modules/resources/interfaces/Locations/LocationsTable/LocationsTable.tsxsimilarity index 97%rename from apps/carbon/app/interfaces/Resources/Locations/LocationsTable/LocationsTable.tsxrename to apps/carbon/app/modules/resources/interfaces/Locations/LocationsTable/LocationsTable.tsxindex 81636a9602..52db75f2e9 100644--- a/apps/carbon/app/interfaces/Resources/Locations/LocationsTable/LocationsTable.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Locations/LocationsTable/LocationsTable.tsx@@ -6,7 +6,7 @@ import { BsPencilSquare } from "react-icons/bs";import { IoMdTrash } from "react-icons/io";import { Table } from "~/components";import { usePermissions, useUrlParams } from "~/hooks";-import type { ShiftLocation } from "~/interfaces/Resources/types";+import type { ShiftLocation } from "~/modules/resources";type LocationsTableProps = {data: ShiftLocation[];diff --git a/apps/carbon/app/interfaces/Resources/Locations/LocationsTable/index.ts b/apps/carbon/app/modules/resources/interfaces/Locations/LocationsTable/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Locations/LocationsTable/index.tsrename to apps/carbon/app/modules/resources/interfaces/Locations/LocationsTable/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Locations/LocationsTableFilters/LocationsTableFilters.tsx b/apps/carbon/app/modules/resources/interfaces/Locations/LocationsTableFilters/LocationsTableFilters.tsxsimilarity index 96%rename from apps/carbon/app/interfaces/Resources/Locations/LocationsTableFilters/LocationsTableFilters.tsxrename to apps/carbon/app/modules/resources/interfaces/Locations/LocationsTableFilters/LocationsTableFilters.tsxindex 358a9d0181..9d75eca64c 100644--- a/apps/carbon/app/interfaces/Resources/Locations/LocationsTableFilters/LocationsTableFilters.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Locations/LocationsTableFilters/LocationsTableFilters.tsx@@ -25,7 +25,7 @@ const LocationsTableFilters = () => {param="name"size="sm"minW={180}- placeholder="Search by name"+ placeholder="Filter by name"/></HStack><HStack spacing={2}>diff --git a/apps/carbon/app/interfaces/Resources/Locations/LocationsTableFilters/index.ts b/apps/carbon/app/modules/resources/interfaces/Locations/LocationsTableFilters/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Locations/LocationsTableFilters/index.tsrename to apps/carbon/app/modules/resources/interfaces/Locations/LocationsTableFilters/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Locations/index.ts b/apps/carbon/app/modules/resources/interfaces/Locations/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Locations/index.tsrename to apps/carbon/app/modules/resources/interfaces/Locations/index.tsdiff --git a/apps/carbon/app/modules/resources/interfaces/Partners/PartnerForm/PartnerForm.tsx b/apps/carbon/app/modules/resources/interfaces/Partners/PartnerForm/PartnerForm.tsxnew file mode 100644index 0000000000..27e02b8722--- /dev/null+++ b/apps/carbon/app/modules/resources/interfaces/Partners/PartnerForm/PartnerForm.tsx@@ -0,0 +1,81 @@+import {+ Button,+ Drawer,+ DrawerBody,+ DrawerCloseButton,+ DrawerContent,+ DrawerFooter,+ DrawerHeader,+ DrawerOverlay,+ HStack,+ VStack,+} from "@chakra-ui/react";+import { useNavigate } from "@remix-run/react";+import { ValidatedForm } from "remix-validated-form";+import { Number, Submit, Supplier } from "~/components/Form";+import { usePermissions } from "~/hooks";+import { partnerValidator } from "~/modules/resources";+import type { TypeOfValidator } from "~/types/validators";++type SupplierFormProps = {+ initialValues: TypeOfValidator<typeof partnerValidator>;+};++const SupplierForm = ({ initialValues }: SupplierFormProps) => {+ const permissions = usePermissions();+ const navigate = useNavigate();+ const onClose = () => navigate(-1);++ const isEditing = initialValues.id !== "";+ const isDisabled = isEditing+ ? !permissions.can("update", "resources")+ : !permissions.can("create", "resources");++ return (+ <Drawer onClose={onClose} isOpen={true} size="sm">+ <ValidatedForm+ validator={partnerValidator}+ method="post"+ action={+ isEditing+ ? `/x/resources/partners/${initialValues.id}`+ : "/x/resources/partners/new"+ }+ defaultValues={initialValues}+ >+ <DrawerOverlay />+ <DrawerContent>+ <DrawerCloseButton />+ <DrawerHeader>{isEditing ? "Edit" : "New"} Supplier</DrawerHeader>+ <DrawerBody pb={8}>+ <VStack spacing={4} alignItems="start">+ <Supplier name="id" label="Supplier" />+ <Number+ name="hoursPerWeek"+ label="Hours per Week"+ helperText="The number of hours per week the supplier is available to work."+ min={0}+ max={10000}+ />+ </VStack>+ </DrawerBody>+ <DrawerFooter>+ <HStack spacing={2}>+ <Submit isDisabled={isDisabled}>Save</Submit>+ <Button+ size="md"+ colorScheme="gray"+ variant="solid"+ onClick={onClose}+ >+ Cancel+ </Button>+ </HStack>+ </DrawerFooter>+ </DrawerContent>+ </ValidatedForm>+ </Drawer>+ );+};++export default SupplierForm;diff --git a/apps/carbon/app/modules/resources/interfaces/Partners/PartnerForm/index.ts b/apps/carbon/app/modules/resources/interfaces/Partners/PartnerForm/index.tsnew file mode 100644index 0000000000..14124cdb70--- /dev/null+++ b/apps/carbon/app/modules/resources/interfaces/Partners/PartnerForm/index.ts@@ -0,0 +1,3 @@+import PartnerForm from "./PartnerForm";++export default PartnerForm;diff --git a/apps/carbon/app/modules/resources/interfaces/Partners/PartnersTable/PartnersTable.tsx b/apps/carbon/app/modules/resources/interfaces/Partners/PartnersTable/PartnersTable.tsxnew file mode 100644index 0000000000..9bb5651549--- /dev/null+++ b/apps/carbon/app/modules/resources/interfaces/Partners/PartnersTable/PartnersTable.tsx@@ -0,0 +1,101 @@+import { Avatar, HStack, Link, MenuItem } from "@chakra-ui/react";+import { useNavigate } from "@remix-run/react";+import type { ColumnDef } from "@tanstack/react-table";+import { memo, useCallback, useMemo } from "react";+import { BsPencilSquare } from "react-icons/bs";+import { IoMdTrash } from "react-icons/io";+import { Table } from "~/components";+import { usePermissions, useUrlParams } from "~/hooks";+import type { Partner } from "~/modules/resources";++type PartnersTableProps = {+ data: Partner[];+ count: number;+};++const PartnersTable = memo(({ data, count }: PartnersTableProps) => {+ const navigate = useNavigate();+ const permissions = usePermissions();+ const [params] = useUrlParams();++ const rows = data.map((row) => {+ if (Array.isArray(row.supplier)) {+ return {+ ...row,+ supplierName: row.supplier[0].name,+ };+ }+ return {+ ...row,+ supplierName: row.supplier?.name,+ };+ });++ const columns = useMemo<ColumnDef<typeof rows[number]>[]>(() => {+ return [+ {+ accessorKey: "supplier",+ header: "Supplier",+ cell: ({ row }) => (+ <HStack spacing={2}>+ <Avatar size="sm" name={row.original.supplierName} />++ <Link+ onClick={() => {+ navigate(`/x/purchasing/suppliers/${row?.original.id}`);+ }}+ >+ {row.original.supplierName}+ </Link>+ </HStack>+ ),+ },+ {+ accessorKey: "hoursPerWeek",+ header: "Hours per Week",+ cell: (item) => item.getValue(),+ },+ ];+ }, [navigate]);++ const renderContextMenu = useCallback(+ (row: typeof rows[number]) => {+ return (+ <>+ <MenuItem+ icon={<BsPencilSquare />}+ onClick={() => {+ navigate(`/x/resources/partners/${row.id}?${params.toString()}`);+ }}+ >+ Edit Partner+ </MenuItem>+ <MenuItem+ isDisabled={!permissions.can("delete", "resources")}+ icon={<IoMdTrash />}+ onClick={() => {+ navigate(+ `/x/resources/partners/delete/${row.id}?${params.toString()}`+ );+ }}+ >+ Delete Partner+ </MenuItem>+ </>+ );+ },+ [navigate, params, permissions]+ );++ return (+ <Table<typeof rows[number]>+ data={rows}+ count={count}+ columns={columns}+ renderContextMenu={renderContextMenu}+ />+ );+});++PartnersTable.displayName = "PartnersTable";+export default PartnersTable;diff --git a/apps/carbon/app/modules/resources/interfaces/Partners/PartnersTable/index.ts b/apps/carbon/app/modules/resources/interfaces/Partners/PartnersTable/index.tsnew file mode 100644index 0000000000..082843e88e--- /dev/null+++ b/apps/carbon/app/modules/resources/interfaces/Partners/PartnersTable/index.ts@@ -0,0 +1,3 @@+import PartnersTable from "./PartnersTable";++export default PartnersTable;diff --git a/apps/carbon/app/modules/resources/interfaces/Partners/PartnersTableFilters/PartnersTableFilters.tsx b/apps/carbon/app/modules/resources/interfaces/Partners/PartnersTableFilters/PartnersTableFilters.tsxnew file mode 100644index 0000000000..f232e137d9--- /dev/null+++ b/apps/carbon/app/modules/resources/interfaces/Partners/PartnersTableFilters/PartnersTableFilters.tsx@@ -0,0 +1,47 @@+import { useColor } from "@carbon/react";+import { Button, HStack } from "@chakra-ui/react";+import { Link } from "@remix-run/react";+import { IoMdAdd } from "react-icons/io";+import { DebouncedInput } from "~/components/Search";+import { usePermissions, useUrlParams } from "~/hooks";++const LocationsTableFilters = () => {+ const [params] = useUrlParams();+ const permissions = usePermissions();+ const borderColor = useColor("gray.200");++ return (+ <HStack+ borderBottomColor={borderColor}+ borderBottomStyle="solid"+ borderBottomWidth={1}+ justifyContent="space-between"+ px={4}+ py={3}+ w="full"+ >+ <HStack spacing={2}>+ <DebouncedInput+ param="name"+ size="sm"+ minW={180}+ placeholder="Filter by name"+ />+ </HStack>+ <HStack spacing={2}>+ {permissions.can("create", "resources") && (+ <Button+ as={Link}+ to={`new?${params.toString()}`}+ colorScheme="brand"+ leftIcon={<IoMdAdd />}+ >+ New Partner+ </Button>+ )}+ </HStack>+ </HStack>+ );+};++export default LocationsTableFilters;diff --git a/apps/carbon/app/modules/resources/interfaces/Partners/PartnersTableFilters/index.ts b/apps/carbon/app/modules/resources/interfaces/Partners/PartnersTableFilters/index.tsnew file mode 100644index 0000000000..2b1d86f2c2--- /dev/null+++ b/apps/carbon/app/modules/resources/interfaces/Partners/PartnersTableFilters/index.ts@@ -0,0 +1,3 @@+import PartnersTableFilters from "./PartnersTableFilters";++export default PartnersTableFilters;diff --git a/apps/carbon/app/modules/resources/interfaces/Partners/index.ts b/apps/carbon/app/modules/resources/interfaces/Partners/index.tsnew file mode 100644index 0000000000..0ec638805b--- /dev/null+++ b/apps/carbon/app/modules/resources/interfaces/Partners/index.ts@@ -0,0 +1,5 @@+import PartnersTable from "./PartnersTable";+import PartnersTableFilters from "./PartnersTableFilters";+import PartnerForm from "./PartnerForm";++export { PartnersTable, PartnersTableFilters, PartnerForm };diff --git a/apps/carbon/app/interfaces/Resources/People/PeopleTable/PeopleTable.tsx b/apps/carbon/app/modules/resources/interfaces/People/PeopleTable/PeopleTable.tsxsimilarity index 98%rename from apps/carbon/app/interfaces/Resources/People/PeopleTable/PeopleTable.tsxrename to apps/carbon/app/modules/resources/interfaces/People/PeopleTable/PeopleTable.tsxindex 846bdaa095..5e5d15107a 100644--- a/apps/carbon/app/interfaces/Resources/People/PeopleTable/PeopleTable.tsx+++ b/apps/carbon/app/modules/resources/interfaces/People/PeopleTable/PeopleTable.tsx@@ -5,8 +5,8 @@ import { memo, useCallback, useMemo } from "react";import { BsPencilSquare } from "react-icons/bs";import { Avatar, Table } from "~/components";import { usePermissions, useUrlParams } from "~/hooks";-import type { AttributeCategory, Person } from "~/interfaces/Resources/types";-import { DataType } from "~/interfaces/Users/types";+import type { AttributeCategory, Person } from "~/modules/resources";+import { DataType } from "~/modules/users";type PeopleTableProps = {attributeCategories: AttributeCategory[];diff --git a/apps/carbon/app/interfaces/Resources/People/PeopleTable/index.ts b/apps/carbon/app/modules/resources/interfaces/People/PeopleTable/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/People/PeopleTable/index.tsrename to apps/carbon/app/modules/resources/interfaces/People/PeopleTable/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/People/PeopleTableFilters/PeopleTableFilters.tsx b/apps/carbon/app/modules/resources/interfaces/People/PeopleTableFilters/PeopleTableFilters.tsxsimilarity index 96%rename from apps/carbon/app/interfaces/Resources/People/PeopleTableFilters/PeopleTableFilters.tsxrename to apps/carbon/app/modules/resources/interfaces/People/PeopleTableFilters/PeopleTableFilters.tsxindex 873db8f553..90612c592f 100644--- a/apps/carbon/app/interfaces/Resources/People/PeopleTableFilters/PeopleTableFilters.tsx+++ b/apps/carbon/app/modules/resources/interfaces/People/PeopleTableFilters/PeopleTableFilters.tsx@@ -4,7 +4,7 @@ import { Link } from "@remix-run/react";import { IoMdAdd } from "react-icons/io";import { DebouncedInput } from "~/components/Search";import { usePermissions, useUrlParams } from "~/hooks";-import type { EmployeeType } from "~/interfaces/Users/types";+import type { EmployeeType } from "~/modules/users";import { mapRowsToOptions } from "~/utils/form";type PeopleTableFiltersProps = {@@ -37,7 +37,7 @@ const PeopleTableFilters = ({ employeeTypes }: PeopleTableFiltersProps) => {param="name"size="sm"minW={180}- placeholder="Search by name"+ placeholder="Filter by name"/><Select// @ts-ignorediff --git a/apps/carbon/app/interfaces/Resources/People/PeopleTableFilters/index.ts b/apps/carbon/app/modules/resources/interfaces/People/PeopleTableFilters/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/People/PeopleTableFilters/index.tsrename to apps/carbon/app/modules/resources/interfaces/People/PeopleTableFilters/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/People/index.ts b/apps/carbon/app/modules/resources/interfaces/People/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/People/index.tsrename to apps/carbon/app/modules/resources/interfaces/People/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Person/PersonAbilities/PersonAbilities.tsx b/apps/carbon/app/modules/resources/interfaces/Person/PersonAbilities/PersonAbilities.tsxsimilarity index 94%rename from apps/carbon/app/interfaces/Resources/Person/PersonAbilities/PersonAbilities.tsxrename to apps/carbon/app/modules/resources/interfaces/Person/PersonAbilities/PersonAbilities.tsxindex b0505ed881..b6dbc11dfd 100644--- a/apps/carbon/app/interfaces/Resources/Person/PersonAbilities/PersonAbilities.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Person/PersonAbilities/PersonAbilities.tsx@@ -18,9 +18,9 @@ import type { IconType } from "react-icons";import { BsCheckLg, BsBarChartFill } from "react-icons/bs";import { FaThumbsUp } from "react-icons/fa";-import type { EmployeeAbility } from "~/interfaces/Resources/types";-import { getTrainingStatus } from "~/interfaces/Resources/types";-import { AbilityEmployeeStatus } from "~/interfaces/Resources/types";+import type { EmployeeAbility } from "~/modules/resources";+import { getTrainingStatus } from "~/modules/resources";+import { AbilityEmployeeStatus } from "~/modules/resources";type PersonAbilitiesProps = {abilities: EmployeeAbility[];diff --git a/apps/carbon/app/interfaces/Resources/Person/PersonAbilities/index.ts b/apps/carbon/app/modules/resources/interfaces/Person/PersonAbilities/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Person/PersonAbilities/index.tsrename to apps/carbon/app/modules/resources/interfaces/Person/PersonAbilities/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Person/PersonDaysOff/PersonDaysOff.tsx b/apps/carbon/app/modules/resources/interfaces/Person/PersonDaysOff/PersonDaysOff.tsxsimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Person/PersonDaysOff/PersonDaysOff.tsxrename to apps/carbon/app/modules/resources/interfaces/Person/PersonDaysOff/PersonDaysOff.tsxdiff --git a/apps/carbon/app/interfaces/Resources/Person/PersonDaysOff/index.ts b/apps/carbon/app/modules/resources/interfaces/Person/PersonDaysOff/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Person/PersonDaysOff/index.tsrename to apps/carbon/app/modules/resources/interfaces/Person/PersonDaysOff/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Person/PersonHeader/PersonHeader.tsx b/apps/carbon/app/modules/resources/interfaces/Person/PersonHeader/PersonHeader.tsxsimilarity index 94%rename from apps/carbon/app/interfaces/Resources/Person/PersonHeader/PersonHeader.tsxrename to apps/carbon/app/modules/resources/interfaces/Person/PersonHeader/PersonHeader.tsxindex c6fa603bfa..8c3f67d827 100644--- a/apps/carbon/app/interfaces/Resources/Person/PersonHeader/PersonHeader.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Person/PersonHeader/PersonHeader.tsx@@ -2,7 +2,7 @@ import { Button, Heading, HStack, Text, VStack } from "@chakra-ui/react";import { BsEnvelopeFill } from "react-icons/bs";import { Avatar } from "~/components";import { usePermissions } from "~/hooks";-import type { Account } from "~/interfaces/Account/types";+import type { Account } from "~/modules/account";const PersonHeader = ({ user }: { user: Account }) => {const permissions = usePermissions();diff --git a/apps/carbon/app/interfaces/Resources/Person/PersonHeader/index.ts b/apps/carbon/app/modules/resources/interfaces/Person/PersonHeader/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Person/PersonHeader/index.tsrename to apps/carbon/app/modules/resources/interfaces/Person/PersonHeader/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Person/PersonJob/PersonJob.tsx b/apps/carbon/app/modules/resources/interfaces/Person/PersonJob/PersonJob.tsxsimilarity index 90%rename from apps/carbon/app/interfaces/Resources/Person/PersonJob/PersonJob.tsxrename to apps/carbon/app/modules/resources/interfaces/Person/PersonJob/PersonJob.tsxindex d39d3ac441..5ce0615457 100644--- a/apps/carbon/app/interfaces/Resources/Person/PersonJob/PersonJob.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Person/PersonJob/PersonJob.tsx@@ -9,11 +9,18 @@ import {import { useFetcher } from "@remix-run/react";import { useEffect, useMemo, useState } from "react";import { useControlField, useField, ValidatedForm } from "remix-validated-form";-import { Employee, Hidden, Input, Location, Submit } from "~/components/Form";+import {+ DatePicker,+ Employee,+ Hidden,+ Input,+ Location,+ Submit,+} from "~/components/Form";import { SectionTitle } from "~/components/Layout";-import type { EmployeeJob } from "~/interfaces/Resources/types";-import type { getShiftsList } from "~/services/resources";-import { employeeJobValidator } from "~/services/resources";+import type { EmployeeJob } from "~/modules/resources";+import type { getShiftsList } from "~/modules/resources";+import { employeeJobValidator } from "~/modules/resources";import { mapRowsToOptions } from "~/utils/form";type PersonJobProps = {@@ -60,6 +67,7 @@ const PersonJob = ({ job }: PersonJobProps) => {<SectionTitle title="Job" /><VStack w="full" alignItems="start" spacing={4}><Input name="title" label="Title" />+ <DatePicker name="startDate" label="Start Date" /><Locationname="locationId"label="Location"diff --git a/apps/carbon/app/interfaces/Resources/Person/PersonJob/index.ts b/apps/carbon/app/modules/resources/interfaces/Person/PersonJob/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Person/PersonJob/index.tsrename to apps/carbon/app/modules/resources/interfaces/Person/PersonJob/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Person/PersonNotes/PersonNotes.tsx b/apps/carbon/app/modules/resources/interfaces/Person/PersonNotes/PersonNotes.tsxsimilarity index 96%rename from apps/carbon/app/interfaces/Resources/Person/PersonNotes/PersonNotes.tsxrename to apps/carbon/app/modules/resources/interfaces/Person/PersonNotes/PersonNotes.tsxindex ad63b529c9..ad06513103 100644--- a/apps/carbon/app/interfaces/Resources/Person/PersonNotes/PersonNotes.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Person/PersonNotes/PersonNotes.tsx@@ -16,8 +16,8 @@ import { Avatar } from "~/components";import { RichText, Submit } from "~/components/Form";import { SectionTitle } from "~/components/Layout";import { usePermissions, useUser } from "~/hooks";-import type { Note } from "~/interfaces/Resources/types";-import { noteValidator } from "~/services/resources";+import type { Note } from "~/modules/resources";+import { noteValidator } from "~/modules/resources";type PersonNoteProps = {notes: Note[];diff --git a/apps/carbon/app/interfaces/Resources/Person/PersonNotes/index.ts b/apps/carbon/app/modules/resources/interfaces/Person/PersonNotes/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Person/PersonNotes/index.tsrename to apps/carbon/app/modules/resources/interfaces/Person/PersonNotes/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Person/PersonOvertime/PersonOvertime.tsx b/apps/carbon/app/modules/resources/interfaces/Person/PersonOvertime/PersonOvertime.tsxsimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Person/PersonOvertime/PersonOvertime.tsxrename to apps/carbon/app/modules/resources/interfaces/Person/PersonOvertime/PersonOvertime.tsxdiff --git a/apps/carbon/app/interfaces/Resources/Person/PersonOvertime/index.ts b/apps/carbon/app/modules/resources/interfaces/Person/PersonOvertime/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Person/PersonOvertime/index.tsrename to apps/carbon/app/modules/resources/interfaces/Person/PersonOvertime/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Person/PersonTabs/PersonTabs.tsx b/apps/carbon/app/modules/resources/interfaces/Person/PersonTabs/PersonTabs.tsxsimilarity index 85%rename from apps/carbon/app/interfaces/Resources/Person/PersonTabs/PersonTabs.tsxrename to apps/carbon/app/modules/resources/interfaces/Person/PersonTabs/PersonTabs.tsxindex 1d1ff9ad71..c1e84ac2c6 100644--- a/apps/carbon/app/interfaces/Resources/Person/PersonTabs/PersonTabs.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Person/PersonTabs/PersonTabs.tsx@@ -11,15 +11,11 @@ import {} from "@chakra-ui/react";import { BiLockAlt } from "react-icons/bi";import { SectionTitle } from "~/components/Layout";-import { ProfileForm } from "~/interfaces/Account/Profile";-import type {- PublicAttributes,- PrivateAttributes,-} from "~/interfaces/Account/types";-import { UserAttributesForm } from "~/interfaces/Account/UserAttributes";-import type { User } from "~/interfaces/Users/types";-import { PersonJob, PersonNotes } from "~/interfaces/Resources/Person";-import type { EmployeeJob, Note } from "~/interfaces/Resources/types";+import { ProfileForm, UserAttributesForm } from "~/modules/account";+import type { PublicAttributes, PrivateAttributes } from "~/modules/account";+import { PersonJob, PersonNotes } from "~/modules/resources";+import type { EmployeeJob, Note } from "~/modules/resources";+import type { User } from "~/modules/users";type PersonTabsProps = {user: User;diff --git a/apps/carbon/app/interfaces/Resources/Person/PersonTabs/index.ts b/apps/carbon/app/modules/resources/interfaces/Person/PersonTabs/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Person/PersonTabs/index.tsrename to apps/carbon/app/modules/resources/interfaces/Person/PersonTabs/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Person/index.ts b/apps/carbon/app/modules/resources/interfaces/Person/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Person/index.tsrename to apps/carbon/app/modules/resources/interfaces/Person/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Shifts/ShiftForm/ShiftForm.tsx b/apps/carbon/app/modules/resources/interfaces/Shifts/ShiftForm/ShiftForm.tsxsimilarity index 98%rename from apps/carbon/app/interfaces/Resources/Shifts/ShiftForm/ShiftForm.tsxrename to apps/carbon/app/modules/resources/interfaces/Shifts/ShiftForm/ShiftForm.tsxindex cb4aa2b26d..10f2941f36 100644--- a/apps/carbon/app/interfaces/Resources/Shifts/ShiftForm/ShiftForm.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Shifts/ShiftForm/ShiftForm.tsx@@ -23,7 +23,7 @@ import {TimePicker,} from "~/components/Form";import { usePermissions } from "~/hooks";-import { shiftValidator } from "~/services/resources";+import { shiftValidator } from "~/modules/resources";import type { TypeOfValidator } from "~/types/validators";type ShiftFormProps = {diff --git a/apps/carbon/app/interfaces/Resources/Shifts/ShiftForm/index.ts b/apps/carbon/app/modules/resources/interfaces/Shifts/ShiftForm/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Shifts/ShiftForm/index.tsrename to apps/carbon/app/modules/resources/interfaces/Shifts/ShiftForm/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Shifts/ShiftsTable/ShiftsTable.tsx b/apps/carbon/app/modules/resources/interfaces/Shifts/ShiftsTable/ShiftsTable.tsxsimilarity index 98%rename from apps/carbon/app/interfaces/Resources/Shifts/ShiftsTable/ShiftsTable.tsxrename to apps/carbon/app/modules/resources/interfaces/Shifts/ShiftsTable/ShiftsTable.tsxindex 971a39ae9e..72f700dea2 100644--- a/apps/carbon/app/interfaces/Resources/Shifts/ShiftsTable/ShiftsTable.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Shifts/ShiftsTable/ShiftsTable.tsx@@ -7,7 +7,7 @@ import { IoMdTrash } from "react-icons/io";import { Avatar } from "~/components";import { Table } from "~/components";import { usePermissions, useUrlParams } from "~/hooks";-import type { Shift } from "~/interfaces/Resources/types";+import type { Shift } from "~/modules/resources";type ShiftsTableProps = {data: Shift[];diff --git a/apps/carbon/app/interfaces/Resources/Shifts/ShiftsTable/index.ts b/apps/carbon/app/modules/resources/interfaces/Shifts/ShiftsTable/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Shifts/ShiftsTable/index.tsrename to apps/carbon/app/modules/resources/interfaces/Shifts/ShiftsTable/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Shifts/ShiftsTableFilters/ShiftsTableFilters.tsx b/apps/carbon/app/modules/resources/interfaces/Shifts/ShiftsTableFilters/ShiftsTableFilters.tsxsimilarity index 94%rename from apps/carbon/app/interfaces/Resources/Shifts/ShiftsTableFilters/ShiftsTableFilters.tsxrename to apps/carbon/app/modules/resources/interfaces/Shifts/ShiftsTableFilters/ShiftsTableFilters.tsxindex bcbd90cf02..7197dff398 100644--- a/apps/carbon/app/interfaces/Resources/Shifts/ShiftsTableFilters/ShiftsTableFilters.tsx+++ b/apps/carbon/app/modules/resources/interfaces/Shifts/ShiftsTableFilters/ShiftsTableFilters.tsx@@ -4,7 +4,7 @@ import { Link } from "@remix-run/react";import { IoMdAdd } from "react-icons/io";import { DebouncedInput } from "~/components/Search";import { usePermissions, useUrlParams } from "~/hooks";-import type { ShiftLocation } from "~/interfaces/Resources/types";+import type { ShiftLocation } from "~/modules/resources";import { mapRowsToOptions } from "~/utils/form";type ShiftsTableFiltersProps = {@@ -35,7 +35,7 @@ const ShiftsTableFilters = ({ locations }: ShiftsTableFiltersProps) => {param="name"size="sm"minW={180}- placeholder="Search by name"+ placeholder="Filter by name"/><Select// @ts-ignorediff --git a/apps/carbon/app/interfaces/Resources/Shifts/ShiftsTableFilters/index.ts b/apps/carbon/app/modules/resources/interfaces/Shifts/ShiftsTableFilters/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Shifts/ShiftsTableFilters/index.tsrename to apps/carbon/app/modules/resources/interfaces/Shifts/ShiftsTableFilters/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/Shifts/index.ts b/apps/carbon/app/modules/resources/interfaces/Shifts/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/Shifts/index.tsrename to apps/carbon/app/modules/resources/interfaces/Shifts/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/WorkCells/WorkCellForm/WorkCellForm.tsx b/apps/carbon/app/modules/resources/interfaces/WorkCells/WorkCellForm/WorkCellForm.tsxsimilarity index 97%rename from apps/carbon/app/interfaces/Resources/WorkCells/WorkCellForm/WorkCellForm.tsxrename to apps/carbon/app/modules/resources/interfaces/WorkCells/WorkCellForm/WorkCellForm.tsxindex afeb90b382..9d156b7345 100644--- a/apps/carbon/app/interfaces/Resources/WorkCells/WorkCellForm/WorkCellForm.tsx+++ b/apps/carbon/app/modules/resources/interfaces/WorkCells/WorkCellForm/WorkCellForm.tsx@@ -22,7 +22,7 @@ import {DatePicker,} from "~/components/Form";import { usePermissions } from "~/hooks";-import { workCellValidator } from "~/services/resources";+import { workCellValidator } from "~/modules/resources";import type { TypeOfValidator } from "~/types/validators";import { mapRowsToOptions } from "~/utils/form";diff --git a/apps/carbon/app/interfaces/Resources/WorkCells/WorkCellForm/index.ts b/apps/carbon/app/modules/resources/interfaces/WorkCells/WorkCellForm/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/WorkCells/WorkCellForm/index.tsrename to apps/carbon/app/modules/resources/interfaces/WorkCells/WorkCellForm/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/WorkCells/WorkCellTypeDetail/WorkCellTypeDetail.tsx b/apps/carbon/app/modules/resources/interfaces/WorkCells/WorkCellTypeDetail/WorkCellTypeDetail.tsxsimilarity index 97%rename from apps/carbon/app/interfaces/Resources/WorkCells/WorkCellTypeDetail/WorkCellTypeDetail.tsxrename to apps/carbon/app/modules/resources/interfaces/WorkCells/WorkCellTypeDetail/WorkCellTypeDetail.tsxindex ba2121b382..915b0e98e7 100644--- a/apps/carbon/app/interfaces/Resources/WorkCells/WorkCellTypeDetail/WorkCellTypeDetail.tsx+++ b/apps/carbon/app/modules/resources/interfaces/WorkCells/WorkCellTypeDetail/WorkCellTypeDetail.tsx@@ -20,7 +20,7 @@ import { useState } from "react";import { BsPencilSquare } from "react-icons/bs";import { IoMdTrash } from "react-icons/io";import { ConfirmDelete } from "~/components/Modals";-import type { WorkCellTypeDetail as WorkCellTypeDetailType } from "~/interfaces/Resources/types";+import type { WorkCellTypeDetailType } from "~/modules/resources";import { useUrlParams } from "~/hooks";type WorkCell = NonNullable<WorkCellTypeDetailType["workCell"]>;diff --git a/apps/carbon/app/interfaces/Resources/WorkCells/WorkCellTypeDetail/index.ts b/apps/carbon/app/modules/resources/interfaces/WorkCells/WorkCellTypeDetail/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/WorkCells/WorkCellTypeDetail/index.tsrename to apps/carbon/app/modules/resources/interfaces/WorkCells/WorkCellTypeDetail/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/WorkCells/WorkCellTypeForm/WorkCellTypeForm.tsx b/apps/carbon/app/modules/resources/interfaces/WorkCells/WorkCellTypeForm/WorkCellTypeForm.tsxsimilarity index 97%rename from apps/carbon/app/interfaces/Resources/WorkCells/WorkCellTypeForm/WorkCellTypeForm.tsxrename to apps/carbon/app/modules/resources/interfaces/WorkCells/WorkCellTypeForm/WorkCellTypeForm.tsxindex 39bdb3b287..ed523a52ba 100644--- a/apps/carbon/app/interfaces/Resources/WorkCells/WorkCellTypeForm/WorkCellTypeForm.tsx+++ b/apps/carbon/app/modules/resources/interfaces/WorkCells/WorkCellTypeForm/WorkCellTypeForm.tsx@@ -20,7 +20,7 @@ import {Ability,} from "~/components/Form";import { usePermissions } from "~/hooks";-import { workCellTypeValidator } from "~/services/resources";+import { workCellTypeValidator } from "~/modules/resources";import type { TypeOfValidator } from "~/types/validators";type WorkCellTypeFormProps = {diff --git a/apps/carbon/app/interfaces/Resources/WorkCells/WorkCellTypeForm/index.ts b/apps/carbon/app/modules/resources/interfaces/WorkCells/WorkCellTypeForm/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/WorkCells/WorkCellTypeForm/index.tsrename to apps/carbon/app/modules/resources/interfaces/WorkCells/WorkCellTypeForm/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/WorkCells/WorkCellTypesTable/WorkCellTypesTable.tsx b/apps/carbon/app/modules/resources/interfaces/WorkCells/WorkCellTypesTable/WorkCellTypesTable.tsxsimilarity index 98%rename from apps/carbon/app/interfaces/Resources/WorkCells/WorkCellTypesTable/WorkCellTypesTable.tsxrename to apps/carbon/app/modules/resources/interfaces/WorkCells/WorkCellTypesTable/WorkCellTypesTable.tsxindex ec67081a6f..0113e44052 100644--- a/apps/carbon/app/interfaces/Resources/WorkCells/WorkCellTypesTable/WorkCellTypesTable.tsx+++ b/apps/carbon/app/modules/resources/interfaces/WorkCells/WorkCellTypesTable/WorkCellTypesTable.tsx@@ -23,7 +23,7 @@ import { IoMdTrash } from "react-icons/io";import { Table } from "~/components";import { ConfirmDelete } from "~/components/Modals";import { usePermissions, useUrlParams } from "~/hooks";-import type { WorkCellType } from "~/interfaces/Resources/types";+import type { WorkCellType } from "~/modules/resources";type WorkCellTypesTableProps = {data: WorkCellType[];diff --git a/apps/carbon/app/interfaces/Resources/WorkCells/WorkCellTypesTable/index.ts b/apps/carbon/app/modules/resources/interfaces/WorkCells/WorkCellTypesTable/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/WorkCells/WorkCellTypesTable/index.tsrename to apps/carbon/app/modules/resources/interfaces/WorkCells/WorkCellTypesTable/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/WorkCells/WorkCellTypesTableFilters/WorkCellTypesTableFilters.tsx b/apps/carbon/app/modules/resources/interfaces/WorkCells/WorkCellTypesTableFilters/WorkCellTypesTableFilters.tsxsimilarity index 96%rename from apps/carbon/app/interfaces/Resources/WorkCells/WorkCellTypesTableFilters/WorkCellTypesTableFilters.tsxrename to apps/carbon/app/modules/resources/interfaces/WorkCells/WorkCellTypesTableFilters/WorkCellTypesTableFilters.tsxindex eeecc42819..1b0039ee35 100644--- a/apps/carbon/app/interfaces/Resources/WorkCells/WorkCellTypesTableFilters/WorkCellTypesTableFilters.tsx+++ b/apps/carbon/app/modules/resources/interfaces/WorkCells/WorkCellTypesTableFilters/WorkCellTypesTableFilters.tsx@@ -24,7 +24,7 @@ const WorkCellTypesTableFilters = () => {param="name"size="sm"minW={180}- placeholder="Search by name"+ placeholder="Filter by name"/></HStack><HStack spacing={2}>diff --git a/apps/carbon/app/interfaces/Resources/WorkCells/WorkCellTypesTableFilters/index.ts b/apps/carbon/app/modules/resources/interfaces/WorkCells/WorkCellTypesTableFilters/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/WorkCells/WorkCellTypesTableFilters/index.tsrename to apps/carbon/app/modules/resources/interfaces/WorkCells/WorkCellTypesTableFilters/index.tsdiff --git a/apps/carbon/app/interfaces/Resources/WorkCells/index.ts b/apps/carbon/app/modules/resources/interfaces/WorkCells/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Resources/WorkCells/index.tsrename to apps/carbon/app/modules/resources/interfaces/WorkCells/index.tsdiff --git a/apps/carbon/app/modules/resources/interfaces/index.ts b/apps/carbon/app/modules/resources/interfaces/index.tsnew file mode 100644index 0000000000..bf53725be1--- /dev/null+++ b/apps/carbon/app/modules/resources/interfaces/index.ts@@ -0,0 +1,14 @@+import useResourcesSidebar from "./useResourcesSidebar";++export { useResourcesSidebar };+export * from "./Abilities";+export * from "./Attributes";+export * from "./Departments";+export * from "./Equipment";+export * from "./Holidays";+export * from "./Locations";+export * from "./Partners";+export * from "./People";+export * from "./Person";+export * from "./Shifts";+export * from "./WorkCells";diff --git a/apps/carbon/app/interfaces/Resources/useResourcesSidebar.tsx b/apps/carbon/app/modules/resources/interfaces/useResourcesSidebar.tsxsimilarity index 88%rename from apps/carbon/app/interfaces/Resources/useResourcesSidebar.tsxrename to apps/carbon/app/modules/resources/interfaces/useResourcesSidebar.tsxindex 0453c1527f..fd2bfef426 100644--- a/apps/carbon/app/interfaces/Resources/useResourcesSidebar.tsx+++ b/apps/carbon/app/modules/resources/interfaces/useResourcesSidebar.tsx@@ -17,12 +17,12 @@ const resourcesRoutes: RouteGroup[] = [to: "/x/resources/equipment",},{- name: "Facilities",- to: "/x/resources/facilities",+ name: "Partners",+ to: "/x/resources/partners",},{- name: "Crews",- to: "/x/resources/crews",+ name: "Work Cells",+ to: "/x/resources/work-cells",},],},@@ -53,10 +53,6 @@ const resourcesRoutes: RouteGroup[] = [name: "Shifts",to: "/x/resources/shifts",},- {- name: "Work Cells",- to: "/x/resources/work-cells",- },],},];diff --git a/apps/carbon/app/services/resources/index.ts b/apps/carbon/app/modules/resources/services/index.tssimilarity index 100%rename from apps/carbon/app/services/resources/index.tsrename to apps/carbon/app/modules/resources/services/index.tsdiff --git a/apps/carbon/app/services/resources/resources.form.ts b/apps/carbon/app/modules/resources/services/resources.form.tssimilarity index 95%rename from apps/carbon/app/services/resources/resources.form.tsrename to apps/carbon/app/modules/resources/services/resources.form.tsindex 4bf6e5ee8d..ec9bb57f4d 100644--- a/apps/carbon/app/services/resources/resources.form.ts+++ b/apps/carbon/app/modules/resources/services/resources.form.ts@@ -1,7 +1,7 @@import { withZod } from "@remix-validated-form/with-zod";import { z } from "zod";import { zfd } from "zod-form-data";-import { DataType } from "~/interfaces/Users/types";+import { DataType } from "~/modules/users";export const abilityValidator = withZod(z@@ -95,6 +95,7 @@ export const employeeAbilityValidator = withZod(export const employeeJobValidator = withZod(z.object({title: z.string().min(1, { message: "Title is required" }),+ startDate: zfd.text(z.string().optional()),locationId: zfd.text(z.string().optional()),shiftId: zfd.text(z.string().optional()),managerId: zfd.text(z.string().optional()),@@ -158,6 +159,15 @@ export const noteValidator = withZod(}));+export const partnerValidator = withZod(+ z.object({+ id: z.string().min(36, { message: "Partner is required" }),+ hoursPerWeek: zfd.numeric(+ z.number().min(0, { message: "Hours are required" })+ ),+ })+);+export const shiftValidator = withZod(z.object({id: zfd.text(z.string().optional()),diff --git a/apps/carbon/app/services/resources/resources.server.ts b/apps/carbon/app/modules/resources/services/resources.server.tssimilarity index 94%rename from apps/carbon/app/services/resources/resources.server.tsrename to apps/carbon/app/modules/resources/services/resources.server.tsindex 04465d0acb..ab3fccc661 100644--- a/apps/carbon/app/services/resources/resources.server.ts+++ b/apps/carbon/app/modules/resources/services/resources.server.ts@@ -1,7 +1,7 @@import type { Database } from "@carbon/database";import type { SupabaseClient } from "@supabase/supabase-js";-import type { DataType, Employee } from "~/interfaces/Users/types";-import { getEmployees } from "~/services/users";+import type { DataType, Employee } from "~/modules/users";+import { getEmployees } from "~/modules/users";import type { GenericQueryFilters } from "~/utils/query";import { setGenericQueryFilters } from "~/utils/query";@@ -93,6 +93,13 @@ export async function deleteNote(return client.from("userNote").update({ active: false }).eq("id", noteId);}+export async function deletePartner(+ client: SupabaseClient<Database>,+ partnerId: string+) {+ return client.from("partner").delete().eq("id", partnerId);+}+export async function deleteShift(client: SupabaseClient<Database>,shiftId: string@@ -322,7 +329,7 @@ export async function getEmployeeJob() {return client.from("employeeJob")- .select("title, locationId, shiftId, managerId")+ .select("title, locationId, shiftId, managerId, startDate").eq("id", employeeId).single();}@@ -334,7 +341,7 @@ export async function getEquipment(return client.from("equipment").select(- "id, name, description, operatorsRequired, setupHours, equipmentType(id, name), workCell(id, name)"+ "id, name, description, operatorsRequired, setupHours, equipmentType(id, name), workCell(id, name), location(id, name)").eq("id", equipmentId).eq("active", true)@@ -469,6 +476,37 @@ export async function getNotes(.order("createdAt");}+export async function getPartner(+ client: SupabaseClient<Database>,+ partnerId: string+) {+ return client+ .from("partner")+ .select(`id, hoursPerWeek, supplier(name)`)+ .eq("id", partnerId)+ .single();+}++export async function getPartners(+ client: SupabaseClient<Database>,+ args?: GenericQueryFilters & { name: string | null }+) {+ let query = client+ .from("partner")+ .select(`id, supplier(name), hoursPerWeek`, { count: "exact" })+ .eq("active", true);++ if (args?.name) {+ query = query.ilike("name", `%${args.name}%`);+ }++ if (args) {+ query = setGenericQueryFilters(query, args, "supplier(name)");+ }++ return query;+}+export async function getShift(client: SupabaseClient<Database>,shiftId: string@@ -913,6 +951,7 @@ export async function upsertEmployeeJob(employeeId: string,employeeJob: {title: string | null;+ startDate: string | null;locationId: string | null;shiftId: string | null;managerId: string | null;@@ -1032,6 +1071,26 @@ export async function upsertLocation(return client.from("location").insert([location]).select("id");}+export async function upsertPartner(+ client: SupabaseClient<Database>,+ partner:+ | {+ id: string;+ hoursPerWeek?: number;+ createdBy: string;+ }+ | {+ id: string;+ hoursPerWeek?: number;+ updatedBy: string;+ }+) {+ if ("updatedBy" in partner) {+ return client.from("partner").update(partner).eq("id", partner.id);+ }+ return client.from("partner").insert([partner]);+}+export async function upsertShift(client: SupabaseClient<Database>,shift: {diff --git a/apps/carbon/app/interfaces/Resources/types.ts b/apps/carbon/app/modules/resources/types.tssimilarity index 91%rename from apps/carbon/app/interfaces/Resources/types.tsrename to apps/carbon/app/modules/resources/types.tsindex 0ea924d339..c16bdb2dea 100644--- a/apps/carbon/app/interfaces/Resources/types.ts+++ b/apps/carbon/app/modules/resources/types.ts@@ -12,12 +12,13 @@ import type {getEquipment,getLocations,getNotes,+ getPartners,getPeople,getShifts,getWorkCellTypes,getWorkCellType,getHolidays,-} from "~/services/resources";+} from "./services";export type Ability = NonNullable<Awaited<ReturnType<typeof getAbility>>["data"]@@ -63,7 +64,7 @@ export type AttributeCategory = NonNullable<Awaited<ReturnType<typeof getAttributeCategories>>["data"]>[number];-export type AttributeCategoryDetail = NonNullable<+export type AttributeCategoryDetailType = NonNullable<Awaited<ReturnType<typeof getAttributeCategory>>["data"]>;@@ -97,7 +98,7 @@ export type EquipmentType = NonNullable<Awaited<ReturnType<typeof getEquipmentTypes>>["data"]>[number];-export type EquipmentTypeDetail = NonNullable<+export type EquipmentTypeDetailType = NonNullable<Awaited<ReturnType<typeof getEquipmentType>>["data"]>;@@ -113,6 +114,10 @@ export type Note = NonNullable<Awaited<ReturnType<typeof getNotes>>["data"]>[number];+export type Partner = NonNullable<+ Awaited<ReturnType<typeof getPartners>>["data"]+>[number];+export type Person = NonNullable<Awaited<ReturnType<typeof getPeople>>["data"]>[number];@@ -129,6 +134,6 @@ export type WorkCellType = NonNullable<Awaited<ReturnType<typeof getWorkCellTypes>>["data"]>[number];-export type WorkCellTypeDetail = NonNullable<+export type WorkCellTypeDetailType = NonNullable<Awaited<ReturnType<typeof getWorkCellType>>["data"]>;diff --git a/apps/carbon/app/modules/sales/index.ts b/apps/carbon/app/modules/sales/index.tsnew file mode 100644index 0000000000..684aed031a--- /dev/null+++ b/apps/carbon/app/modules/sales/index.ts@@ -0,0 +1,3 @@+export * from "./services";+export * from "./interfaces";+export * from "./types";diff --git a/apps/carbon/app/interfaces/Sales/CustomerTypes/CustomerTypeForm/CustomerTypeForm.tsx b/apps/carbon/app/modules/sales/interfaces/CustomerTypes/CustomerTypeForm/CustomerTypeForm.tsxsimilarity index 97%rename from apps/carbon/app/interfaces/Sales/CustomerTypes/CustomerTypeForm/CustomerTypeForm.tsxrename to apps/carbon/app/modules/sales/interfaces/CustomerTypes/CustomerTypeForm/CustomerTypeForm.tsxindex d66729ff8d..d556ed04c5 100644--- a/apps/carbon/app/interfaces/Sales/CustomerTypes/CustomerTypeForm/CustomerTypeForm.tsx+++ b/apps/carbon/app/modules/sales/interfaces/CustomerTypes/CustomerTypeForm/CustomerTypeForm.tsx@@ -14,7 +14,7 @@ import { useNavigate } from "@remix-run/react";import { ValidatedForm } from "remix-validated-form";import { Color, Hidden, Input, Submit } from "~/components/Form";import { usePermissions } from "~/hooks";-import { customerTypeValidator } from "~/services/sales";+import { customerTypeValidator } from "~/modules/sales";import type { TypeOfValidator } from "~/types/validators";type CustomerTypeFormProps = {diff --git a/apps/carbon/app/interfaces/Sales/CustomerTypes/CustomerTypeForm/index.ts b/apps/carbon/app/modules/sales/interfaces/CustomerTypes/CustomerTypeForm/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Sales/CustomerTypes/CustomerTypeForm/index.tsrename to apps/carbon/app/modules/sales/interfaces/CustomerTypes/CustomerTypeForm/index.tsdiff --git a/apps/carbon/app/interfaces/Sales/CustomerTypes/CustomerTypesTable/CustomerTypesTable.tsx b/apps/carbon/app/modules/sales/interfaces/CustomerTypes/CustomerTypesTable/CustomerTypesTable.tsxsimilarity index 97%rename from apps/carbon/app/interfaces/Sales/CustomerTypes/CustomerTypesTable/CustomerTypesTable.tsxrename to apps/carbon/app/modules/sales/interfaces/CustomerTypes/CustomerTypesTable/CustomerTypesTable.tsxindex 58e791f3f4..f73921ab08 100644--- a/apps/carbon/app/interfaces/Sales/CustomerTypes/CustomerTypesTable/CustomerTypesTable.tsx+++ b/apps/carbon/app/modules/sales/interfaces/CustomerTypes/CustomerTypesTable/CustomerTypesTable.tsx@@ -6,7 +6,7 @@ import { BsPencilSquare, BsPeopleFill } from "react-icons/bs";import { IoMdTrash } from "react-icons/io";import { Table } from "~/components";import { usePermissions, useUrlParams } from "~/hooks";-import type { CustomerType } from "~/interfaces/Sales/types";+import type { CustomerType } from "~/modules/sales";type CustomerTypesTableProps = {data: CustomerType[];diff --git a/apps/carbon/app/interfaces/Sales/CustomerTypes/CustomerTypesTable/index.ts b/apps/carbon/app/modules/sales/interfaces/CustomerTypes/CustomerTypesTable/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Sales/CustomerTypes/CustomerTypesTable/index.tsrename to apps/carbon/app/modules/sales/interfaces/CustomerTypes/CustomerTypesTable/index.tsdiff --git a/apps/carbon/app/interfaces/Sales/CustomerTypes/CustomerTypesTableFilters/CustomerTypesTableFilters.tsx b/apps/carbon/app/modules/sales/interfaces/CustomerTypes/CustomerTypesTableFilters/CustomerTypesTableFilters.tsxsimilarity index 96%rename from apps/carbon/app/interfaces/Sales/CustomerTypes/CustomerTypesTableFilters/CustomerTypesTableFilters.tsxrename to apps/carbon/app/modules/sales/interfaces/CustomerTypes/CustomerTypesTableFilters/CustomerTypesTableFilters.tsxindex b1b46721bf..fd284e4536 100644--- a/apps/carbon/app/interfaces/Sales/CustomerTypes/CustomerTypesTableFilters/CustomerTypesTableFilters.tsx+++ b/apps/carbon/app/modules/sales/interfaces/CustomerTypes/CustomerTypesTableFilters/CustomerTypesTableFilters.tsx@@ -24,7 +24,7 @@ const CustomerTypesTableFilters = () => {param="name"size="sm"minW={180}- placeholder="Search by name"+ placeholder="Filter by name"/></HStack><HStack spacing={2}>diff --git a/apps/carbon/app/interfaces/Sales/CustomerTypes/CustomerTypesTableFilters/index.ts b/apps/carbon/app/modules/sales/interfaces/CustomerTypes/CustomerTypesTableFilters/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Sales/CustomerTypes/CustomerTypesTableFilters/index.tsrename to apps/carbon/app/modules/sales/interfaces/CustomerTypes/CustomerTypesTableFilters/index.tsdiff --git a/apps/carbon/app/interfaces/Sales/CustomerTypes/index.ts b/apps/carbon/app/modules/sales/interfaces/CustomerTypes/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Sales/CustomerTypes/index.tsrename to apps/carbon/app/modules/sales/interfaces/CustomerTypes/index.tsdiff --git a/apps/carbon/app/interfaces/Sales/Customers/CustomerForm/CustomerForm.tsx b/apps/carbon/app/modules/sales/interfaces/Customers/CustomerForm/CustomerForm.tsxsimilarity index 98%rename from apps/carbon/app/interfaces/Sales/Customers/CustomerForm/CustomerForm.tsxrename to apps/carbon/app/modules/sales/interfaces/Customers/CustomerForm/CustomerForm.tsxindex c485d539cd..47e2446b67 100644--- a/apps/carbon/app/interfaces/Sales/Customers/CustomerForm/CustomerForm.tsx+++ b/apps/carbon/app/modules/sales/interfaces/Customers/CustomerForm/CustomerForm.tsx@@ -22,13 +22,13 @@ import {TextArea,Hidden,} from "~/components/Form";-import { customerValidator } from "~/services/sales";+import { customerValidator } from "~/modules/sales";import type {CustomerContact,CustomerLocation,CustomerStatus,CustomerType,-} from "~/interfaces/Sales/types";+} from "~/modules/sales";import { mapRowsToOptions } from "~/utils/form";import { usePermissions, useRouteData } from "~/hooks";import { CustomerContacts, CustomerLocations } from "./components";diff --git a/apps/carbon/app/interfaces/Sales/Customers/CustomerForm/components/CustomerContacts.tsx b/apps/carbon/app/modules/sales/interfaces/Customers/CustomerForm/components/CustomerContacts.tsxsimilarity index 98%rename from apps/carbon/app/interfaces/Sales/Customers/CustomerForm/components/CustomerContacts.tsxrename to apps/carbon/app/modules/sales/interfaces/Customers/CustomerForm/components/CustomerContacts.tsxindex b994609956..e4f6246b9e 100644--- a/apps/carbon/app/interfaces/Sales/Customers/CustomerForm/components/CustomerContacts.tsx+++ b/apps/carbon/app/modules/sales/interfaces/Customers/CustomerForm/components/CustomerContacts.tsx@@ -12,14 +12,11 @@ import {import { useNavigate, useParams } from "@remix-run/react";import { useState } from "react";import { IoMdAdd } from "react-icons/io";-import type {- CustomerContact,- CustomerLocation,-} from "~/interfaces/Sales/types";import { Contact } from "~/components";import { ConfirmDelete } from "~/components/Modals";-import CustomerContactForm from "./CustomerContactsForm";+import type { CustomerContact, CustomerLocation } from "~/modules/sales";import { usePermissions } from "~/hooks";+import CustomerContactForm from "./CustomerContactsForm";type CustomerContactProps = {contacts?: CustomerContact[];diff --git a/apps/carbon/app/interfaces/Sales/Customers/CustomerForm/components/CustomerContactsForm.tsx b/apps/carbon/app/modules/sales/interfaces/Customers/CustomerForm/components/CustomerContactsForm.tsxsimilarity index 96%rename from apps/carbon/app/interfaces/Sales/Customers/CustomerForm/components/CustomerContactsForm.tsxrename to apps/carbon/app/modules/sales/interfaces/Customers/CustomerForm/components/CustomerContactsForm.tsxindex 2dccc7d9f6..0823ca7efe 100644--- a/apps/carbon/app/interfaces/Sales/Customers/CustomerForm/components/CustomerContactsForm.tsx+++ b/apps/carbon/app/modules/sales/interfaces/Customers/CustomerForm/components/CustomerContactsForm.tsx@@ -21,11 +21,8 @@ import {TextArea,} from "~/components/Form";import { usePermissions } from "~/hooks";-import type {- CustomerContact,- CustomerLocation,-} from "~/interfaces/Sales/types";-import { customerContactValidator } from "~/services/sales";+import type { CustomerContact, CustomerLocation } from "~/modules/sales";+import { customerContactValidator } from "~/modules/sales";type CustomerContactFormProps = {contact?: CustomerContact;diff --git a/apps/carbon/app/interfaces/Sales/Customers/CustomerForm/components/CustomerLocationForm.tsx b/apps/carbon/app/modules/sales/interfaces/Customers/CustomerForm/components/CustomerLocationForm.tsxsimilarity index 95%rename from apps/carbon/app/interfaces/Sales/Customers/CustomerForm/components/CustomerLocationForm.tsxrename to apps/carbon/app/modules/sales/interfaces/Customers/CustomerForm/components/CustomerLocationForm.tsxindex 3ef1397d5b..2c4c986153 100644--- a/apps/carbon/app/interfaces/Sales/Customers/CustomerForm/components/CustomerLocationForm.tsx+++ b/apps/carbon/app/modules/sales/interfaces/Customers/CustomerForm/components/CustomerLocationForm.tsx@@ -14,8 +14,8 @@ import { useParams } from "@remix-run/react";import { ValidatedForm } from "remix-validated-form";import { Hidden, Input, Submit } from "~/components/Form";import { usePermissions } from "~/hooks";-import type { CustomerLocation } from "~/interfaces/Sales/types";-import { customerLocationValidator } from "~/services/sales";+import type { CustomerLocation } from "~/modules/sales";+import { customerLocationValidator } from "~/modules/sales";type CustomerLocationFormProps = {location?: CustomerLocation;diff --git a/apps/carbon/app/interfaces/Sales/Customers/CustomerForm/components/CustomerLocations.tsx b/apps/carbon/app/modules/sales/interfaces/Customers/CustomerForm/components/CustomerLocations.tsxsimilarity index 98%rename from apps/carbon/app/interfaces/Sales/Customers/CustomerForm/components/CustomerLocations.tsxrename to apps/carbon/app/modules/sales/interfaces/Customers/CustomerForm/components/CustomerLocations.tsxindex 350a0a0bce..a1fcea0145 100644--- a/apps/carbon/app/interfaces/Sales/Customers/CustomerForm/components/CustomerLocations.tsx+++ b/apps/carbon/app/modules/sales/interfaces/Customers/CustomerForm/components/CustomerLocations.tsx@@ -15,7 +15,7 @@ import { IoMdAdd } from "react-icons/io";import { Address } from "~/components";import { ConfirmDelete } from "~/components/Modals";import { usePermissions } from "~/hooks";-import type { CustomerLocation } from "~/interfaces/Sales/types";+import type { CustomerLocation } from "~/modules/sales";import CustomerLocationForm from "./CustomerLocationForm";type CustomerLocationProps = {diff --git a/apps/carbon/app/interfaces/Sales/Customers/CustomerForm/components/index.ts b/apps/carbon/app/modules/sales/interfaces/Customers/CustomerForm/components/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Sales/Customers/CustomerForm/components/index.tsrename to apps/carbon/app/modules/sales/interfaces/Customers/CustomerForm/components/index.tsdiff --git a/apps/carbon/app/interfaces/Sales/Customers/CustomerForm/index.ts b/apps/carbon/app/modules/sales/interfaces/Customers/CustomerForm/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Sales/Customers/CustomerForm/index.tsrename to apps/carbon/app/modules/sales/interfaces/Customers/CustomerForm/index.tsdiff --git a/apps/carbon/app/interfaces/Sales/Customers/CustomersTable/CustomersTable.tsx b/apps/carbon/app/modules/sales/interfaces/Customers/CustomersTable/CustomersTable.tsxsimilarity index 98%rename from apps/carbon/app/interfaces/Sales/Customers/CustomersTable/CustomersTable.tsxrename to apps/carbon/app/modules/sales/interfaces/Customers/CustomersTable/CustomersTable.tsxindex 465d99dbef..c67bcfe39f 100644--- a/apps/carbon/app/interfaces/Sales/Customers/CustomersTable/CustomersTable.tsx+++ b/apps/carbon/app/modules/sales/interfaces/Customers/CustomersTable/CustomersTable.tsx@@ -5,7 +5,7 @@ import { memo, useMemo } from "react";import { BsPencilSquare, BsPlus } from "react-icons/bs";import { Table } from "~/components";import { usePermissions, useUrlParams } from "~/hooks";-import type { Customer } from "~/interfaces/Sales/types";+import type { Customer } from "~/modules/sales";type CustomersTableProps = {data: Customer[];diff --git a/apps/carbon/app/interfaces/Sales/Customers/CustomersTable/index.ts b/apps/carbon/app/modules/sales/interfaces/Customers/CustomersTable/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Sales/Customers/CustomersTable/index.tsrename to apps/carbon/app/modules/sales/interfaces/Customers/CustomersTable/index.tsdiff --git a/apps/carbon/app/interfaces/Sales/Customers/CustomersTableFilters/CustomersTableFilters.tsx b/apps/carbon/app/modules/sales/interfaces/Customers/CustomersTableFilters/CustomersTableFilters.tsxsimilarity index 95%rename from apps/carbon/app/interfaces/Sales/Customers/CustomersTableFilters/CustomersTableFilters.tsxrename to apps/carbon/app/modules/sales/interfaces/Customers/CustomersTableFilters/CustomersTableFilters.tsxindex 251eff5343..9f24c3adad 100644--- a/apps/carbon/app/interfaces/Sales/Customers/CustomersTableFilters/CustomersTableFilters.tsx+++ b/apps/carbon/app/modules/sales/interfaces/Customers/CustomersTableFilters/CustomersTableFilters.tsx@@ -4,7 +4,7 @@ import { Link } from "@remix-run/react";import { IoMdAdd } from "react-icons/io";import { DebouncedInput } from "~/components/Search";import { usePermissions, useUrlParams } from "~/hooks";-import type { CustomerStatus, CustomerType } from "~/interfaces/Sales/types";+import type { CustomerStatus, CustomerType } from "~/modules/sales";import { mapRowsToOptions } from "~/utils/form";type CustomersTableFiltersProps = {@@ -47,7 +47,7 @@ const CustomersTableFilters = ({param="name"size="sm"minW={180}- placeholder="Search by name"+ placeholder="Filter by name"/>{customerTypeOptions.length > 0 && (<Selectdiff --git a/apps/carbon/app/interfaces/Sales/Customers/CustomersTableFilters/index.ts b/apps/carbon/app/modules/sales/interfaces/Customers/CustomersTableFilters/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Sales/Customers/CustomersTableFilters/index.tsrename to apps/carbon/app/modules/sales/interfaces/Customers/CustomersTableFilters/index.tsdiff --git a/apps/carbon/app/interfaces/Sales/Customers/index.ts b/apps/carbon/app/modules/sales/interfaces/Customers/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Sales/Customers/index.tsrename to apps/carbon/app/modules/sales/interfaces/Customers/index.tsdiff --git a/apps/carbon/app/interfaces/Sales/index.ts b/apps/carbon/app/modules/sales/interfaces/index.tssimilarity index 55%rename from apps/carbon/app/interfaces/Sales/index.tsrename to apps/carbon/app/modules/sales/interfaces/index.tsindex 64e2b65aa8..7aa3f90ada 100644--- a/apps/carbon/app/interfaces/Sales/index.ts+++ b/apps/carbon/app/modules/sales/interfaces/index.ts@@ -1,3 +1,5 @@import useSalesSidebar from "./useSalesSidebar";export { useSalesSidebar };+export * from "./CustomerTypes";+export * from "./Customers";diff --git a/apps/carbon/app/interfaces/Sales/useSalesSidebar.tsx b/apps/carbon/app/modules/sales/interfaces/useSalesSidebar.tsxsimilarity index 100%rename from apps/carbon/app/interfaces/Sales/useSalesSidebar.tsxrename to apps/carbon/app/modules/sales/interfaces/useSalesSidebar.tsxdiff --git a/apps/carbon/app/services/sales/index.ts b/apps/carbon/app/modules/sales/services/index.tssimilarity index 100%rename from apps/carbon/app/services/sales/index.tsrename to apps/carbon/app/modules/sales/services/index.tsdiff --git a/apps/carbon/app/services/sales/sales.form.ts b/apps/carbon/app/modules/sales/services/sales.form.tssimilarity index 100%rename from apps/carbon/app/services/sales/sales.form.tsrename to apps/carbon/app/modules/sales/services/sales.form.tsdiff --git a/apps/carbon/app/services/sales/sales.server.ts b/apps/carbon/app/modules/sales/services/sales.server.tssimilarity index 100%rename from apps/carbon/app/services/sales/sales.server.tsrename to apps/carbon/app/modules/sales/services/sales.server.tsdiff --git a/apps/carbon/app/interfaces/Sales/types.ts b/apps/carbon/app/modules/sales/types.tssimilarity index 96%rename from apps/carbon/app/interfaces/Sales/types.tsrename to apps/carbon/app/modules/sales/types.tsindex e3e4f4ba0e..2fc0a7bdcd 100644--- a/apps/carbon/app/interfaces/Sales/types.ts+++ b/apps/carbon/app/modules/sales/types.ts@@ -4,7 +4,7 @@ import type {getCustomers,getCustomerStatuses,getCustomerTypes,-} from "~/services/sales";+} from "./services";export type Customer = NonNullable<Awaited<ReturnType<typeof getCustomers>>["data"]diff --git a/apps/carbon/app/modules/users/index.ts b/apps/carbon/app/modules/users/index.tsnew file mode 100644index 0000000000..684aed031a--- /dev/null+++ b/apps/carbon/app/modules/users/index.ts@@ -0,0 +1,3 @@+export * from "./services";+export * from "./interfaces";+export * from "./types";diff --git a/apps/carbon/app/interfaces/Users/Customers/CreateCustomerModal/CreateCustomerModal.tsx b/apps/carbon/app/modules/users/interfaces/Customers/CreateCustomerModal/CreateCustomerModal.tsxsimilarity index 98%rename from apps/carbon/app/interfaces/Users/Customers/CreateCustomerModal/CreateCustomerModal.tsxrename to apps/carbon/app/modules/users/interfaces/Customers/CreateCustomerModal/CreateCustomerModal.tsxindex 0bb26bda19..2a69a053fe 100644--- a/apps/carbon/app/interfaces/Users/Customers/CreateCustomerModal/CreateCustomerModal.tsx+++ b/apps/carbon/app/modules/users/interfaces/Customers/CreateCustomerModal/CreateCustomerModal.tsx@@ -17,7 +17,7 @@ import { useRef, useState } from "react";import { ValidatedForm } from "remix-validated-form";import { Customer, Submit, CustomerContact } from "~/components/Form";import { useUrlParams } from "~/hooks";-import { createCustomerAccountValidator } from "~/services/users";+import { createCustomerAccountValidator } from "~/modules/users";import type { Result } from "~/types";const CreateCustomerModal = () => {diff --git a/apps/carbon/app/interfaces/Users/Customers/CreateCustomerModal/index.ts b/apps/carbon/app/modules/users/interfaces/Customers/CreateCustomerModal/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Users/Customers/CreateCustomerModal/index.tsrename to apps/carbon/app/modules/users/interfaces/Customers/CreateCustomerModal/index.tsdiff --git a/apps/carbon/app/interfaces/Users/Customers/CustomerAccountsTable/CustomerAccountsTable.tsx b/apps/carbon/app/modules/users/interfaces/Customers/CustomerAccountsTable/CustomerAccountsTable.tsxsimilarity index 97%rename from apps/carbon/app/interfaces/Users/Customers/CustomerAccountsTable/CustomerAccountsTable.tsxrename to apps/carbon/app/modules/users/interfaces/Customers/CustomerAccountsTable/CustomerAccountsTable.tsxindex e03f4fc68f..e536a7667a 100644--- a/apps/carbon/app/interfaces/Users/Customers/CustomerAccountsTable/CustomerAccountsTable.tsx+++ b/apps/carbon/app/modules/users/interfaces/Customers/CustomerAccountsTable/CustomerAccountsTable.tsx@@ -6,8 +6,8 @@ import { FaBan } from "react-icons/fa";import { IoMdTrash } from "react-icons/io";import { Avatar, Table } from "~/components";import { usePermissions } from "~/hooks";-import type { Customer } from "~/interfaces/Users/types";-import { ResendInviteModal, DeactivateUsersModal } from "~/interfaces/Users";+import type { Customer } from "~/modules/users";+import { ResendInviteModal, DeactivateUsersModal } from "~/modules/users";type CustomerAccountsTableProps = {data: Customer[];diff --git a/apps/carbon/app/interfaces/Users/Customers/CustomerAccountsTable/index.ts b/apps/carbon/app/modules/users/interfaces/Customers/CustomerAccountsTable/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Users/Customers/CustomerAccountsTable/index.tsrename to apps/carbon/app/modules/users/interfaces/Customers/CustomerAccountsTable/index.tsdiff --git a/apps/carbon/app/interfaces/Users/Customers/CustomerAccountsTableFilters/CustomerAccountsTableFilters.tsx b/apps/carbon/app/modules/users/interfaces/Customers/CustomerAccountsTableFilters/CustomerAccountsTableFilters.tsxsimilarity index 96%rename from apps/carbon/app/interfaces/Users/Customers/CustomerAccountsTableFilters/CustomerAccountsTableFilters.tsxrename to apps/carbon/app/modules/users/interfaces/Customers/CustomerAccountsTableFilters/CustomerAccountsTableFilters.tsxindex 66343dc0c3..899d19880a 100644--- a/apps/carbon/app/interfaces/Users/Customers/CustomerAccountsTableFilters/CustomerAccountsTableFilters.tsx+++ b/apps/carbon/app/modules/users/interfaces/Customers/CustomerAccountsTableFilters/CustomerAccountsTableFilters.tsx@@ -4,7 +4,7 @@ import { Link } from "@remix-run/react";import { IoMdAdd } from "react-icons/io";import { DebouncedInput } from "~/components/Search";import { usePermissions, useUrlParams } from "~/hooks";-import type { CustomerType } from "~/interfaces/Sales/types";+import type { CustomerType } from "~/modules/sales";import { mapRowsToOptions } from "~/utils/form";type CustomerAccountsTableFiltersProps = {@@ -39,7 +39,7 @@ const CustomerAccountsTableFilters = ({param="name"size="sm"minW={180}- placeholder="Search by name"+ placeholder="Filter by name"/><Select// @ts-ignorediff --git a/apps/carbon/app/interfaces/Users/Customers/CustomerAccountsTableFilters/index.ts b/apps/carbon/app/modules/users/interfaces/Customers/CustomerAccountsTableFilters/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Users/Customers/CustomerAccountsTableFilters/index.tsrename to apps/carbon/app/modules/users/interfaces/Customers/CustomerAccountsTableFilters/index.tsdiff --git a/apps/carbon/app/interfaces/Users/Customers/index.ts b/apps/carbon/app/modules/users/interfaces/Customers/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Users/Customers/index.tsrename to apps/carbon/app/modules/users/interfaces/Customers/index.tsdiff --git a/apps/carbon/app/interfaces/Users/DeactivateUsersModal/DeactivateUsersModal.tsx b/apps/carbon/app/modules/users/interfaces/DeactivateUsersModal/DeactivateUsersModal.tsxsimilarity index 97%rename from apps/carbon/app/interfaces/Users/DeactivateUsersModal/DeactivateUsersModal.tsxrename to apps/carbon/app/modules/users/interfaces/DeactivateUsersModal/DeactivateUsersModal.tsxindex fa8c58f5af..3309c14147 100644--- a/apps/carbon/app/interfaces/Users/DeactivateUsersModal/DeactivateUsersModal.tsx+++ b/apps/carbon/app/modules/users/interfaces/DeactivateUsersModal/DeactivateUsersModal.tsx@@ -12,7 +12,7 @@ import {} from "@chakra-ui/react";import { ValidatedForm } from "remix-validated-form";import { UserSelect } from "~/components/Selectors";-import { deactivateUsersValidator } from "~/services/users";+import { deactivateUsersValidator } from "~/modules/users";type DeactivateUsersModalProps = {userIds: string[];diff --git a/apps/carbon/app/interfaces/Users/DeactivateUsersModal/index.ts b/apps/carbon/app/modules/users/interfaces/DeactivateUsersModal/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Users/DeactivateUsersModal/index.tsrename to apps/carbon/app/modules/users/interfaces/DeactivateUsersModal/index.tsdiff --git a/apps/carbon/app/interfaces/Users/EmployeeTypes/EmployeeTypeForm/EmployeeTypeForm.tsx b/apps/carbon/app/modules/users/interfaces/EmployeeTypes/EmployeeTypeForm/EmployeeTypeForm.tsxsimilarity index 94%rename from apps/carbon/app/interfaces/Users/EmployeeTypes/EmployeeTypeForm/EmployeeTypeForm.tsxrename to apps/carbon/app/modules/users/interfaces/EmployeeTypes/EmployeeTypeForm/EmployeeTypeForm.tsxindex f953aef049..e3aba25643 100644--- a/apps/carbon/app/interfaces/Users/EmployeeTypes/EmployeeTypeForm/EmployeeTypeForm.tsx+++ b/apps/carbon/app/modules/users/interfaces/EmployeeTypes/EmployeeTypeForm/EmployeeTypeForm.tsx@@ -17,9 +17,9 @@ import { useState } from "react";import { ValidatedForm } from "remix-validated-form";import { Color, Hidden, Input, Submit } from "~/components/Form";import { usePermissions } from "~/hooks";-import PermissionCheckboxes from "~/interfaces/Users/components/Permission";-import type { Permission } from "~/interfaces/Users/types";-import { employeeTypeValidator } from "~/services/users";+import PermissionCheckboxes from "~/modules/users/interfaces/components/Permission";+import type { Permission } from "~/modules/users";+import { employeeTypeValidator } from "~/modules/users";import type { TypeOfValidator } from "~/types/validators";type EmployeeTypeFormProps = {diff --git a/apps/carbon/app/interfaces/Users/EmployeeTypes/EmployeeTypeForm/index.ts b/apps/carbon/app/modules/users/interfaces/EmployeeTypes/EmployeeTypeForm/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Users/EmployeeTypes/EmployeeTypeForm/index.tsrename to apps/carbon/app/modules/users/interfaces/EmployeeTypes/EmployeeTypeForm/index.tsdiff --git a/apps/carbon/app/interfaces/Users/EmployeeTypes/EmployeeTypesTable/EmployeeTypesTable.tsx b/apps/carbon/app/modules/users/interfaces/EmployeeTypes/EmployeeTypesTable/EmployeeTypesTable.tsxsimilarity index 97%rename from apps/carbon/app/interfaces/Users/EmployeeTypes/EmployeeTypesTable/EmployeeTypesTable.tsxrename to apps/carbon/app/modules/users/interfaces/EmployeeTypes/EmployeeTypesTable/EmployeeTypesTable.tsxindex 7848c38abf..0cb6817053 100644--- a/apps/carbon/app/interfaces/Users/EmployeeTypes/EmployeeTypesTable/EmployeeTypesTable.tsx+++ b/apps/carbon/app/modules/users/interfaces/EmployeeTypes/EmployeeTypesTable/EmployeeTypesTable.tsx@@ -6,7 +6,7 @@ import { BsPencilSquare, BsPeopleFill } from "react-icons/bs";import { IoMdTrash } from "react-icons/io";import { Table } from "~/components";import { usePermissions, useUrlParams } from "~/hooks";-import type { EmployeeType } from "~/interfaces/Users/types";+import type { EmployeeType } from "~/modules/users";type EmployeeTypesTableProps = {data: EmployeeType[];diff --git a/apps/carbon/app/interfaces/Users/EmployeeTypes/EmployeeTypesTable/index.ts b/apps/carbon/app/modules/users/interfaces/EmployeeTypes/EmployeeTypesTable/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Users/EmployeeTypes/EmployeeTypesTable/index.tsrename to apps/carbon/app/modules/users/interfaces/EmployeeTypes/EmployeeTypesTable/index.tsdiff --git a/apps/carbon/app/interfaces/Users/EmployeeTypes/EmployeeTypesTableFilters/EmployeeTypesTableFilters.tsx b/apps/carbon/app/modules/users/interfaces/EmployeeTypes/EmployeeTypesTableFilters/EmployeeTypesTableFilters.tsxsimilarity index 96%rename from apps/carbon/app/interfaces/Users/EmployeeTypes/EmployeeTypesTableFilters/EmployeeTypesTableFilters.tsxrename to apps/carbon/app/modules/users/interfaces/EmployeeTypes/EmployeeTypesTableFilters/EmployeeTypesTableFilters.tsxindex 3d8447cf72..0fbf7d80bc 100644--- a/apps/carbon/app/interfaces/Users/EmployeeTypes/EmployeeTypesTableFilters/EmployeeTypesTableFilters.tsx+++ b/apps/carbon/app/modules/users/interfaces/EmployeeTypes/EmployeeTypesTableFilters/EmployeeTypesTableFilters.tsx@@ -24,7 +24,7 @@ const EmployeeTypesTableFilters = () => {param="name"size="sm"minW={180}- placeholder="Search by name"+ placeholder="Filter by name"/></HStack><HStack spacing={2}>diff --git a/apps/carbon/app/interfaces/Users/EmployeeTypes/EmployeeTypesTableFilters/index.ts b/apps/carbon/app/modules/users/interfaces/EmployeeTypes/EmployeeTypesTableFilters/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Users/EmployeeTypes/EmployeeTypesTableFilters/index.tsrename to apps/carbon/app/modules/users/interfaces/EmployeeTypes/EmployeeTypesTableFilters/index.tsdiff --git a/apps/carbon/app/interfaces/Users/EmployeeTypes/index.ts b/apps/carbon/app/modules/users/interfaces/EmployeeTypes/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Users/EmployeeTypes/index.tsrename to apps/carbon/app/modules/users/interfaces/EmployeeTypes/index.tsdiff --git a/apps/carbon/app/interfaces/Users/Employees/BulkEditPermissionsForm/BulkEditPermissionsForm.tsx b/apps/carbon/app/modules/users/interfaces/Employees/BulkEditPermissionsForm/BulkEditPermissionsForm.tsxsimilarity index 97%rename from apps/carbon/app/interfaces/Users/Employees/BulkEditPermissionsForm/BulkEditPermissionsForm.tsxrename to apps/carbon/app/modules/users/interfaces/Employees/BulkEditPermissionsForm/BulkEditPermissionsForm.tsxindex 541ebe38d4..adbe490643 100644--- a/apps/carbon/app/interfaces/Users/Employees/BulkEditPermissionsForm/BulkEditPermissionsForm.tsx+++ b/apps/carbon/app/modules/users/interfaces/Employees/BulkEditPermissionsForm/BulkEditPermissionsForm.tsx@@ -16,9 +16,9 @@ import { useFetcher } from "@remix-run/react";import { useEffect, useState } from "react";import { ValidatedForm } from "remix-validated-form";import { Employees, Hidden, Radios, Submit } from "~/components/Form";-import { bulkPermissionsValidator } from "~/services/users";+import { bulkPermissionsValidator } from "~/modules/users";import PermissionCheckboxes from "../../components/Permission";-import type { Permission } from "../../types";+import type { Permission } from "../../../types";type BulkEditPermissionsProps = {userIds: string[];diff --git a/apps/carbon/app/interfaces/Users/Employees/BulkEditPermissionsForm/index.ts b/apps/carbon/app/modules/users/interfaces/Employees/BulkEditPermissionsForm/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Users/Employees/BulkEditPermissionsForm/index.tsrename to apps/carbon/app/modules/users/interfaces/Employees/BulkEditPermissionsForm/index.tsdiff --git a/apps/carbon/app/interfaces/Users/Employees/CreateEmployeeModal/CreateEmployeeModal.tsx b/apps/carbon/app/modules/users/interfaces/Employees/CreateEmployeeModal/CreateEmployeeModal.tsxsimilarity index 95%rename from apps/carbon/app/interfaces/Users/Employees/CreateEmployeeModal/CreateEmployeeModal.tsxrename to apps/carbon/app/modules/users/interfaces/Employees/CreateEmployeeModal/CreateEmployeeModal.tsxindex a148f796c8..9f19580996 100644--- a/apps/carbon/app/interfaces/Users/Employees/CreateEmployeeModal/CreateEmployeeModal.tsx+++ b/apps/carbon/app/modules/users/interfaces/Employees/CreateEmployeeModal/CreateEmployeeModal.tsx@@ -14,8 +14,8 @@ import type { PostgrestResponse } from "@supabase/supabase-js";import { useEffect, useRef } from "react";import { ValidatedForm } from "remix-validated-form";import { Input, Select, Submit } from "~/components/Form";-import type { EmployeeType } from "~/interfaces/Users/types";-import { createEmployeeValidator } from "~/services/users";+import type { EmployeeType } from "~/modules/users";+import { createEmployeeValidator } from "~/modules/users";import type { Result } from "~/types";import { mapRowsToOptions } from "~/utils/form";diff --git a/apps/carbon/app/interfaces/Users/Employees/CreateEmployeeModal/index.ts b/apps/carbon/app/modules/users/interfaces/Employees/CreateEmployeeModal/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Users/Employees/CreateEmployeeModal/index.tsrename to apps/carbon/app/modules/users/interfaces/Employees/CreateEmployeeModal/index.tsdiff --git a/apps/carbon/app/interfaces/Users/Employees/EmployeePermissionsForm/EmployeePermissionsForm.tsx b/apps/carbon/app/modules/users/interfaces/Employees/EmployeePermissionsForm/EmployeePermissionsForm.tsxsimilarity index 94%rename from apps/carbon/app/interfaces/Users/Employees/EmployeePermissionsForm/EmployeePermissionsForm.tsxrename to apps/carbon/app/modules/users/interfaces/Employees/EmployeePermissionsForm/EmployeePermissionsForm.tsxindex 2d3e78afe0..221e1b2bf1 100644--- a/apps/carbon/app/interfaces/Users/Employees/EmployeePermissionsForm/EmployeePermissionsForm.tsx+++ b/apps/carbon/app/modules/users/interfaces/Employees/EmployeePermissionsForm/EmployeePermissionsForm.tsx@@ -17,9 +17,9 @@ import type { PostgrestResponse } from "@supabase/supabase-js";import { useEffect, useState } from "react";import { ValidatedForm } from "remix-validated-form";import { Hidden, Select, Submit } from "~/components/Form";-import PermissionCheckboxes from "~/interfaces/Users/components/Permission";-import type { EmployeeType, Permission } from "~/interfaces/Users/types";-import { employeeValidator } from "~/services/users";+import PermissionCheckboxes from "~/modules/users/interfaces/components/Permission";+import type { EmployeeType, Permission } from "~/modules/users";+import { employeeValidator } from "~/modules/users";import type { TypeOfValidator } from "~/types/validators";import { mapRowsToOptions } from "~/utils/form";diff --git a/apps/carbon/app/interfaces/Users/Employees/EmployeePermissionsForm/index.ts b/apps/carbon/app/modules/users/interfaces/Employees/EmployeePermissionsForm/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Users/Employees/EmployeePermissionsForm/index.tsrename to apps/carbon/app/modules/users/interfaces/Employees/EmployeePermissionsForm/index.tsdiff --git a/apps/carbon/app/interfaces/Users/Employees/EmployeesTable/EmployeesTable.tsx b/apps/carbon/app/modules/users/interfaces/Employees/EmployeesTable/EmployeesTable.tsxsimilarity index 97%rename from apps/carbon/app/interfaces/Users/Employees/EmployeesTable/EmployeesTable.tsxrename to apps/carbon/app/modules/users/interfaces/Employees/EmployeesTable/EmployeesTable.tsxindex 83f5d57026..181a8620de 100644--- a/apps/carbon/app/interfaces/Users/Employees/EmployeesTable/EmployeesTable.tsx+++ b/apps/carbon/app/modules/users/interfaces/Employees/EmployeesTable/EmployeesTable.tsx@@ -7,9 +7,12 @@ import { FaBan } from "react-icons/fa";import { IoMdTrash } from "react-icons/io";import { Avatar, Table } from "~/components";import { usePermissions, useUrlParams } from "~/hooks";-import type { Employee } from "~/interfaces/Users/types";-import { BulkEditPermissionsForm } from "~/interfaces/Users/Employees";-import { ResendInviteModal, DeactivateUsersModal } from "~/interfaces/Users";+import type { Employee } from "~/modules/users";+import {+ BulkEditPermissionsForm,+ ResendInviteModal,+ DeactivateUsersModal,+} from "~/modules/users";type EmployeesTableProps = {data: Employee[];diff --git a/apps/carbon/app/interfaces/Users/Employees/EmployeesTable/index.ts b/apps/carbon/app/modules/users/interfaces/Employees/EmployeesTable/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Users/Employees/EmployeesTable/index.tsrename to apps/carbon/app/modules/users/interfaces/Employees/EmployeesTable/index.tsdiff --git a/apps/carbon/app/interfaces/Users/Employees/EmployeesTableFilters/EmployeesTableFilters.tsx b/apps/carbon/app/modules/users/interfaces/Employees/EmployeesTableFilters/EmployeesTableFilters.tsxsimilarity index 96%rename from apps/carbon/app/interfaces/Users/Employees/EmployeesTableFilters/EmployeesTableFilters.tsxrename to apps/carbon/app/modules/users/interfaces/Employees/EmployeesTableFilters/EmployeesTableFilters.tsxindex a091f82cc4..0ad079bf8a 100644--- a/apps/carbon/app/interfaces/Users/Employees/EmployeesTableFilters/EmployeesTableFilters.tsx+++ b/apps/carbon/app/modules/users/interfaces/Employees/EmployeesTableFilters/EmployeesTableFilters.tsx@@ -4,7 +4,7 @@ import { Link } from "@remix-run/react";import { IoMdAdd } from "react-icons/io";import { DebouncedInput } from "~/components/Search";import { usePermissions, useUrlParams } from "~/hooks";-import type { EmployeeType } from "~/interfaces/Users/types";+import type { EmployeeType } from "~/modules/users";import { mapRowsToOptions } from "~/utils/form";type EmployeesTableFiltersProps = {@@ -39,7 +39,7 @@ const EmployeesTableFilters = ({param="name"size="sm"minW={180}- placeholder="Search by name"+ placeholder="Filter by name"/><Select// @ts-ignorediff --git a/apps/carbon/app/interfaces/Users/Employees/EmployeesTableFilters/index.ts b/apps/carbon/app/modules/users/interfaces/Employees/EmployeesTableFilters/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Users/Employees/EmployeesTableFilters/index.tsrename to apps/carbon/app/modules/users/interfaces/Employees/EmployeesTableFilters/index.tsdiff --git a/apps/carbon/app/interfaces/Users/Employees/index.ts b/apps/carbon/app/modules/users/interfaces/Employees/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Users/Employees/index.tsrename to apps/carbon/app/modules/users/interfaces/Employees/index.tsdiff --git a/apps/carbon/app/interfaces/Users/Groups/GroupsForm/GroupsForm.tsx b/apps/carbon/app/modules/users/interfaces/Groups/GroupsForm/GroupsForm.tsxsimilarity index 97%rename from apps/carbon/app/interfaces/Users/Groups/GroupsForm/GroupsForm.tsxrename to apps/carbon/app/modules/users/interfaces/Groups/GroupsForm/GroupsForm.tsxindex e278f3d246..8a4517b4ab 100644--- a/apps/carbon/app/interfaces/Users/Groups/GroupsForm/GroupsForm.tsx+++ b/apps/carbon/app/modules/users/interfaces/Groups/GroupsForm/GroupsForm.tsx@@ -14,7 +14,7 @@ import { useNavigate } from "@remix-run/react";import { ValidatedForm } from "remix-validated-form";import { Hidden, Input, Submit, Users } from "~/components/Form";import { usePermissions } from "~/hooks";-import { groupValidator } from "~/services/users";+import { groupValidator } from "~/modules/users";import type { TypeOfValidator } from "~/types/validators";type GroupFormProps = {diff --git a/apps/carbon/app/interfaces/Users/Groups/GroupsForm/index.ts b/apps/carbon/app/modules/users/interfaces/Groups/GroupsForm/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Users/Groups/GroupsForm/index.tsrename to apps/carbon/app/modules/users/interfaces/Groups/GroupsForm/index.tsdiff --git a/apps/carbon/app/interfaces/Users/Groups/GroupsTable/GroupsTable.tsx b/apps/carbon/app/modules/users/interfaces/Groups/GroupsTable/GroupsTable.tsxsimilarity index 98%rename from apps/carbon/app/interfaces/Users/Groups/GroupsTable/GroupsTable.tsxrename to apps/carbon/app/modules/users/interfaces/Groups/GroupsTable/GroupsTable.tsxindex a2292e6282..e5620a4f68 100644--- a/apps/carbon/app/interfaces/Users/Groups/GroupsTable/GroupsTable.tsx+++ b/apps/carbon/app/modules/users/interfaces/Groups/GroupsTable/GroupsTable.tsx@@ -7,7 +7,7 @@ import { IoMdTrash } from "react-icons/io";import { Avatar } from "~/components";import { Table } from "~/components";import { usePermissions } from "~/hooks";-import type { Group } from "~/interfaces/Users/types";+import type { Group } from "~/modules/users";type GroupsTableProps = {data: Group[];diff --git a/apps/carbon/app/interfaces/Users/Groups/GroupsTable/index.ts b/apps/carbon/app/modules/users/interfaces/Groups/GroupsTable/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Users/Groups/GroupsTable/index.tsrename to apps/carbon/app/modules/users/interfaces/Groups/GroupsTable/index.tsdiff --git a/apps/carbon/app/interfaces/Users/Groups/GroupsTableFilters/GroupsTableFilters.tsx b/apps/carbon/app/modules/users/interfaces/Groups/GroupsTableFilters/GroupsTableFilters.tsxsimilarity index 96%rename from apps/carbon/app/interfaces/Users/Groups/GroupsTableFilters/GroupsTableFilters.tsxrename to apps/carbon/app/modules/users/interfaces/Groups/GroupsTableFilters/GroupsTableFilters.tsxindex bfd68db6e1..0f73b90a36 100644--- a/apps/carbon/app/interfaces/Users/Groups/GroupsTableFilters/GroupsTableFilters.tsx+++ b/apps/carbon/app/modules/users/interfaces/Groups/GroupsTableFilters/GroupsTableFilters.tsx@@ -24,7 +24,7 @@ const GroupsTableFilters = () => {param="name"size="sm"minW={180}- placeholder="Search by name"+ placeholder="Filter by name"/></HStack><HStack spacing={2}>diff --git a/apps/carbon/app/interfaces/Users/Groups/GroupsTableFilters/index.ts b/apps/carbon/app/modules/users/interfaces/Groups/GroupsTableFilters/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Users/Groups/GroupsTableFilters/index.tsrename to apps/carbon/app/modules/users/interfaces/Groups/GroupsTableFilters/index.tsdiff --git a/apps/carbon/app/interfaces/Users/Groups/index.ts b/apps/carbon/app/modules/users/interfaces/Groups/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Users/Groups/index.tsrename to apps/carbon/app/modules/users/interfaces/Groups/index.tsdiff --git a/apps/carbon/app/interfaces/Users/ResendInviteModal/ResendInviteModal.tsx b/apps/carbon/app/modules/users/interfaces/ResendInviteModal/ResendInviteModal.tsxsimilarity index 97%rename from apps/carbon/app/interfaces/Users/ResendInviteModal/ResendInviteModal.tsxrename to apps/carbon/app/modules/users/interfaces/ResendInviteModal/ResendInviteModal.tsxindex bb167ac000..790051fbf3 100644--- a/apps/carbon/app/interfaces/Users/ResendInviteModal/ResendInviteModal.tsx+++ b/apps/carbon/app/modules/users/interfaces/ResendInviteModal/ResendInviteModal.tsx@@ -13,7 +13,7 @@ import {import { useFetcher } from "@remix-run/react";import { ValidatedForm } from "remix-validated-form";import { UserSelect } from "~/components/Selectors";-import { resendInviteValidator } from "~/services/users";+import { resendInviteValidator } from "~/modules/users";type ResendInviteModalProps = {userIds: string[];diff --git a/apps/carbon/app/interfaces/Users/ResendInviteModal/index.ts b/apps/carbon/app/modules/users/interfaces/ResendInviteModal/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Users/ResendInviteModal/index.tsrename to apps/carbon/app/modules/users/interfaces/ResendInviteModal/index.tsdiff --git a/apps/carbon/app/interfaces/Users/Suppliers/CreateSupplierModal/CreateSupplierModal.tsx b/apps/carbon/app/modules/users/interfaces/Suppliers/CreateSupplierModal/CreateSupplierModal.tsxsimilarity index 98%rename from apps/carbon/app/interfaces/Users/Suppliers/CreateSupplierModal/CreateSupplierModal.tsxrename to apps/carbon/app/modules/users/interfaces/Suppliers/CreateSupplierModal/CreateSupplierModal.tsxindex 5ddde7298e..f6a022ff22 100644--- a/apps/carbon/app/interfaces/Users/Suppliers/CreateSupplierModal/CreateSupplierModal.tsx+++ b/apps/carbon/app/modules/users/interfaces/Suppliers/CreateSupplierModal/CreateSupplierModal.tsx@@ -17,7 +17,7 @@ import { useRef, useState } from "react";import { ValidatedForm } from "remix-validated-form";import { Supplier, Submit, SupplierContact } from "~/components/Form";import { useUrlParams } from "~/hooks";-import { createSupplierAccountValidator } from "~/services/users";+import { createSupplierAccountValidator } from "~/modules/users";import type { Result } from "~/types";const CreateSupplierModal = () => {diff --git a/apps/carbon/app/interfaces/Users/Suppliers/CreateSupplierModal/index.ts b/apps/carbon/app/modules/users/interfaces/Suppliers/CreateSupplierModal/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Users/Suppliers/CreateSupplierModal/index.tsrename to apps/carbon/app/modules/users/interfaces/Suppliers/CreateSupplierModal/index.tsdiff --git a/apps/carbon/app/interfaces/Users/Suppliers/SupplierAccountsTable/SuppliersAccountsTable.tsx b/apps/carbon/app/modules/users/interfaces/Suppliers/SupplierAccountsTable/SuppliersAccountsTable.tsxsimilarity index 97%rename from apps/carbon/app/interfaces/Users/Suppliers/SupplierAccountsTable/SuppliersAccountsTable.tsxrename to apps/carbon/app/modules/users/interfaces/Suppliers/SupplierAccountsTable/SuppliersAccountsTable.tsxindex e41dfab07e..397ec14c6f 100644--- a/apps/carbon/app/interfaces/Users/Suppliers/SupplierAccountsTable/SuppliersAccountsTable.tsx+++ b/apps/carbon/app/modules/users/interfaces/Suppliers/SupplierAccountsTable/SuppliersAccountsTable.tsx@@ -6,8 +6,8 @@ import { FaBan } from "react-icons/fa";import { IoMdTrash } from "react-icons/io";import { Avatar, Table } from "~/components";import { usePermissions } from "~/hooks";-import type { Supplier } from "~/interfaces/Users/types";-import { ResendInviteModal, DeactivateUsersModal } from "~/interfaces/Users";+import type { Supplier } from "~/modules/users";+import { ResendInviteModal, DeactivateUsersModal } from "~/modules/users";type SupplierAccountsTableProps = {data: Supplier[];diff --git a/apps/carbon/app/interfaces/Users/Suppliers/SupplierAccountsTable/index.ts b/apps/carbon/app/modules/users/interfaces/Suppliers/SupplierAccountsTable/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Users/Suppliers/SupplierAccountsTable/index.tsrename to apps/carbon/app/modules/users/interfaces/Suppliers/SupplierAccountsTable/index.tsdiff --git a/apps/carbon/app/interfaces/Users/Suppliers/SupplierAccountsTableFilters/SupplierAccountsTableFilters.tsx b/apps/carbon/app/modules/users/interfaces/Suppliers/SupplierAccountsTableFilters/SupplierAccountsTableFilters.tsxsimilarity index 96%rename from apps/carbon/app/interfaces/Users/Suppliers/SupplierAccountsTableFilters/SupplierAccountsTableFilters.tsxrename to apps/carbon/app/modules/users/interfaces/Suppliers/SupplierAccountsTableFilters/SupplierAccountsTableFilters.tsxindex 3b4c929d50..0d22db897e 100644--- a/apps/carbon/app/interfaces/Users/Suppliers/SupplierAccountsTableFilters/SupplierAccountsTableFilters.tsx+++ b/apps/carbon/app/modules/users/interfaces/Suppliers/SupplierAccountsTableFilters/SupplierAccountsTableFilters.tsx@@ -4,7 +4,7 @@ import { Link } from "@remix-run/react";import { IoMdAdd } from "react-icons/io";import { DebouncedInput } from "~/components/Search";import { usePermissions, useUrlParams } from "~/hooks";-import type { SupplierType } from "~/interfaces/Purchasing/types";+import type { SupplierType } from "~/modules/purchasing";import { mapRowsToOptions } from "~/utils/form";type SupplierAccountsTableFiltersProps = {@@ -39,7 +39,7 @@ const SupplierAccountsTableFilters = ({param="name"size="sm"minW={180}- placeholder="Search by name"+ placeholder="Filter by name"/><Select// @ts-ignorediff --git a/apps/carbon/app/interfaces/Users/Suppliers/SupplierAccountsTableFilters/index.ts b/apps/carbon/app/modules/users/interfaces/Suppliers/SupplierAccountsTableFilters/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Users/Suppliers/SupplierAccountsTableFilters/index.tsrename to apps/carbon/app/modules/users/interfaces/Suppliers/SupplierAccountsTableFilters/index.tsdiff --git a/apps/carbon/app/interfaces/Users/Suppliers/index.ts b/apps/carbon/app/modules/users/interfaces/Suppliers/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Users/Suppliers/index.tsrename to apps/carbon/app/modules/users/interfaces/Suppliers/index.tsdiff --git a/apps/carbon/app/interfaces/Users/components/Permission/Permission.tsx b/apps/carbon/app/modules/users/interfaces/components/Permission/Permission.tsxsimilarity index 96%rename from apps/carbon/app/interfaces/Users/components/Permission/Permission.tsxrename to apps/carbon/app/modules/users/interfaces/components/Permission/Permission.tsxindex 529540c2b0..8b63388c0f 100644--- a/apps/carbon/app/interfaces/Users/components/Permission/Permission.tsx+++ b/apps/carbon/app/modules/users/interfaces/components/Permission/Permission.tsx@@ -1,6 +1,6 @@import { Box, Checkbox, Stack } from "@chakra-ui/react";import { capitalize } from "~/utils/string";-import type { Permission } from "~/interfaces/Users/types";+import type { Permission } from "~/modules/users";type PermissionProps = {module: string;diff --git a/apps/carbon/app/interfaces/Users/components/Permission/index.ts b/apps/carbon/app/modules/users/interfaces/components/Permission/index.tssimilarity index 100%rename from apps/carbon/app/interfaces/Users/components/Permission/index.tsrename to apps/carbon/app/modules/users/interfaces/components/Permission/index.tsdiff --git a/apps/carbon/app/interfaces/Users/index.ts b/apps/carbon/app/modules/users/interfaces/index.tssimilarity index 61%rename from apps/carbon/app/interfaces/Users/index.tsrename to apps/carbon/app/modules/users/interfaces/index.tsindex 7b4d4cb573..0b35a63926 100644--- a/apps/carbon/app/interfaces/Users/index.ts+++ b/apps/carbon/app/modules/users/interfaces/index.ts@@ -3,3 +3,8 @@ import ResendInviteModal from "./ResendInviteModal";import useUsersSidebar from "./useUsersSidebar";export { DeactivateUsersModal, ResendInviteModal, useUsersSidebar };+export * from "./Customers";+export * from "./Employees";+export * from "./EmployeeTypes";+export * from "./Groups";+export * from "./Suppliers";diff --git a/apps/carbon/app/interfaces/Users/useUsersSidebar.tsx b/apps/carbon/app/modules/users/interfaces/useUsersSidebar.tsxsimilarity index 100%rename from apps/carbon/app/interfaces/Users/useUsersSidebar.tsxrename to apps/carbon/app/modules/users/interfaces/useUsersSidebar.tsxdiff --git a/apps/carbon/app/services/users/index.ts b/apps/carbon/app/modules/users/services/index.tssimilarity index 100%rename from apps/carbon/app/services/users/index.tsrename to apps/carbon/app/modules/users/services/index.tsdiff --git a/apps/carbon/app/services/users/users.form.ts b/apps/carbon/app/modules/users/services/users.form.tssimilarity index 100%rename from apps/carbon/app/services/users/users.form.tsrename to apps/carbon/app/modules/users/services/users.form.tsdiff --git a/apps/carbon/app/services/users/users.server.ts b/apps/carbon/app/modules/users/services/users.server.tssimilarity index 99%rename from apps/carbon/app/services/users/users.server.tsrename to apps/carbon/app/modules/users/services/users.server.tsindex d3ebacb148..2c8ad46f43 100644--- a/apps/carbon/app/services/users/users.server.ts+++ b/apps/carbon/app/modules/users/services/users.server.ts@@ -9,14 +9,14 @@ import type {Feature,Permission,User,-} from "~/interfaces/Users/types";+} from "~/modules/users";+import { getSupplierContact } from "~/modules/purchasing";import {deleteAuthAccount,sendInviteByEmail,sendMagicLink,} from "~/services/auth";-import { getSupplierContact } from "~/services/purchasing";-import { getCustomerContact } from "~/services/sales";+import { getCustomerContact } from "~/modules/sales";import { requireAuthSession, flash } from "~/services/session";import type { Result } from "~/types";import type { GenericQueryFilters } from "~/utils/query";@@ -605,7 +605,8 @@ async function insertSupplierAccount(async function insertUser(client: SupabaseClient<Database>,- user: Omit<User, "fullName">+ //TODO: fix this type+ user: Omit<User, "fullName" | "createdAt">) {return client.from("user").insert([user]).select("*");}diff --git a/apps/carbon/app/interfaces/Users/types.ts b/apps/carbon/app/modules/users/types.tssimilarity index 98%rename from apps/carbon/app/interfaces/Users/types.tsrename to apps/carbon/app/modules/users/types.tsindex 2d01a059d2..5d7ef3408c 100644--- a/apps/carbon/app/interfaces/Users/types.ts+++ b/apps/carbon/app/modules/users/types.ts@@ -7,7 +7,7 @@ import type {getPermissionsByEmployeeType,getSuppliers,getUsers,-} from "~/services/users";+} from "./services";export type Customer = NonNullable<Awaited<ReturnType<typeof getCustomers>>["data"]diff --git a/apps/carbon/app/queues/bulk-permissions.queue.server.ts b/apps/carbon/app/queues/bulk-permissions.queue.server.tsindex 1e7ceae9a0..16bd002f62 100644--- a/apps/carbon/app/queues/bulk-permissions.queue.server.ts+++ b/apps/carbon/app/queues/bulk-permissions.queue.server.ts@@ -1,7 +1,7 @@import { Queue } from "~/lib/bullmq";import { getSupabaseServiceRole } from "~/lib/supabase";-import type { Permission } from "~/interfaces/Users/types";-import { updatePermissions } from "~/services/users";+import type { Permission } from "~/modules/users";+import { updatePermissions } from "~/modules/users";export type BulkPermissionsQueueData = {id: string;diff --git a/apps/carbon/app/queues/deactivate-users.queue.server.ts b/apps/carbon/app/queues/deactivate-users.queue.server.tsindex 96704ea79e..2be90f4c45 100644--- a/apps/carbon/app/queues/deactivate-users.queue.server.ts+++ b/apps/carbon/app/queues/deactivate-users.queue.server.ts@@ -1,6 +1,6 @@import { Queue } from "~/lib/bullmq";import { getSupabaseServiceRole } from "~/lib/supabase";-import { deactivateUser } from "~/services/users";+import { deactivateUser } from "~/modules/users";export type DeactivateUserQueueData = {id: string;diff --git a/apps/carbon/app/queues/resend-invites.queue.server.ts b/apps/carbon/app/queues/resend-invites.queue.server.tsindex ed8af6880f..2bb8b0dbfc 100644--- a/apps/carbon/app/queues/resend-invites.queue.server.ts+++ b/apps/carbon/app/queues/resend-invites.queue.server.ts@@ -1,6 +1,6 @@import { Queue } from "~/lib/bullmq";import { getSupabaseServiceRole } from "~/lib/supabase";-import { resendInvite } from "~/services/users";+import { resendInvite } from "~/modules/users";export type ResendInvitesQueueData = {id: string;diff --git a/apps/carbon/app/root.tsx b/apps/carbon/app/root.tsxindex f1aeeb7643..837abcd274 100644--- a/apps/carbon/app/root.tsx+++ b/apps/carbon/app/root.tsx@@ -25,7 +25,7 @@ export function links() {export const meta: MetaFunction = () => ({charset: "utf-8",title: "Carbon ERP",- viewport: "width=device-width,initial-scale=1",+ viewport: "width=device-width",});interface DocumentProps {diff --git a/apps/carbon/app/routes/_public+/callback.tsx b/apps/carbon/app/routes/_public+/callback.tsxindex 466406f3e4..06acbda3d8 100644--- a/apps/carbon/app/routes/_public+/callback.tsx+++ b/apps/carbon/app/routes/_public+/callback.tsx@@ -6,7 +6,7 @@ import { useFetcher } from "@remix-run/react";import { callbackValidator } from "~/services/auth/auth.form";import { getSupabase } from "~/lib/supabase";import { refreshAccessToken } from "~/services/auth";-import { getUserByEmail } from "~/services/users";+import { getUserByEmail } from "~/modules/users";import {commitAuthSession,destroyAuthSession,diff --git a/apps/carbon/app/routes/_public+/forgot-password.tsx b/apps/carbon/app/routes/_public+/forgot-password.tsxindex e28df2d2b1..6c20fca721 100644--- a/apps/carbon/app/routes/_public+/forgot-password.tsx+++ b/apps/carbon/app/routes/_public+/forgot-password.tsx@@ -18,7 +18,7 @@ import { ValidatedForm, validationError } from "remix-validated-form";import { Input, Submit } from "~/components/Form";import { getAuthSession } from "~/services/session";import { forgotPasswordValidator, sendMagicLink } from "~/services/auth";-import { getUserByEmail } from "~/services/users";+import { getUserByEmail } from "~/modules/users";import { assertIsPost } from "~/utils/http";import type { FormActionData, Result } from "~/types";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/_public+/reset-password.tsx b/apps/carbon/app/routes/_public+/reset-password.tsxindex df8c7beab0..f7c310ad2a 100644--- a/apps/carbon/app/routes/_public+/reset-password.tsx+++ b/apps/carbon/app/routes/_public+/reset-password.tsx@@ -15,7 +15,7 @@ import { useNavigate } from "@remix-run/react";import { ValidatedForm, validationError } from "remix-validated-form";import { Password, Submit } from "~/components/Form";import { resetPasswordValidator } from "~/services/auth";-import { resetPassword } from "~/services/users";+import { resetPassword } from "~/modules/users";import { requireAuthSession, flash } from "~/services/session";import { error, success } from "~/utils/result";import { assertIsPost } from "~/utils/http";diff --git a/apps/carbon/app/routes/api+/purchasing.supplier-contacts.tsx b/apps/carbon/app/routes/api+/purchasing.supplier-contacts.tsxindex 552482fc5f..bee2871fcf 100644--- a/apps/carbon/app/routes/api+/purchasing.supplier-contacts.tsx+++ b/apps/carbon/app/routes/api+/purchasing.supplier-contacts.tsx@@ -1,7 +1,7 @@import type { LoaderArgs } from "@remix-run/node";import { json } from "@remix-run/node";import { requirePermissions } from "~/services/auth";-import { getSupplierContacts } from "~/services/purchasing";+import { getSupplierContacts } from "~/modules/purchasing";import { flash } from "~/services/session";import { error } from "~/utils/result";diff --git a/apps/carbon/app/routes/api+/purchasing.suppliers.tsx b/apps/carbon/app/routes/api+/purchasing.suppliers.tsxindex 22ca60dd4e..bd177c24a7 100644--- a/apps/carbon/app/routes/api+/purchasing.suppliers.tsx+++ b/apps/carbon/app/routes/api+/purchasing.suppliers.tsx@@ -1,7 +1,7 @@import type { LoaderArgs } from "@remix-run/node";import { json } from "@remix-run/node";import { requirePermissions } from "~/services/auth";-import { getSuppliersList } from "~/services/purchasing";+import { getSuppliersList } from "~/modules/purchasing";export async function loader({ request }: LoaderArgs) {const authorized = await requirePermissions(request, {diff --git a/apps/carbon/app/routes/api+/resources.abilities.tsx b/apps/carbon/app/routes/api+/resources.abilities.tsxindex 905f6dfc58..1c93b9fa72 100644--- a/apps/carbon/app/routes/api+/resources.abilities.tsx+++ b/apps/carbon/app/routes/api+/resources.abilities.tsx@@ -1,7 +1,7 @@import type { LoaderArgs } from "@remix-run/node";import { json } from "@remix-run/node";+import { getAbilitiesList } from "~/modules/resources";import { requirePermissions } from "~/services/auth";-import { getAbilitiesList } from "~/services/resources";export async function loader({ request }: LoaderArgs) {const authorized = await requirePermissions(request, {diff --git a/apps/carbon/app/routes/api+/resources.departments.tsx b/apps/carbon/app/routes/api+/resources.departments.tsxindex 12298a68ee..7405931d91 100644--- a/apps/carbon/app/routes/api+/resources.departments.tsx+++ b/apps/carbon/app/routes/api+/resources.departments.tsx@@ -1,7 +1,7 @@import type { LoaderArgs } from "@remix-run/node";import { json } from "@remix-run/node";+import { getDepartmentsList } from "~/modules/resources";import { requirePermissions } from "~/services/auth";-import { getDepartmentsList } from "~/services/resources";export async function loader({ request }: LoaderArgs) {const authorized = await requirePermissions(request, {diff --git a/apps/carbon/app/routes/api+/resources.locations.tsx b/apps/carbon/app/routes/api+/resources.locations.tsxindex 0ca78bea10..293f002f2a 100644--- a/apps/carbon/app/routes/api+/resources.locations.tsx+++ b/apps/carbon/app/routes/api+/resources.locations.tsx@@ -1,7 +1,7 @@import type { LoaderArgs } from "@remix-run/node";import { json } from "@remix-run/node";+import { getLocationsList } from "~/modules/resources";import { requirePermissions } from "~/services/auth";-import { getLocationsList } from "~/services/resources";export async function loader({ request }: LoaderArgs) {const authorized = await requirePermissions(request, {diff --git a/apps/carbon/app/routes/api+/resources.shifts.tsx b/apps/carbon/app/routes/api+/resources.shifts.tsxindex 0583fecf8f..a407975080 100644--- a/apps/carbon/app/routes/api+/resources.shifts.tsx+++ b/apps/carbon/app/routes/api+/resources.shifts.tsx@@ -1,7 +1,7 @@import type { LoaderArgs } from "@remix-run/node";import { json } from "@remix-run/node";+import { getShiftsList } from "~/modules/resources";import { requirePermissions } from "~/services/auth";-import { getShiftsList } from "~/services/resources";export async function loader({ request }: LoaderArgs) {const authorized = await requirePermissions(request, {diff --git a/apps/carbon/app/routes/api+/resources.work-cells.tsx b/apps/carbon/app/routes/api+/resources.work-cells.tsxindex 81f26a65a4..634eb44105 100644--- a/apps/carbon/app/routes/api+/resources.work-cells.tsx+++ b/apps/carbon/app/routes/api+/resources.work-cells.tsx@@ -1,7 +1,7 @@import type { LoaderArgs } from "@remix-run/node";import { json } from "@remix-run/node";+import { getWorkCellList } from "~/modules/resources";import { requirePermissions } from "~/services/auth";-import { getWorkCellList } from "~/services/resources";export async function loader({ request }: LoaderArgs) {const authorized = await requirePermissions(request, {diff --git a/apps/carbon/app/routes/api+/sales.customer-contacts.tsx b/apps/carbon/app/routes/api+/sales.customer-contacts.tsxindex d45eef1baf..4661cdfd3e 100644--- a/apps/carbon/app/routes/api+/sales.customer-contacts.tsx+++ b/apps/carbon/app/routes/api+/sales.customer-contacts.tsx@@ -1,7 +1,7 @@import type { LoaderArgs } from "@remix-run/node";import { json } from "@remix-run/node";+import { getCustomerContacts } from "~/modules/sales";import { requirePermissions } from "~/services/auth";-import { getCustomerContacts } from "~/services/sales";import { flash } from "~/services/session";import { error } from "~/utils/result";diff --git a/apps/carbon/app/routes/api+/sales.customers.tsx b/apps/carbon/app/routes/api+/sales.customers.tsxindex 566d5bd505..3ad62ed9bf 100644--- a/apps/carbon/app/routes/api+/sales.customers.tsx+++ b/apps/carbon/app/routes/api+/sales.customers.tsx@@ -1,7 +1,7 @@import type { LoaderArgs } from "@remix-run/node";import { json } from "@remix-run/node";+import { getCustomersList } from "~/modules/sales";import { requirePermissions } from "~/services/auth";-import { getCustomersList } from "~/services/sales";export async function loader({ request }: LoaderArgs) {const authorized = await requirePermissions(request, {diff --git a/apps/carbon/app/routes/api+/users.employee-types.tsx b/apps/carbon/app/routes/api+/users.employee-types.tsxindex e1a02c7d11..da775a0f27 100644--- a/apps/carbon/app/routes/api+/users.employee-types.tsx+++ b/apps/carbon/app/routes/api+/users.employee-types.tsx@@ -1,6 +1,6 @@import type { LoaderArgs } from "@remix-run/node";import { json } from "@remix-run/node";-import { getEmployeeTypes } from "~/services/users";+import { getEmployeeTypes } from "~/modules/users";import { requirePermissions } from "~/services/auth";export async function loader({ request }: LoaderArgs) {diff --git a/apps/carbon/app/routes/api+/users.empty-permissions.tsx b/apps/carbon/app/routes/api+/users.empty-permissions.tsxindex d238790bdc..8e44ea0dbf 100644--- a/apps/carbon/app/routes/api+/users.empty-permissions.tsx+++ b/apps/carbon/app/routes/api+/users.empty-permissions.tsx@@ -1,11 +1,8 @@import type { LoaderArgs } from "@remix-run/node";import { json } from "@remix-run/router";+import { getFeatures, makeEmptyPermissionsFromFeatures } from "~/modules/users";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";-import {- getFeatures,- makeEmptyPermissionsFromFeatures,-} from "~/services/users";import { error } from "~/utils/result";export async function loader({ request }: LoaderArgs) {diff --git a/apps/carbon/app/routes/api+/users.groups.tsx b/apps/carbon/app/routes/api+/users.groups.tsxindex c432379298..ade1fe9fb8 100644--- a/apps/carbon/app/routes/api+/users.groups.tsx+++ b/apps/carbon/app/routes/api+/users.groups.tsx@@ -1,7 +1,7 @@import type { LoaderArgs } from "@remix-run/node";import { json } from "@remix-run/node";import { arrayToTree } from "performant-array-to-tree";-import type { Group } from "~/interfaces/Users/types";+import type { Group } from "~/modules/users";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";import { error } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/_layout.tsx b/apps/carbon/app/routes/x+/_layout.tsxindex f7b6037e77..0e3fd23d41 100644--- a/apps/carbon/app/routes/x+/_layout.tsx+++ b/apps/carbon/app/routes/x+/_layout.tsx@@ -7,7 +7,7 @@ import { Outlet, useLoaderData } from "@remix-run/react";import { useEffect } from "react";import { IconSidebar, Topbar } from "~/components/Layout";import { getSupabase, SupabaseProvider } from "~/lib/supabase";-import { getUserClaims, getCurrentUser } from "~/services/users";+import { getUserClaims, getCurrentUser } from "~/modules/users";import {destroyAuthSession,getSessionFlash,diff --git a/apps/carbon/app/routes/x+/account+/$userId.attribute.tsx b/apps/carbon/app/routes/x+/account+/$userId.attribute.tsxindex 76a69fe0f7..a1422171a7 100644--- a/apps/carbon/app/routes/x+/account+/$userId.attribute.tsx+++ b/apps/carbon/app/routes/x+/account+/$userId.attribute.tsx@@ -6,12 +6,12 @@ import {attributeNumericValidator,attributeTextValidator,attributeUserValidator,-} from "~/services/account";+ upsertUserAttributeValue,+} from "~/modules/account";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";-import { upsertUserAttributeValue } from "~/services/account";-import { getAttribute } from "~/services/resources";-import { getUserClaims } from "~/services/users";+import { getAttribute } from "~/modules/resources";+import { getUserClaims } from "~/modules/users";import { assertIsPost } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/account+/$userId.delete.attribute.tsx b/apps/carbon/app/routes/x+/account+/$userId.delete.attribute.tsxindex ea42cc99f5..b40997134d 100644--- a/apps/carbon/app/routes/x+/account+/$userId.delete.attribute.tsx+++ b/apps/carbon/app/routes/x+/account+/$userId.delete.attribute.tsx@@ -2,9 +2,9 @@ import type { ActionArgs } from "@remix-run/node";import { json } from "@remix-run/node";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";-import { deleteUserAttributeValue } from "~/services/account";-import { getAttribute } from "~/services/resources";-import { getUserClaims } from "~/services/users";+import { deleteUserAttributeValue } from "~/modules/account";+import { getAttribute } from "~/modules/resources";+import { getUserClaims } from "~/modules/users";import { assertIsPost } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/account+/_layout.tsx b/apps/carbon/app/routes/x+/account+/_layout.tsxindex 6f274a18e7..14fcdde6a3 100644--- a/apps/carbon/app/routes/x+/account+/_layout.tsx+++ b/apps/carbon/app/routes/x+/account+/_layout.tsx@@ -3,7 +3,7 @@ import { Grid, VStack } from "@chakra-ui/react";import type { MetaFunction } from "@remix-run/node";import { Outlet } from "@remix-run/react";import { ContentSidebar } from "~/components/Layout/Sidebar";-import { useAccountSidebar } from "~/interfaces/Account";+import { useAccountSidebar } from "~/modules/account";export const meta: MetaFunction = () => ({title: "Carbon | My Account",diff --git a/apps/carbon/app/routes/x+/account+/password.tsx b/apps/carbon/app/routes/x+/account+/password.tsxindex 90739e4667..2346575d7d 100644--- a/apps/carbon/app/routes/x+/account+/password.tsx+++ b/apps/carbon/app/routes/x+/account+/password.tsx@@ -3,8 +3,7 @@ import { json, redirect } from "@remix-run/router";import { validationError } from "remix-validated-form";import { PageTitle } from "~/components/Layout";import { getSupabaseServiceRole } from "~/lib/supabase";-import { PasswordForm } from "~/interfaces/Account/Password";-import { accountPasswordValidator } from "~/services/account";+import { PasswordForm, accountPasswordValidator } from "~/modules/account";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";import { assertIsPost } from "~/utils/http";diff --git a/apps/carbon/app/routes/x+/account+/personal.tsx b/apps/carbon/app/routes/x+/account+/personal.tsxindex b5bc3956f8..6b962429ee 100644--- a/apps/carbon/app/routes/x+/account+/personal.tsx+++ b/apps/carbon/app/routes/x+/account+/personal.tsx@@ -4,9 +4,8 @@ import { redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";import { json } from "@remix-run/router";import { PageTitle, SectionTitle } from "~/components/Layout";-import { UserAttributesForm } from "~/interfaces/Account/UserAttributes";-import type { PrivateAttributes } from "~/interfaces/Account/types";-import { getPrivateAttributes } from "~/services/account";+import type { PrivateAttributes } from "~/modules/account";+import { UserAttributesForm, getPrivateAttributes } from "~/modules/account";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";import { error } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/account+/profile.tsx b/apps/carbon/app/routes/x+/account+/profile.tsxindex 0ac1eb2ffd..69616535ab 100644--- a/apps/carbon/app/routes/x+/account+/profile.tsx+++ b/apps/carbon/app/routes/x+/account+/profile.tsx@@ -5,16 +5,17 @@ import { useLoaderData } from "@remix-run/react";import { json } from "@remix-run/router";import { validationError } from "remix-validated-form";import { PageTitle, SectionTitle } from "~/components/Layout";-import { ProfileForm, ProfilePhotoForm } from "~/interfaces/Account/Profile";-import { UserAttributesForm } from "~/interfaces/Account/UserAttributes";-import type { PublicAttributes } from "~/interfaces/Account/types";import {+ ProfileForm,+ ProfilePhotoForm,+ UserAttributesForm,accountProfileValidator,getAccount,getPublicAttributes,updateAvatar,updatePublicAccount,-} from "~/services/account";+} from "~/modules/account";+import type { PublicAttributes } from "~/modules/account";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";import { assertIsPost } from "~/utils/http";diff --git a/apps/carbon/app/routes/x+/purchasing+/_layout.tsx b/apps/carbon/app/routes/x+/purchasing+/_layout.tsxindex 6386ca85d2..b1a7320495 100644--- a/apps/carbon/app/routes/x+/purchasing+/_layout.tsx+++ b/apps/carbon/app/routes/x+/purchasing+/_layout.tsx@@ -2,7 +2,7 @@ import { Grid, VStack } from "@chakra-ui/react";import type { MetaFunction } from "@remix-run/node";import { Outlet } from "@remix-run/react";import { GroupedContentSidebar } from "~/components/Layout/Sidebar";-import { usePurchasingSidebar } from "~/interfaces/Purchasing";+import { usePurchasingSidebar } from "~/modules/purchasing";export const meta: MetaFunction = () => ({title: "Carbon | Purchasing",diff --git a/apps/carbon/app/routes/x+/purchasing+/supplier-types.$supplierTypeId.tsx b/apps/carbon/app/routes/x+/purchasing+/supplier-types.$supplierTypeId.tsxindex 903e310bb4..b2f94b9ca0 100644--- a/apps/carbon/app/routes/x+/purchasing+/supplier-types.$supplierTypeId.tsx+++ b/apps/carbon/app/routes/x+/purchasing+/supplier-types.$supplierTypeId.tsx@@ -3,13 +3,13 @@ import { redirect } from "@remix-run/node";import { json } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";import { validationError } from "remix-validated-form";-import { SupplierTypeForm } from "~/interfaces/Purchasing/SupplierTypes";-import { requirePermissions } from "~/services/auth";import {- supplierTypeValidator,+ SupplierTypeForm,getSupplierType,+ supplierTypeValidator,upsertSupplierType,-} from "~/services/purchasing";+} from "~/modules/purchasing";+import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";import { assertIsPost, notFound } from "~/utils/http";import { error, success } from "~/utils/result";@@ -25,6 +25,15 @@ export async function loader({ request, params }: LoaderArgs) {const supplierType = await getSupplierType(client, supplierTypeId);+ if (supplierType.error) {+ return redirect(+ "/x/purchasing/supplier-types",+ await flash(+ request,+ error(supplierType.error, "Failed to get supplier type")+ )+ );+ }if (supplierType?.data?.protected) {return redirect("/x/purchasing/supplier-types",@@ -33,7 +42,7 @@ export async function loader({ request, params }: LoaderArgs) {}return json({- supplierType,+ supplierType: supplierType.data,});}@@ -79,9 +88,9 @@ export default function EditSupplierTypesRoute() {const { supplierType } = useLoaderData<typeof loader>();const initialValues = {- id: supplierType.data?.id ?? undefined,- name: supplierType.data?.name ?? "",- color: supplierType.data?.color ?? "#000000",+ id: supplierType.id ?? undefined,+ name: supplierType.name ?? "",+ color: supplierType.color ?? "#000000",};return <SupplierTypeForm initialValues={initialValues} />;diff --git a/apps/carbon/app/routes/x+/purchasing+/supplier-types.delete.$supplierTypeId.tsx b/apps/carbon/app/routes/x+/purchasing+/supplier-types.delete.$supplierTypeId.tsxindex 3482046980..edb10c6aef 100644--- a/apps/carbon/app/routes/x+/purchasing+/supplier-types.delete.$supplierTypeId.tsx+++ b/apps/carbon/app/routes/x+/purchasing+/supplier-types.delete.$supplierTypeId.tsx@@ -2,8 +2,8 @@ import type { ActionArgs, LoaderArgs } 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 { deleteSupplierType, getSupplierType } from "~/modules/purchasing";import { requirePermissions } from "~/services/auth";-import { deleteSupplierType, getSupplierType } from "~/services/purchasing";import { flash } from "~/services/session";import { error, success } from "~/utils/result";import { notFound } from "~/utils/http";diff --git a/apps/carbon/app/routes/x+/purchasing+/supplier-types.new.tsx b/apps/carbon/app/routes/x+/purchasing+/supplier-types.new.tsxindex 025a6b2e54..e8a714cbed 100644--- a/apps/carbon/app/routes/x+/purchasing+/supplier-types.new.tsx+++ b/apps/carbon/app/routes/x+/purchasing+/supplier-types.new.tsx@@ -2,12 +2,12 @@ import type { ActionArgs, LoaderArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { json } from "@remix-run/node";import { validationError } from "remix-validated-form";-import { SupplierTypeForm } from "~/interfaces/Purchasing/SupplierTypes";-import { requirePermissions } from "~/services/auth";import {+ SupplierTypeForm,supplierTypeValidator,upsertSupplierType,-} from "~/services/purchasing";+} from "~/modules/purchasing";+import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";import { assertIsPost } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/purchasing+/supplier-types.tsx b/apps/carbon/app/routes/x+/purchasing+/supplier-types.tsxindex 53afe252f5..93610c8dfc 100644--- a/apps/carbon/app/routes/x+/purchasing+/supplier-types.tsx+++ b/apps/carbon/app/routes/x+/purchasing+/supplier-types.tsx@@ -5,9 +5,9 @@ import { Outlet, useLoaderData } from "@remix-run/react";import {SupplierTypesTable,SupplierTypesTableFilters,-} from "~/interfaces/Purchasing/SupplierTypes";+ getSupplierTypes,+} from "~/modules/purchasing";import { requirePermissions } from "~/services/auth";-import { getSupplierTypes } from "~/services/purchasing";import { getGenericQueryFilters } from "~/utils/query";export async function loader({ request }: LoaderArgs) {diff --git a/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.contact.$supplierContactId.tsx b/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.contact.$supplierContactId.tsxindex 807ea598b5..4ec0186a53 100644--- a/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.contact.$supplierContactId.tsx+++ b/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.contact.$supplierContactId.tsx@@ -1,11 +1,11 @@import type { ActionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { validationError } from "remix-validated-form";-import { requirePermissions } from "~/services/auth";import {- updateSupplierContact,supplierContactValidator,-} from "~/services/purchasing";+ updateSupplierContact,+} from "~/modules/purchasing";+import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";import { assertIsPost, badRequest, notFound } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.contact.delete.$supplierContactId.tsx b/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.contact.delete.$supplierContactId.tsxindex 1ab1c4d8a9..8ac29ec011 100644--- a/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.contact.delete.$supplierContactId.tsx+++ b/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.contact.delete.$supplierContactId.tsx@@ -1,7 +1,7 @@import type { ActionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { requirePermissions } from "~/services/auth";-import { deleteSupplierContact } from "~/services/purchasing";+import { deleteSupplierContact } from "~/modules/purchasing";import { flash } from "~/services/session";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.contact.new.tsx b/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.contact.new.tsxindex 95160b63c4..1fb6807019 100644--- a/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.contact.new.tsx+++ b/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.contact.new.tsx@@ -1,11 +1,11 @@import type { ActionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { validationError } from "remix-validated-form";-import { requirePermissions } from "~/services/auth";import {insertSupplierContact,supplierContactValidator,-} from "~/services/purchasing";+} from "~/modules/purchasing";+import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";import { assertIsPost, notFound } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.location.$supplierLocationId.tsx b/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.location.$supplierLocationId.tsxindex fa99cedb45..ad2a0851a8 100644--- a/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.location.$supplierLocationId.tsx+++ b/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.location.$supplierLocationId.tsx@@ -1,11 +1,11 @@import type { ActionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { validationError } from "remix-validated-form";-import { requirePermissions } from "~/services/auth";import {updateSupplierLocation,supplierLocationValidator,-} from "~/services/purchasing";+} from "~/modules/purchasing";+import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";import { assertIsPost, badRequest, notFound } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.location.delete.$supplierLocationId.tsx b/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.location.delete.$supplierLocationId.tsxindex 3914251892..70aadc33be 100644--- a/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.location.delete.$supplierLocationId.tsx+++ b/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.location.delete.$supplierLocationId.tsx@@ -1,7 +1,7 @@import type { ActionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";+import { deleteSupplierLocation } from "~/modules/purchasing";import { requirePermissions } from "~/services/auth";-import { deleteSupplierLocation } from "~/services/purchasing";import { flash } from "~/services/session";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.location.new.tsx b/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.location.new.tsxindex 2b4c9b6157..b2d76804f2 100644--- a/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.location.new.tsx+++ b/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.location.new.tsx@@ -1,11 +1,11 @@import type { ActionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { validationError } from "remix-validated-form";-import { requirePermissions } from "~/services/auth";import {insertSupplierLocation,supplierLocationValidator,-} from "~/services/purchasing";+} from "~/modules/purchasing";+import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";import { assertIsPost, notFound } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.tsx b/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.tsxindex 021a812564..bb099c1cfb 100644--- a/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.tsx+++ b/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.tsx@@ -1,17 +1,16 @@import type { ActionArgs, LoaderArgs } from "@remix-run/node";-import { json } from "@remix-run/node";-import { redirect } from "@remix-run/node";+import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";import { validationError } from "remix-validated-form";-import { SupplierForm } from "~/interfaces/Purchasing/Suppliers";-import { requirePermissions } from "~/services/auth";import {+ SupplierForm,getSupplier,getSupplierContacts,getSupplierLocations,supplierValidator,updateSupplier,-} from "~/services/purchasing";+} from "~/modules/purchasing";+import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";import { assertIsPost, notFound } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/purchasing+/suppliers.new.tsx b/apps/carbon/app/routes/x+/purchasing+/suppliers.new.tsxindex 24f097baef..a24a9ef440 100644--- a/apps/carbon/app/routes/x+/purchasing+/suppliers.new.tsx+++ b/apps/carbon/app/routes/x+/purchasing+/suppliers.new.tsx@@ -1,9 +1,12 @@import type { ActionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { validationError } from "remix-validated-form";-import { SupplierForm } from "~/interfaces/Purchasing/Suppliers";+import {+ SupplierForm,+ insertSupplier,+ supplierValidator,+} from "~/modules/purchasing";import { requirePermissions } from "~/services/auth";-import { insertSupplier, supplierValidator } from "~/services/purchasing";import { flash } from "~/services/session";import { assertIsPost } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/purchasing+/suppliers.tsx b/apps/carbon/app/routes/x+/purchasing+/suppliers.tsxindex c33f489a5f..10cd218619 100644--- a/apps/carbon/app/routes/x+/purchasing+/suppliers.tsx+++ b/apps/carbon/app/routes/x+/purchasing+/suppliers.tsx@@ -6,13 +6,11 @@ import { Outlet, useLoaderData } from "@remix-run/react";import {SuppliersTable,SuppliersTableFilters,-} from "~/interfaces/Purchasing/Suppliers";-import { requirePermissions } from "~/services/auth";-import {getSuppliers,getSupplierStatuses,getSupplierTypes,-} from "~/services/purchasing";+} from "~/modules/purchasing";+import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";import { getGenericQueryFilters } from "~/utils/query";import { error } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/_layout.tsx b/apps/carbon/app/routes/x+/resources+/_layout.tsxindex 166aee42d5..b55fb47529 100644--- a/apps/carbon/app/routes/x+/resources+/_layout.tsx+++ b/apps/carbon/app/routes/x+/resources+/_layout.tsx@@ -2,7 +2,7 @@ import { Grid, VStack } from "@chakra-ui/react";import type { MetaFunction } from "@remix-run/node";import { Outlet } from "@remix-run/react";import { GroupedContentSidebar } from "~/components/Layout/Sidebar";-import { useResourcesSidebar } from "~/interfaces/Resources";+import { useResourcesSidebar } from "~/modules/resources";export const meta: MetaFunction = () => ({title: "Carbon | Resources",diff --git a/apps/carbon/app/routes/x+/resources+/abilities.delete.$abilityId.tsx b/apps/carbon/app/routes/x+/resources+/abilities.delete.$abilityId.tsxindex 3497c6eebd..076787c2d3 100644--- a/apps/carbon/app/routes/x+/resources+/abilities.delete.$abilityId.tsx+++ b/apps/carbon/app/routes/x+/resources+/abilities.delete.$abilityId.tsx@@ -2,8 +2,8 @@ import type { ActionArgs, LoaderArgs } 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 { deleteAbility, getAbility } from "~/modules/resources";import { requirePermissions } from "~/services/auth";-import { deleteAbility, getAbility } from "~/services/resources";import { flash } from "~/services/session";import { error, success } from "~/utils/result";import { notFound } from "~/utils/http";diff --git a/apps/carbon/app/routes/x+/resources+/abilities.new.tsx b/apps/carbon/app/routes/x+/resources+/abilities.new.tsxindex 6609b32ed7..d407112a35 100644--- a/apps/carbon/app/routes/x+/resources+/abilities.new.tsx+++ b/apps/carbon/app/routes/x+/resources+/abilities.new.tsx@@ -2,17 +2,17 @@ import type { ActionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { json } from "@remix-run/node";import { validationError } from "remix-validated-form";-import { AbilityForm } from "~/interfaces/Resources/Abilities";-import { assertIsPost } from "~/utils/http";-import { error, success } from "~/utils/result";-import { requirePermissions } from "~/services/auth";-import { flash } from "~/services/session";import {+ AbilityForm,abilityValidator,deleteAbility,insertAbility,insertEmployeeAbilities,-} from "~/services/resources";+} from "~/modules/resources";+import { requirePermissions } from "~/services/auth";+import { flash } from "~/services/session";+import { assertIsPost } from "~/utils/http";+import { error, success } from "~/utils/result";function makeCurve(startingPoint: number, weeks: number) {return {diff --git a/apps/carbon/app/routes/x+/resources+/abilities.tsx b/apps/carbon/app/routes/x+/resources+/abilities.tsxindex 9268afdb6b..b09507bfff 100644--- a/apps/carbon/app/routes/x+/resources+/abilities.tsx+++ b/apps/carbon/app/routes/x+/resources+/abilities.tsx@@ -1,15 +1,14 @@import { VStack } from "@chakra-ui/react";import type { LoaderArgs } from "@remix-run/node";-import { redirect } from "@remix-run/node";-import { json } from "@remix-run/node";+import { json, redirect } from "@remix-run/node";import { Outlet, useLoaderData } from "@remix-run/react";import {AbilitiesTable,AbilitiesTableFilters,-} from "~/interfaces/Resources/Abilities";+ getAbilities,+} from "~/modules/resources";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";-import { getAbilities } from "~/services/resources";import { getGenericQueryFilters } from "~/utils/query";import { error } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/ability.$abilityId.employee.$id.tsx b/apps/carbon/app/routes/x+/resources+/ability.$abilityId.employee.$id.tsxindex c9490cdad9..0dc90541b3 100644--- a/apps/carbon/app/routes/x+/resources+/ability.$abilityId.employee.$id.tsx+++ b/apps/carbon/app/routes/x+/resources+/ability.$abilityId.employee.$id.tsx@@ -3,16 +3,16 @@ import { redirect } from "@remix-run/node";import { useLoaderData, useNavigate, useParams } from "@remix-run/react";import { validationError } from "remix-validated-form";import { useRouteData } from "~/hooks";-import { EmployeeAbilityForm } from "~/interfaces/Resources/Abilities";-import type { Ability } from "~/interfaces/Resources/types";-import { getTrainingStatus } from "~/interfaces/Resources/types";-import { AbilityEmployeeStatus } from "~/interfaces/Resources/types";-import { requirePermissions } from "~/services/auth";+import { EmployeeAbilityForm } from "~/modules/resources/interfaces/Abilities";+import type { Ability } from "~/modules/resources";import {+ AbilityEmployeeStatus,employeeAbilityValidator,getEmployeeAbility,+ getTrainingStatus,upsertEmployeeAbility,-} from "~/services/resources";+} from "~/modules/resources";+import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";import { error, success } from "~/utils/result";@@ -104,9 +104,10 @@ export default function EmployeeAbilityRoute() {if (Array.isArray(employeeAbility?.user)) {throw new Error("employeeAbility.user is an array");}+const initialValues = {- employeeId: employeeAbility?.user?.id,- trainingStatus: getTrainingStatus(employeeAbility),+ employeeId: employeeAbility?.user?.id ?? "",+ trainingStatus: getTrainingStatus(employeeAbility) ?? "",trainingPercent: getTrainingPercent(employeeAbility?.trainingDays,routeData?.weeksdiff --git a/apps/carbon/app/routes/x+/resources+/ability.$abilityId.employee.delete.$id.tsx b/apps/carbon/app/routes/x+/resources+/ability.$abilityId.employee.delete.$id.tsxindex 789708fb4b..1901ce56ba 100644--- a/apps/carbon/app/routes/x+/resources+/ability.$abilityId.employee.delete.$id.tsx+++ b/apps/carbon/app/routes/x+/resources+/ability.$abilityId.employee.delete.$id.tsx@@ -3,9 +3,9 @@ import { redirect } from "@remix-run/node";import { useNavigate, useParams } from "@remix-run/react";import { ConfirmDelete } from "~/components/Modals";import { useRouteData } from "~/hooks";-import type { Ability } from "~/interfaces/Resources/types";+import type { Ability } from "~/modules/resources";+import { deleteEmployeeAbility } from "~/modules/resources";import { requirePermissions } from "~/services/auth";-import { deleteEmployeeAbility } from "~/services/resources";import { flash } from "~/services/session";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/ability.$abilityId.employee.new.tsx b/apps/carbon/app/routes/x+/resources+/ability.$abilityId.employee.new.tsxindex 284457b607..023b4638f7 100644--- a/apps/carbon/app/routes/x+/resources+/ability.$abilityId.employee.new.tsx+++ b/apps/carbon/app/routes/x+/resources+/ability.$abilityId.employee.new.tsx@@ -3,14 +3,14 @@ import { redirect } from "@remix-run/node";import { useNavigate, useParams } from "@remix-run/react";import { validationError } from "remix-validated-form";import { useRouteData } from "~/hooks";-import { EmployeeAbilityForm } from "~/interfaces/Resources/Abilities";-import type { Ability } from "~/interfaces/Resources/types";-import { AbilityEmployeeStatus } from "~/interfaces/Resources/types";+import { EmployeeAbilityForm } from "~/modules/resources/interfaces/Abilities";+import type { Ability } from "~/modules/resources";+import { AbilityEmployeeStatus } from "~/modules/resources";import { requirePermissions } from "~/services/auth";import {employeeAbilityValidator,upsertEmployeeAbility,-} from "~/services/resources";+} from "~/modules/resources";import { flash } from "~/services/session";import { error, success } from "~/utils/result";@@ -74,6 +74,7 @@ export default function NewEmployeeAbilityRoute() {return (<EmployeeAbilityForminitialValues={{+ // @ts-expect-erroremployeeId: undefined,}}ability={abilitiesRouteData?.ability}diff --git a/apps/carbon/app/routes/x+/resources+/ability.$abilityId.tsx b/apps/carbon/app/routes/x+/resources+/ability.$abilityId.tsxindex 1acea622c3..77ebc73fd5 100644--- a/apps/carbon/app/routes/x+/resources+/ability.$abilityId.tsx+++ b/apps/carbon/app/routes/x+/resources+/ability.$abilityId.tsx@@ -26,15 +26,13 @@ import { Hidden, Input, Submit } from "~/components/Form";import {AbilityChart,AbilityEmployeesTable,-} from "~/interfaces/Resources/Abilities";-import type { AbilityDatum } from "~/interfaces/Resources/types";-import { requirePermissions } from "~/services/auth";-import {+ abilityCurveValidator,abilityNameValidator,getAbility,updateAbility,- abilityCurveValidator,-} from "~/services/resources";+} from "~/modules/resources";+import type { AbilityDatum } from "~/modules/resources";+import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/attribute.$attributeId.tsx b/apps/carbon/app/routes/x+/resources+/attribute.$attributeId.tsxindex 30a9af486b..ee1449684d 100644--- a/apps/carbon/app/routes/x+/resources+/attribute.$attributeId.tsx+++ b/apps/carbon/app/routes/x+/resources+/attribute.$attributeId.tsx@@ -1,8 +1,8 @@import type { ActionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { validationError } from "remix-validated-form";+import { attributeValidator, updateAttribute } from "~/modules/resources";import { requirePermissions } from "~/services/auth";-import { attributeValidator, updateAttribute } from "~/services/resources";import { flash } from "~/services/session";import { assertIsPost } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/attribute.delete.$attributeId.tsx b/apps/carbon/app/routes/x+/resources+/attribute.delete.$attributeId.tsxindex ef6a2571d5..bdb3121336 100644--- a/apps/carbon/app/routes/x+/resources+/attribute.delete.$attributeId.tsx+++ b/apps/carbon/app/routes/x+/resources+/attribute.delete.$attributeId.tsx@@ -1,7 +1,7 @@import type { LoaderArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";+import { deleteAttribute } from "~/modules/resources";import { requirePermissions } from "~/services/auth";-import { deleteAttribute } from "~/services/resources";import { flash } from "~/services/session";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/attribute.new.tsx b/apps/carbon/app/routes/x+/resources+/attribute.new.tsxindex e26cd17f04..38a15ae123 100644--- a/apps/carbon/app/routes/x+/resources+/attribute.new.tsx+++ b/apps/carbon/app/routes/x+/resources+/attribute.new.tsx@@ -2,9 +2,9 @@ import type { ActionArgs } from "@remix-run/node";import { json } from "@remix-run/node";import { redirect } from "@remix-run/node";import { validationError } from "remix-validated-form";+import { attributeValidator, insertAttribute } from "~/modules/resources";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";-import { attributeValidator, insertAttribute } from "~/services/resources";import { assertIsPost } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/attributes.$categoryId.tsx b/apps/carbon/app/routes/x+/resources+/attributes.$categoryId.tsxindex 07394daa8d..63de8c1de5 100644--- a/apps/carbon/app/routes/x+/resources+/attributes.$categoryId.tsx+++ b/apps/carbon/app/routes/x+/resources+/attributes.$categoryId.tsx@@ -2,14 +2,14 @@ import type { ActionArgs, LoaderArgs } from "@remix-run/node";import { redirect, json } from "@remix-run/node";import { useLoaderData, useNavigate } from "@remix-run/react";import { validationError } from "remix-validated-form";-import { AttributeCategoryForm } from "~/interfaces/Resources/Attributes";-import { requirePermissions } from "~/services/auth";-import { flash } from "~/services/session";import {+ AttributeCategoryForm,attributeCategoryValidator,getAttributeCategory,updateAttributeCategory,-} from "~/services/resources";+} from "~/modules/resources";+import { requirePermissions } from "~/services/auth";+import { flash } from "~/services/session";import { assertIsPost, notFound } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/attributes.delete.$categoryId.tsx b/apps/carbon/app/routes/x+/resources+/attributes.delete.$categoryId.tsxindex 3adb079dca..123ebcf1a9 100644--- a/apps/carbon/app/routes/x+/resources+/attributes.delete.$categoryId.tsx+++ b/apps/carbon/app/routes/x+/resources+/attributes.delete.$categoryId.tsx@@ -1,7 +1,7 @@import type { LoaderArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";+import { deleteAttributeCategory } from "~/modules/resources";import { requirePermissions } from "~/services/auth";-import { deleteAttributeCategory } from "~/services/resources";import { flash } from "~/services/session";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/attributes.list.$categoryId.$attributeId.tsx b/apps/carbon/app/routes/x+/resources+/attributes.list.$categoryId.$attributeId.tsxindex 3eb993b964..4dc3931a6e 100644--- a/apps/carbon/app/routes/x+/resources+/attributes.list.$categoryId.$attributeId.tsx+++ b/apps/carbon/app/routes/x+/resources+/attributes.list.$categoryId.$attributeId.tsx@@ -3,10 +3,9 @@ import { redirect } from "@remix-run/node";import { json } from "@remix-run/node";import { useLoaderData, useNavigate, useParams } from "@remix-run/react";import { useRouteData } from "~/hooks";-import { AttributeForm } from "~/interfaces/Resources/Attributes";-import type { AttributeDataType } from "~/interfaces/Resources/types";+import { AttributeForm, getAttribute } from "~/modules/resources";+import type { AttributeDataType } from "~/modules/resources";import { requirePermissions } from "~/services/auth";-import { getAttribute } from "~/services/resources";import { flash } from "~/services/session";import { notFound } from "~/utils/http";import { error } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/attributes.list.$categoryId.new.tsx b/apps/carbon/app/routes/x+/resources+/attributes.list.$categoryId.new.tsxindex 41a0da11b1..3a81846188 100644--- a/apps/carbon/app/routes/x+/resources+/attributes.list.$categoryId.new.tsx+++ b/apps/carbon/app/routes/x+/resources+/attributes.list.$categoryId.new.tsx@@ -1,7 +1,8 @@import { useNavigate, useParams } from "@remix-run/react";import { useRouteData } from "~/hooks";-import { AttributeForm } from "~/interfaces/Resources/Attributes";-import type { AttributeDataType } from "~/interfaces/Resources/types";+import { AttributeForm } from "~/modules/resources";+import type { AttributeDataType } from "~/modules/resources";+import { DataType } from "~/modules/users";export default function NewAttributeRoute() {const { categoryId } = useParams();@@ -17,7 +18,7 @@ export default function NewAttributeRoute() {<AttributeForminitialValues={{name: "",- attributeDataTypeId: undefined,+ attributeDataTypeId: DataType.Text,userAttributeCategoryId: categoryId,canSelfManage: true,}}diff --git a/apps/carbon/app/routes/x+/resources+/attributes.list.$categoryId.tsx b/apps/carbon/app/routes/x+/resources+/attributes.list.$categoryId.tsxindex 85f002ff26..4a8232adba 100644--- a/apps/carbon/app/routes/x+/resources+/attributes.list.$categoryId.tsx+++ b/apps/carbon/app/routes/x+/resources+/attributes.list.$categoryId.tsx@@ -2,13 +2,13 @@ import type { ActionArgs, LoaderArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { Outlet, useLoaderData, useNavigate } from "@remix-run/react";import { useUrlParams } from "~/hooks";-import { AttributeCategoryDetail } from "~/interfaces/Resources/Attributes";-import { requirePermissions } from "~/services/auth";-import { flash } from "~/services/session";import {+ AttributeCategoryDetail,getAttributeCategory,updateAttributeSortOrder,-} from "~/services/resources";+} from "~/modules/resources";+import { requirePermissions } from "~/services/auth";+import { flash } from "~/services/session";import { assertIsPost, notFound } from "~/utils/http";import { error } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/attributes.new.tsx b/apps/carbon/app/routes/x+/resources+/attributes.new.tsxindex 1c4d21d323..f420dc438e 100644--- a/apps/carbon/app/routes/x+/resources+/attributes.new.tsx+++ b/apps/carbon/app/routes/x+/resources+/attributes.new.tsx@@ -2,13 +2,13 @@ import type { ActionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { useNavigate } from "@remix-run/react";import { validationError } from "remix-validated-form";-import { AttributeCategoryForm } from "~/interfaces/Resources/Attributes";-import { requirePermissions } from "~/services/auth";-import { flash } from "~/services/session";import {+ AttributeCategoryForm,attributeCategoryValidator,insertAttributeCategory,-} from "~/services/resources";+} from "~/modules/resources";+import { requirePermissions } from "~/services/auth";+import { flash } from "~/services/session";import { assertIsPost } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/attributes.tsx b/apps/carbon/app/routes/x+/resources+/attributes.tsxindex 347afce8c5..a93c4addfd 100644--- a/apps/carbon/app/routes/x+/resources+/attributes.tsx+++ b/apps/carbon/app/routes/x+/resources+/attributes.tsx@@ -1,17 +1,14 @@import { VStack } from "@chakra-ui/react";import type { LoaderArgs } from "@remix-run/node";-import { redirect } from "@remix-run/node";-import { json } from "@remix-run/node";+import { json, redirect } from "@remix-run/node";import { Outlet, useLoaderData } from "@remix-run/react";+import { requirePermissions } from "~/services/auth";import {AttributeCategoriesTable,AttributeCategoriesTableFilters,-} from "~/interfaces/Resources/Attributes";-import { requirePermissions } from "~/services/auth";-import {getAttributeCategories,getAttributeDataTypes,-} from "~/services/resources";+} from "~/modules/resources";import { flash } from "~/services/session";import { getGenericQueryFilters } from "~/utils/query";import { error } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/departments.$departmentId.tsx b/apps/carbon/app/routes/x+/resources+/departments.$departmentId.tsxindex 22ca10ce61..7c5e45c36a 100644--- a/apps/carbon/app/routes/x+/resources+/departments.$departmentId.tsx+++ b/apps/carbon/app/routes/x+/resources+/departments.$departmentId.tsx@@ -3,14 +3,14 @@ import { json } from "@remix-run/node";import { redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";import { validationError } from "remix-validated-form";-import { DepartmentForm } from "~/interfaces/Resources/Departments";-import { requirePermissions } from "~/services/auth";-import { flash } from "~/services/session";import {- getDepartment,+ DepartmentForm,departmentValidator,+ getDepartment,upsertDepartment,-} from "~/services/resources";+} from "~/modules/resources";+import { requirePermissions } from "~/services/auth";+import { flash } from "~/services/session";import { assertIsPost, notFound } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/departments.delete.$departmentId.tsx b/apps/carbon/app/routes/x+/resources+/departments.delete.$departmentId.tsxindex 31d7fc5abc..1183599029 100644--- a/apps/carbon/app/routes/x+/resources+/departments.delete.$departmentId.tsx+++ b/apps/carbon/app/routes/x+/resources+/departments.delete.$departmentId.tsx@@ -2,8 +2,8 @@ import type { ActionArgs, LoaderArgs } 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 { deleteDepartment, getDepartment } from "~/modules/resources";import { requirePermissions } from "~/services/auth";-import { deleteDepartment, getDepartment } from "~/services/resources";import { flash } from "~/services/session";import { error, success } from "~/utils/result";import { notFound } from "~/utils/http";diff --git a/apps/carbon/app/routes/x+/resources+/departments.new.tsx b/apps/carbon/app/routes/x+/resources+/departments.new.tsxindex 74ba79f6a4..1b99b06dc4 100644--- a/apps/carbon/app/routes/x+/resources+/departments.new.tsx+++ b/apps/carbon/app/routes/x+/resources+/departments.new.tsx@@ -1,9 +1,12 @@import type { ActionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { validationError } from "remix-validated-form";-import { DepartmentForm } from "~/interfaces/Resources/Departments";+import {+ DepartmentForm,+ departmentValidator,+ upsertDepartment,+} from "~/modules/resources";import { requirePermissions } from "~/services/auth";-import { departmentValidator, upsertDepartment } from "~/services/resources";import { flash } from "~/services/session";import { assertIsPost } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/departments.tsx b/apps/carbon/app/routes/x+/resources+/departments.tsxindex 03a53553b0..c109d5bc3c 100644--- a/apps/carbon/app/routes/x+/resources+/departments.tsx+++ b/apps/carbon/app/routes/x+/resources+/departments.tsx@@ -6,10 +6,10 @@ import { Outlet, useLoaderData } from "@remix-run/react";import {DepartmentsTable,DepartmentsTableFilters,-} from "~/interfaces/Resources/Departments";+ getDepartments,+} from "~/modules/resources";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";-import { getDepartments } from "~/services/resources";import { getGenericQueryFilters } from "~/utils/query";import { error } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/equipment.$typeId.tsx b/apps/carbon/app/routes/x+/resources+/equipment.$typeId.tsxindex 96ce346b0d..fe6dd535d2 100644--- a/apps/carbon/app/routes/x+/resources+/equipment.$typeId.tsx+++ b/apps/carbon/app/routes/x+/resources+/equipment.$typeId.tsx@@ -2,14 +2,14 @@ import type { ActionArgs, LoaderArgs } from "@remix-run/node";import { redirect, json } from "@remix-run/node";import { useLoaderData, useNavigate } from "@remix-run/react";import { validationError } from "remix-validated-form";-import { EquipmentTypeForm } from "~/interfaces/Resources/Equipment";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";import {+ EquipmentTypeForm,equipmentTypeValidator,getEquipmentType,upsertEquipmentType,-} from "~/services/resources";+} from "~/modules/resources";import { assertIsPost, notFound } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/equipment.delete.$typeId.tsx b/apps/carbon/app/routes/x+/resources+/equipment.delete.$typeId.tsxindex 2483aa48cd..c21c53ca2b 100644--- a/apps/carbon/app/routes/x+/resources+/equipment.delete.$typeId.tsx+++ b/apps/carbon/app/routes/x+/resources+/equipment.delete.$typeId.tsx@@ -1,7 +1,7 @@import type { LoaderArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";+import { deleteEquipmentType } from "~/modules/resources";import { requirePermissions } from "~/services/auth";-import { deleteEquipmentType } from "~/services/resources";import { flash } from "~/services/session";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/equipment.list.$typeId.$equipmentId.tsx b/apps/carbon/app/routes/x+/resources+/equipment.list.$typeId.$equipmentId.tsxindex 8dff2a602b..e3cfd6c81e 100644--- a/apps/carbon/app/routes/x+/resources+/equipment.list.$typeId.$equipmentId.tsx+++ b/apps/carbon/app/routes/x+/resources+/equipment.list.$typeId.$equipmentId.tsx@@ -3,10 +3,9 @@ import { redirect } from "@remix-run/node";import { json } from "@remix-run/node";import { useLoaderData, useNavigate, useParams } from "@remix-run/react";import { useRouteData } from "~/hooks";-import { EquipmentForm } from "~/interfaces/Resources/Equipment";-import type { EquipmentType } from "~/interfaces/Resources/types";+import type { EquipmentType } from "~/modules/resources";+import { EquipmentForm, getEquipment } from "~/modules/resources";import { requirePermissions } from "~/services/auth";-import { getEquipment } from "~/services/resources";import { flash } from "~/services/session";import { notFound } from "~/utils/http";import { error } from "~/utils/result";@@ -47,6 +46,7 @@ export default function EditEquipmentRoute() {!equipment ||!typeId ||Array.isArray(equipment.equipmentType) ||+ Array.isArray(equipment.location) ||Array.isArray(equipment.workCell)) {return null;@@ -58,6 +58,7 @@ export default function EditEquipmentRoute() {id: equipment?.id,name: equipment?.name ?? "",description: equipment?.description ?? "",+ locationId: equipment?.location?.id ?? "",equipmentTypeId: equipment?.equipmentType?.id ?? typeId,operatorsRequired: equipment?.operatorsRequired ?? 1,setupHours: equipment?.setupHours ?? 0,diff --git a/apps/carbon/app/routes/x+/resources+/equipment.list.$typeId.new.tsx b/apps/carbon/app/routes/x+/resources+/equipment.list.$typeId.new.tsxindex 210733f1db..d1561dd7e3 100644--- a/apps/carbon/app/routes/x+/resources+/equipment.list.$typeId.new.tsx+++ b/apps/carbon/app/routes/x+/resources+/equipment.list.$typeId.new.tsx@@ -1,7 +1,7 @@import { useNavigate, useParams } from "@remix-run/react";import { useRouteData } from "~/hooks";-import { EquipmentForm } from "~/interfaces/Resources/Equipment";-import type { EquipmentType } from "~/interfaces/Resources/types";+import { EquipmentForm } from "~/modules/resources";+import type { EquipmentType } from "~/modules/resources";export default function NewEquipmentRoute() {const { typeId } = useParams();diff --git a/apps/carbon/app/routes/x+/resources+/equipment.list.$typeId.tsx b/apps/carbon/app/routes/x+/resources+/equipment.list.$typeId.tsxindex 615754c40e..a2e4eb5f7a 100644--- a/apps/carbon/app/routes/x+/resources+/equipment.list.$typeId.tsx+++ b/apps/carbon/app/routes/x+/resources+/equipment.list.$typeId.tsx@@ -2,10 +2,9 @@ import type { LoaderArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { Outlet, useLoaderData, useNavigate } from "@remix-run/react";import { useUrlParams } from "~/hooks";-import { EquipmentTypeDetail } from "~/interfaces/Resources/Equipment";+import { EquipmentTypeDetail, getEquipmentType } from "~/modules/resources";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";-import { getEquipmentType } from "~/services/resources";import { notFound } from "~/utils/http";import { error } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/equipment.new.tsx b/apps/carbon/app/routes/x+/resources+/equipment.new.tsxindex 944f856d4d..dd93fd7f77 100644--- a/apps/carbon/app/routes/x+/resources+/equipment.new.tsx+++ b/apps/carbon/app/routes/x+/resources+/equipment.new.tsx@@ -2,13 +2,13 @@ import type { ActionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { useNavigate } from "@remix-run/react";import { validationError } from "remix-validated-form";-import { EquipmentTypeForm } from "~/interfaces/Resources/Equipment";import { requirePermissions } from "~/services/auth";-import { flash } from "~/services/session";import {+ EquipmentTypeForm,equipmentTypeValidator,upsertEquipmentType,-} from "~/services/resources";+} from "~/modules/resources";+import { flash } from "~/services/session";import { assertIsPost } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/equipment.tsx b/apps/carbon/app/routes/x+/resources+/equipment.tsxindex 86b4360d09..640403be36 100644--- a/apps/carbon/app/routes/x+/resources+/equipment.tsx+++ b/apps/carbon/app/routes/x+/resources+/equipment.tsx@@ -6,9 +6,9 @@ import { Outlet, useLoaderData } from "@remix-run/react";import {EquipmentTypesTable,EquipmentTypesTableFilters,-} from "~/interfaces/Resources/Equipment";+ getEquipmentTypes,+} from "~/modules/resources";import { requirePermissions } from "~/services/auth";-import { getEquipmentTypes } from "~/services/resources";import { flash } from "~/services/session";import { getGenericQueryFilters } from "~/utils/query";import { error } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/equipment.unit.$equipmentId.tsx b/apps/carbon/app/routes/x+/resources+/equipment.unit.$equipmentId.tsxindex fbd17caaf9..4933af9e1f 100644--- a/apps/carbon/app/routes/x+/resources+/equipment.unit.$equipmentId.tsx+++ b/apps/carbon/app/routes/x+/resources+/equipment.unit.$equipmentId.tsx@@ -1,8 +1,8 @@import type { ActionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { validationError } from "remix-validated-form";+import { equipmentValidator, upsertEquipment } from "~/modules/resources";import { requirePermissions } from "~/services/auth";-import { equipmentValidator, upsertEquipment } from "~/services/resources";import { flash } from "~/services/session";import { assertIsPost } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/equipment.unit.delete.$equipmentId.tsx b/apps/carbon/app/routes/x+/resources+/equipment.unit.delete.$equipmentId.tsxindex 9b1f38eed9..7dc81e629b 100644--- a/apps/carbon/app/routes/x+/resources+/equipment.unit.delete.$equipmentId.tsx+++ b/apps/carbon/app/routes/x+/resources+/equipment.unit.delete.$equipmentId.tsx@@ -3,8 +3,8 @@ import { json } from "@remix-run/node";import { redirect } from "@remix-run/node";import { useLoaderData, useNavigate, useParams } from "@remix-run/react";import { ConfirmDelete } from "~/components/Modals";+import { deleteEquipment, getEquipment } from "~/modules/resources";import { requirePermissions } from "~/services/auth";-import { deleteEquipment, getEquipment } from "~/services/resources";import { flash } from "~/services/session";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/equipment.unit.new.tsx b/apps/carbon/app/routes/x+/resources+/equipment.unit.new.tsxindex aa16cb1021..9c671a1f1c 100644--- a/apps/carbon/app/routes/x+/resources+/equipment.unit.new.tsx+++ b/apps/carbon/app/routes/x+/resources+/equipment.unit.new.tsx@@ -2,9 +2,9 @@ import type { ActionArgs } from "@remix-run/node";import { json } from "@remix-run/node";import { redirect } from "@remix-run/node";import { validationError } from "remix-validated-form";+import { equipmentValidator, upsertEquipment } from "~/modules/resources";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";-import { equipmentValidator, upsertEquipment } from "~/services/resources";import { assertIsPost } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/holidays.$holidayId.tsx b/apps/carbon/app/routes/x+/resources+/holidays.$holidayId.tsxindex d263cf1eec..091c10815d 100644--- a/apps/carbon/app/routes/x+/resources+/holidays.$holidayId.tsx+++ b/apps/carbon/app/routes/x+/resources+/holidays.$holidayId.tsx@@ -3,14 +3,14 @@ import { json } from "@remix-run/node";import { redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";import { validationError } from "remix-validated-form";-import { HolidayForm } from "~/interfaces/Resources/Holidays";-import { requirePermissions } from "~/services/auth";-import { flash } from "~/services/session";import {+ HolidayForm,getHoliday,holidayValidator,upsertHoliday,-} from "~/services/resources";+} from "~/modules/resources";+import { requirePermissions } from "~/services/auth";+import { flash } from "~/services/session";import { assertIsPost, notFound } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/holidays.delete.$holidayId.tsx b/apps/carbon/app/routes/x+/resources+/holidays.delete.$holidayId.tsxindex d0dce9a9a0..138cfdeab1 100644--- a/apps/carbon/app/routes/x+/resources+/holidays.delete.$holidayId.tsx+++ b/apps/carbon/app/routes/x+/resources+/holidays.delete.$holidayId.tsx@@ -2,8 +2,8 @@ import type { ActionArgs, LoaderArgs } 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 { deleteHoliday, getHoliday } from "~/modules/resources";import { requirePermissions } from "~/services/auth";-import { deleteHoliday, getHoliday } from "~/services/resources";import { flash } from "~/services/session";import { error, success } from "~/utils/result";import { notFound } from "~/utils/http";diff --git a/apps/carbon/app/routes/x+/resources+/holidays.new.tsx b/apps/carbon/app/routes/x+/resources+/holidays.new.tsxindex ad28c6d7e9..f52c50cb84 100644--- a/apps/carbon/app/routes/x+/resources+/holidays.new.tsx+++ b/apps/carbon/app/routes/x+/resources+/holidays.new.tsx@@ -1,9 +1,12 @@import type { ActionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { validationError } from "remix-validated-form";-import { HolidayForm } from "~/interfaces/Resources/Holidays";import { requirePermissions } from "~/services/auth";-import { holidayValidator, upsertHoliday } from "~/services/resources";+import {+ HolidayForm,+ holidayValidator,+ upsertHoliday,+} from "~/modules/resources";import { flash } from "~/services/session";import { assertIsPost } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/holidays.tsx b/apps/carbon/app/routes/x+/resources+/holidays.tsxindex 35b873e200..73f133dbc1 100644--- a/apps/carbon/app/routes/x+/resources+/holidays.tsx+++ b/apps/carbon/app/routes/x+/resources+/holidays.tsx@@ -6,10 +6,11 @@ import { Outlet, useLoaderData } from "@remix-run/react";import {HolidaysTable,HolidaysTableFilters,-} from "~/interfaces/Resources/Holidays";+ getHolidays,+ getHolidayYears,+} from "~/modules/resources";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";-import { getHolidays, getHolidayYears } from "~/services/resources";import { getGenericQueryFilters } from "~/utils/query";import { error } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/locations.$locationId.tsx b/apps/carbon/app/routes/x+/resources+/locations.$locationId.tsxindex 3546eceb88..08129fad82 100644--- a/apps/carbon/app/routes/x+/resources+/locations.$locationId.tsx+++ b/apps/carbon/app/routes/x+/resources+/locations.$locationId.tsx@@ -3,14 +3,14 @@ import { json } from "@remix-run/node";import { redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";import { validationError } from "remix-validated-form";-import { LocationForm } from "~/interfaces/Resources/Locations";-import { requirePermissions } from "~/services/auth";-import { flash } from "~/services/session";import {+ LocationForm,getLocation,locationValidator,upsertLocation,-} from "~/services/resources";+} from "~/modules/resources";+import { requirePermissions } from "~/services/auth";+import { flash } from "~/services/session";import { assertIsPost, notFound } from "~/utils/http";import { error, success } from "~/utils/result";import { getLocalTimeZone } from "@internationalized/date";diff --git a/apps/carbon/app/routes/x+/resources+/locations.delete.$locationId.tsx b/apps/carbon/app/routes/x+/resources+/locations.delete.$locationId.tsxindex ef18e865bd..51fd34457f 100644--- a/apps/carbon/app/routes/x+/resources+/locations.delete.$locationId.tsx+++ b/apps/carbon/app/routes/x+/resources+/locations.delete.$locationId.tsx@@ -2,8 +2,8 @@ import type { ActionArgs, LoaderArgs } 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 { deleteLocation, getLocation } from "~/modules/resources";import { requirePermissions } from "~/services/auth";-import { deleteLocation, getLocation } from "~/services/resources";import { flash } from "~/services/session";import { error, success } from "~/utils/result";import { notFound } from "~/utils/http";diff --git a/apps/carbon/app/routes/x+/resources+/locations.new.tsx b/apps/carbon/app/routes/x+/resources+/locations.new.tsxindex 9f4e0918bc..5472cfdf69 100644--- a/apps/carbon/app/routes/x+/resources+/locations.new.tsx+++ b/apps/carbon/app/routes/x+/resources+/locations.new.tsx@@ -2,9 +2,12 @@ import { getLocalTimeZone } from "@internationalized/date";import type { ActionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { validationError } from "remix-validated-form";-import { LocationForm } from "~/interfaces/Resources/Locations";+import {+ LocationForm,+ locationValidator,+ upsertLocation,+} from "~/modules/resources";import { requirePermissions } from "~/services/auth";-import { locationValidator, upsertLocation } from "~/services/resources";import { flash } from "~/services/session";import { assertIsPost } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/locations.tsx b/apps/carbon/app/routes/x+/resources+/locations.tsxindex 8cd5ab53ce..00f722fb11 100644--- a/apps/carbon/app/routes/x+/resources+/locations.tsx+++ b/apps/carbon/app/routes/x+/resources+/locations.tsx@@ -6,10 +6,10 @@ import { Outlet, useLoaderData } from "@remix-run/react";import {LocationsTable,LocationsTableFilters,-} from "~/interfaces/Resources/Locations";+ getLocations,+} from "~/modules/resources";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";-import { getLocations } from "~/services/resources";import { getGenericQueryFilters } from "~/utils/query";import { error } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/partners.$supplierId.tsx b/apps/carbon/app/routes/x+/resources+/partners.$supplierId.tsxnew file mode 100644index 0000000000..4c34d4be82--- /dev/null+++ b/apps/carbon/app/routes/x+/resources+/partners.$supplierId.tsx@@ -0,0 +1,85 @@+import type { ActionArgs, LoaderArgs } from "@remix-run/node";+import { json } from "@remix-run/node";+import { redirect } from "@remix-run/node";+import { useLoaderData } from "@remix-run/react";+import { validationError } from "remix-validated-form";+import {+ PartnerForm,+ partnerValidator,+ getPartner,+ upsertPartner,+} from "~/modules/resources";+import { requirePermissions } from "~/services/auth";+import { flash } from "~/services/session";+import { assertIsPost, notFound } from "~/utils/http";+import { error, success } from "~/utils/result";++export async function loader({ request, params }: LoaderArgs) {+ const { client } = await requirePermissions(request, {+ view: "resources",+ });++ const { supplierId } = params;+ if (!supplierId) throw notFound("Partner ID was not found");++ const partner = await getPartner(client, supplierId);++ if (partner.error) {+ return redirect(+ "/x/resources/partners",+ await flash(request, error(partner.error, "Failed to get partner"))+ );+ }++ return json({+ partner: partner.data,+ });+}++export async function action({ request }: ActionArgs) {+ assertIsPost(request);+ const { client, userId } = await requirePermissions(request, {+ create: "resources",+ });++ const validation = await partnerValidator.validate(await request.formData());++ if (validation.error) {+ return validationError(validation.error);+ }++ const { id, hoursPerWeek } = validation.data;+ if (!id) throw notFound("Partner ID was not found");++ const updatePartner = await upsertPartner(client, {+ id,+ hoursPerWeek,+ updatedBy: userId,+ });++ if (updatePartner.error) {+ return redirect(+ "/x/resources/partners",+ await flash(+ request,+ error(updatePartner.error, "Failed to create partner.")+ )+ );+ }++ return redirect(+ "/x/resources/partners",+ await flash(request, success("Partner updated."))+ );+}++export default function PartnerRoute() {+ const { partner } = useLoaderData<typeof loader>();++ const initialValues = {+ id: partner.id,+ hoursPerWeek: partner.hoursPerWeek,+ };++ return <PartnerForm initialValues={initialValues} />;+}diff --git a/apps/carbon/app/routes/x+/resources+/partners.delete.$supplierId.tsx b/apps/carbon/app/routes/x+/resources+/partners.delete.$supplierId.tsxnew file mode 100644index 0000000000..5bbb022d36--- /dev/null+++ b/apps/carbon/app/routes/x+/resources+/partners.delete.$supplierId.tsx@@ -0,0 +1,83 @@+import type { ActionArgs, LoaderArgs } 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 { deletePartner, getPartner } from "~/modules/resources";+import { requirePermissions } from "~/services/auth";+import { flash } from "~/services/session";+import { error, success } from "~/utils/result";+import { notFound } from "~/utils/http";++export async function loader({ request, params }: LoaderArgs) {+ const { client } = await requirePermissions(request, {+ view: "resources",+ role: "employee",+ });++ const { supplierId } = params;+ if (!supplierId) throw notFound("supplierId not found");++ const partner = await getPartner(client, supplierId);+ if (partner.error) {+ return redirect(+ "/x/resources/partners",+ await flash(request, error(partner.error, "Failed to get partner"))+ );+ }++ return json({+ partner: partner.data,+ });+}++export async function action({ request, params }: ActionArgs) {+ const { client } = await requirePermissions(request, {+ delete: "resources",+ });++ const { supplierId } = params;+ if (!supplierId) {+ return redirect(+ "/x/resources/partners",+ await flash(request, error(params, "Failed to get partner id"))+ );+ }++ const { error: deletePartnerError } = await deletePartner(client, supplierId);+ if (deletePartnerError) {+ return redirect(+ "/x/resources/partners",+ await flash(+ request,+ error(deletePartnerError, "Failed to delete partner")+ )+ );+ }++ return redirect(+ "/x/resources/partners",+ await flash(request, success("Successfully deleted partner"))+ );+}++export default function DeletePartnerRoute() {+ const { supplierId } = useParams();+ const { partner } = useLoaderData<typeof loader>();+ const navigate = useNavigate();++ if (!supplierId || !partner || !partner.supplier) return null;+ const name = Array.isArray(partner.supplier)+ ? partner.supplier[0].name+ : partner.supplier.name;++ const onCancel = () => navigate("/x/resources/partners");++ return (+ <ConfirmDelete+ action={`/x/resources/partners/delete/${supplierId}`}+ name={name}+ text={`Are you sure you want to delete the partner: ${name}? This cannot be undone.`}+ onCancel={onCancel}+ />+ );+}diff --git a/apps/carbon/app/routes/x+/resources+/partners.new.tsx b/apps/carbon/app/routes/x+/resources+/partners.new.tsxnew file mode 100644index 0000000000..dacc72d17f--- /dev/null+++ b/apps/carbon/app/routes/x+/resources+/partners.new.tsx@@ -0,0 +1,57 @@+import type { ActionArgs } from "@remix-run/node";+import { redirect } from "@remix-run/node";+import { validationError } from "remix-validated-form";+import {+ PartnerForm,+ partnerValidator,+ upsertPartner,+} from "~/modules/resources";+import { requirePermissions } from "~/services/auth";+import { flash } from "~/services/session";+import { assertIsPost } from "~/utils/http";+import { error, success } from "~/utils/result";++export async function action({ request }: ActionArgs) {+ assertIsPost(request);+ const { client, userId } = await requirePermissions(request, {+ create: "resources",+ });++ const validation = await partnerValidator.validate(await request.formData());++ if (validation.error) {+ return validationError(validation.error);+ }++ const { id, hoursPerWeek } = validation.data;++ const createPartner = await upsertPartner(client, {+ id,+ hoursPerWeek,+ createdBy: userId,+ });++ if (createPartner.error) {+ return redirect(+ "/x/resources/partners",+ await flash(+ request,+ error(createPartner.error, "Failed to create partner.")+ )+ );+ }++ return redirect(+ "/x/resources/partners",+ await flash(request, success("Partner created."))+ );+}++export default function NewPartnerRoute() {+ const initialValues = {+ id: "",+ hoursPerWeek: 0,+ };++ return <PartnerForm initialValues={initialValues} />;+}diff --git a/apps/carbon/app/routes/x+/resources+/partners.tsx b/apps/carbon/app/routes/x+/resources+/partners.tsxnew file mode 100644index 0000000000..26713723dd--- /dev/null+++ b/apps/carbon/app/routes/x+/resources+/partners.tsx@@ -0,0 +1,57 @@+import { VStack } from "@chakra-ui/react";+import type { LoaderArgs } from "@remix-run/node";+import { redirect } from "@remix-run/node";+import { json } from "@remix-run/node";+import { Outlet, useLoaderData } from "@remix-run/react";+import {+ PartnersTable,+ PartnersTableFilters,+ getPartners,+} from "~/modules/resources";+import { requirePermissions } from "~/services/auth";+import { flash } from "~/services/session";+import { getGenericQueryFilters } from "~/utils/query";+import { error } from "~/utils/result";++export async function loader({ request }: LoaderArgs) {+ const { client } = await requirePermissions(request, {+ view: "resources",+ role: "employee",+ });++ const url = new URL(request.url);+ const searchParams = new URLSearchParams(url.search);+ const name = searchParams.get("name");+ const { limit, offset, sorts } = getGenericQueryFilters(searchParams);++ const partners = await getPartners(client, {+ name,+ limit,+ offset,+ sorts,+ });++ if (partners.error) {+ return redirect(+ "/x/resources",+ await flash(request, error(partners.error, "Failed to load partners"))+ );+ }++ return json({+ partners: partners.data ?? [],+ count: partners.count ?? 0,+ });+}++export default function Route() {+ const { partners, count } = useLoaderData<typeof loader>();++ return (+ <VStack w="full" h="full" spacing={0}>+ <PartnersTableFilters />+ <PartnersTable data={partners} count={count} />+ <Outlet />+ </VStack>+ );+}diff --git a/apps/carbon/app/routes/x+/resources+/people.tsx b/apps/carbon/app/routes/x+/resources+/people.tsxindex 4482e0fdbc..14da49b619 100644--- a/apps/carbon/app/routes/x+/resources+/people.tsx+++ b/apps/carbon/app/routes/x+/resources+/people.tsx@@ -4,11 +4,15 @@ import { redirect } from "@remix-run/node";import { json } from "@remix-run/node";import { Outlet, useLoaderData } from "@remix-run/react";import { usePermissions } from "~/hooks";-import { PeopleTable, PeopleTableFilters } from "~/interfaces/Resources/People";+import {+ PeopleTable,+ PeopleTableFilters,+ getAttributeCategories,+ getPeople,+} from "~/modules/resources";import { requirePermissions } from "~/services/auth";-import { getAttributeCategories, getPeople } from "~/services/resources";import { flash } from "~/services/session";-import { getEmployeeTypes } from "~/services/users";+import { getEmployeeTypes } from "~/modules/users";import { getGenericQueryFilters } from "~/utils/query";import { error } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/person.$personId.notes.delete.$noteId.tsx b/apps/carbon/app/routes/x+/resources+/person.$personId.notes.delete.$noteId.tsxindex 92edbffd57..4bd874fd72 100644--- a/apps/carbon/app/routes/x+/resources+/person.$personId.notes.delete.$noteId.tsx+++ b/apps/carbon/app/routes/x+/resources+/person.$personId.notes.delete.$noteId.tsx@@ -1,7 +1,7 @@import type { LoaderArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";+import { deleteNote } from "~/modules/resources";import { requirePermissions } from "~/services/auth";-import { deleteNote } from "~/services/resources";import { flash } from "~/services/session";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/person.$personId.notes.new.tsx b/apps/carbon/app/routes/x+/resources+/person.$personId.notes.new.tsxindex a448dd7e0f..caba91c0da 100644--- a/apps/carbon/app/routes/x+/resources+/person.$personId.notes.new.tsx+++ b/apps/carbon/app/routes/x+/resources+/person.$personId.notes.new.tsx@@ -2,8 +2,8 @@ import type { ActionArgs } from "@remix-run/node";import { json } from "@remix-run/node";import { redirect } from "react-router";import { validationError } from "remix-validated-form";+import { insertNote, noteValidator } from "~/modules/resources";import { requirePermissions } from "~/services/auth";-import { insertNote, noteValidator } from "~/services/resources";import { flash } from "~/services/session";import { assertIsPost } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/person.$personId.tsx b/apps/carbon/app/routes/x+/resources+/person.$personId.tsxindex 76faff9978..c6c132174b 100644--- a/apps/carbon/app/routes/x+/resources+/person.$personId.tsx+++ b/apps/carbon/app/routes/x+/resources+/person.$personId.tsx@@ -4,30 +4,28 @@ import { json } from "@remix-run/node";import { redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";import { validationError } from "remix-validated-form";-import {- PersonAbilities,- PersonHeader,- PersonTabs,- PersonDaysOff,- PersonOvertime,-} from "~/interfaces/Resources/Person";-import type { EmployeeJob } from "~/interfaces/Resources/types";import logger from "~/lib/logger";+import type { EmployeeJob } from "~/modules/resources";import {accountProfileValidator,getAccount,getPrivateAttributes,getPublicAttributes,updatePublicAccount,-} from "~/services/account";-import { requirePermissions } from "~/services/auth";+} from "~/modules/account";import {+ PersonAbilities,+ PersonHeader,+ PersonTabs,+ PersonDaysOff,+ PersonOvertime,employeeJobValidator,getEmployeeAbilities,getEmployeeJob,getNotes,upsertEmployeeJob,-} from "~/services/resources";+} from "~/modules/resources";+import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";import { assertIsPost } from "~/utils/http";import { error, success } from "~/utils/result";@@ -128,10 +126,12 @@ export async function action({ request, params }: ActionArgs) {return validationError(validation.error);}- const { title, locationId, shiftId, managerId } = validation.data;+ const { title, startDate, locationId, shiftId, managerId } =+ validation.data;const updateJob = await upsertEmployeeJob(client, personId, {title: title ?? null,+ startDate: startDate ?? null,locationId: locationId ?? null,shiftId: shiftId ?? null,managerId: managerId ?? null,diff --git a/apps/carbon/app/routes/x+/resources+/shifts.$shiftId.tsx b/apps/carbon/app/routes/x+/resources+/shifts.$shiftId.tsxindex b92f54ab68..eb7dfe6cd8 100644--- a/apps/carbon/app/routes/x+/resources+/shifts.$shiftId.tsx+++ b/apps/carbon/app/routes/x+/resources+/shifts.$shiftId.tsx@@ -3,10 +3,14 @@ import { json } from "@remix-run/node";import { redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";import { validationError } from "remix-validated-form";-import { ShiftForm } from "~/interfaces/Resources/Shifts";+import {+ ShiftForm,+ getShift,+ shiftValidator,+ upsertShift,+} from "~/modules/resources";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";-import { getShift, shiftValidator, upsertShift } from "~/services/resources";import { assertIsPost, notFound } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/shifts.delete.$shiftId.tsx b/apps/carbon/app/routes/x+/resources+/shifts.delete.$shiftId.tsxindex 688c6a0655..6cacdd138d 100644--- a/apps/carbon/app/routes/x+/resources+/shifts.delete.$shiftId.tsx+++ b/apps/carbon/app/routes/x+/resources+/shifts.delete.$shiftId.tsx@@ -2,8 +2,8 @@ import type { ActionArgs, LoaderArgs } 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 { deleteShift, getShift } from "~/modules/resources";import { requirePermissions } from "~/services/auth";-import { deleteShift, getShift } from "~/services/resources";import { flash } from "~/services/session";import { error, success } from "~/utils/result";import { notFound } from "~/utils/http";diff --git a/apps/carbon/app/routes/x+/resources+/shifts.new.tsx b/apps/carbon/app/routes/x+/resources+/shifts.new.tsxindex 4e6c9bd82d..f6714697d9 100644--- a/apps/carbon/app/routes/x+/resources+/shifts.new.tsx+++ b/apps/carbon/app/routes/x+/resources+/shifts.new.tsx@@ -1,9 +1,8 @@import type { ActionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { validationError } from "remix-validated-form";-import { ShiftForm } from "~/interfaces/Resources/Shifts";+import { ShiftForm, shiftValidator, upsertShift } from "~/modules/resources";import { requirePermissions } from "~/services/auth";-import { shiftValidator, upsertShift } from "~/services/resources";import { flash } from "~/services/session";import { assertIsPost } from "~/utils/http";import { error, success } from "~/utils/result";@@ -48,6 +47,8 @@ export default function NewShiftRoute() {friday: true,saturday: false,sunday: false,+ startTime: "08:00",+ endTime: "17:00",};return <ShiftForm initialValues={initialValues} />;diff --git a/apps/carbon/app/routes/x+/resources+/shifts.tsx b/apps/carbon/app/routes/x+/resources+/shifts.tsxindex 977075a87b..5d8572dfef 100644--- a/apps/carbon/app/routes/x+/resources+/shifts.tsx+++ b/apps/carbon/app/routes/x+/resources+/shifts.tsx@@ -3,10 +3,14 @@ import type { LoaderArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { json } from "@remix-run/node";import { Outlet, useLoaderData } from "@remix-run/react";-import { ShiftsTable, ShiftsTableFilters } from "~/interfaces/Resources/Shifts";+import {+ ShiftsTable,+ ShiftsTableFilters,+ getLocations,+ getShifts,+} from "~/modules/resources";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";-import { getLocations, getShifts } from "~/services/resources";import { getGenericQueryFilters } from "~/utils/query";import { error } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/work-cells.$typeId.tsx b/apps/carbon/app/routes/x+/resources+/work-cells.$typeId.tsxindex ecda8f6f8b..4d8bb8b23c 100644--- a/apps/carbon/app/routes/x+/resources+/work-cells.$typeId.tsx+++ b/apps/carbon/app/routes/x+/resources+/work-cells.$typeId.tsx@@ -2,14 +2,14 @@ import type { ActionArgs, LoaderArgs } from "@remix-run/node";import { redirect, json } from "@remix-run/node";import { useLoaderData, useNavigate } from "@remix-run/react";import { validationError } from "remix-validated-form";-import { WorkCellTypeForm } from "~/interfaces/Resources/WorkCells";-import { requirePermissions } from "~/services/auth";-import { flash } from "~/services/session";import {+ WorkCellTypeForm,workCellTypeValidator,getWorkCellType,upsertWorkCellType,-} from "~/services/resources";+} from "~/modules/resources";+import { requirePermissions } from "~/services/auth";+import { flash } from "~/services/session";import { assertIsPost, notFound } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/work-cells.cell.$workCellId.tsx b/apps/carbon/app/routes/x+/resources+/work-cells.cell.$workCellId.tsxindex b7d94d8f86..3110a21e22 100644--- a/apps/carbon/app/routes/x+/resources+/work-cells.cell.$workCellId.tsx+++ b/apps/carbon/app/routes/x+/resources+/work-cells.cell.$workCellId.tsx@@ -1,8 +1,8 @@import type { ActionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { validationError } from "remix-validated-form";+import { workCellValidator, upsertWorkCell } from "~/modules/resources";import { requirePermissions } from "~/services/auth";-import { workCellValidator, upsertWorkCell } from "~/services/resources";import { flash } from "~/services/session";import { assertIsPost } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/work-cells.cell.delete.$workCellId.tsx b/apps/carbon/app/routes/x+/resources+/work-cells.cell.delete.$workCellId.tsxindex feac1a33f9..a7e837b366 100644--- a/apps/carbon/app/routes/x+/resources+/work-cells.cell.delete.$workCellId.tsx+++ b/apps/carbon/app/routes/x+/resources+/work-cells.cell.delete.$workCellId.tsx@@ -3,8 +3,8 @@ import { json } from "@remix-run/node";import { redirect } from "@remix-run/node";import { useLoaderData, useNavigate, useParams } from "@remix-run/react";import { ConfirmDelete } from "~/components/Modals";+import { deleteWorkCell, getWorkCell } from "~/modules/resources";import { requirePermissions } from "~/services/auth";-import { deleteWorkCell, getWorkCell } from "~/services/resources";import { flash } from "~/services/session";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/work-cells.cell.new.tsx b/apps/carbon/app/routes/x+/resources+/work-cells.cell.new.tsxindex 97f99244b4..1a96fc9194 100644--- a/apps/carbon/app/routes/x+/resources+/work-cells.cell.new.tsx+++ b/apps/carbon/app/routes/x+/resources+/work-cells.cell.new.tsx@@ -2,9 +2,9 @@ import type { ActionArgs } from "@remix-run/node";import { json } from "@remix-run/node";import { redirect } from "@remix-run/node";import { validationError } from "remix-validated-form";+import { workCellValidator, upsertWorkCell } from "~/modules/resources";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";-import { workCellValidator, upsertWorkCell } from "~/services/resources";import { assertIsPost } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/work-cells.delete.$typeId.tsx b/apps/carbon/app/routes/x+/resources+/work-cells.delete.$typeId.tsxindex 8dbc08a3f8..583f2ba17a 100644--- a/apps/carbon/app/routes/x+/resources+/work-cells.delete.$typeId.tsx+++ b/apps/carbon/app/routes/x+/resources+/work-cells.delete.$typeId.tsx@@ -1,7 +1,7 @@import type { LoaderArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";+import { deleteWorkCellType } from "~/modules/resources";import { requirePermissions } from "~/services/auth";-import { deleteWorkCellType } from "~/services/resources";import { flash } from "~/services/session";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/work-cells.list.$typeId.$workCellId.tsx b/apps/carbon/app/routes/x+/resources+/work-cells.list.$typeId.$workCellId.tsxindex f6b0948f4c..68d6f497e0 100644--- a/apps/carbon/app/routes/x+/resources+/work-cells.list.$typeId.$workCellId.tsx+++ b/apps/carbon/app/routes/x+/resources+/work-cells.list.$typeId.$workCellId.tsx@@ -3,10 +3,9 @@ import { redirect } from "@remix-run/node";import { json } from "@remix-run/node";import { useLoaderData, useNavigate, useParams } from "@remix-run/react";import { useRouteData } from "~/hooks";-import { WorkCellForm } from "~/interfaces/Resources/WorkCells";-import type { WorkCellType } from "~/interfaces/Resources/types";+import { WorkCellForm, getWorkCell } from "~/modules/resources";+import type { WorkCellType } from "~/modules/resources";import { requirePermissions } from "~/services/auth";-import { getWorkCell } from "~/services/resources";import { flash } from "~/services/session";import { notFound } from "~/utils/http";import { error } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/work-cells.list.$typeId.new.tsx b/apps/carbon/app/routes/x+/resources+/work-cells.list.$typeId.new.tsxindex 4bb42bda4f..54902440be 100644--- a/apps/carbon/app/routes/x+/resources+/work-cells.list.$typeId.new.tsx+++ b/apps/carbon/app/routes/x+/resources+/work-cells.list.$typeId.new.tsx@@ -1,7 +1,7 @@import { useNavigate, useParams } from "@remix-run/react";import { useRouteData } from "~/hooks";-import { WorkCellForm } from "~/interfaces/Resources/WorkCells";-import type { WorkCellType } from "~/interfaces/Resources/types";+import { WorkCellForm } from "~/modules/resources";+import type { WorkCellType } from "~/modules/resources";export default function NewWorkCellRoute() {const { typeId } = useParams();diff --git a/apps/carbon/app/routes/x+/resources+/work-cells.list.$typeId.tsx b/apps/carbon/app/routes/x+/resources+/work-cells.list.$typeId.tsxindex 5eb676c03d..2e6fa2ffb8 100644--- a/apps/carbon/app/routes/x+/resources+/work-cells.list.$typeId.tsx+++ b/apps/carbon/app/routes/x+/resources+/work-cells.list.$typeId.tsx@@ -2,10 +2,9 @@ import type { LoaderArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/node";import { Outlet, useLoaderData, useNavigate } from "@remix-run/react";import { useUrlParams } from "~/hooks";-import { WorkCellTypeDetail } from "~/interfaces/Resources/WorkCells";+import { WorkCellTypeDetail, getWorkCellType } from "~/modules/resources";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";-import { getWorkCellType } from "~/services/resources";import { notFound } from "~/utils/http";import { error } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/work-cells.new.tsx b/apps/carbon/app/routes/x+/resources+/work-cells.new.tsxindex 4afe845ced..ebaaf41786 100644--- a/apps/carbon/app/routes/x+/resources+/work-cells.new.tsx+++ b/apps/carbon/app/routes/x+/resources+/work-cells.new.tsx@@ -2,13 +2,13 @@ import type { ActionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { useNavigate } from "@remix-run/react";import { validationError } from "remix-validated-form";-import { WorkCellTypeForm } from "~/interfaces/Resources/WorkCells";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";import {+ WorkCellTypeForm,workCellTypeValidator,upsertWorkCellType,-} from "~/services/resources";+} from "~/modules/resources";import { assertIsPost } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/resources+/work-cells.tsx b/apps/carbon/app/routes/x+/resources+/work-cells.tsxindex f7ef761a6e..2131a8eb12 100644--- a/apps/carbon/app/routes/x+/resources+/work-cells.tsx+++ b/apps/carbon/app/routes/x+/resources+/work-cells.tsx@@ -1,14 +1,13 @@import { VStack } from "@chakra-ui/react";import type { LoaderArgs } from "@remix-run/node";-import { redirect } from "@remix-run/node";-import { json } from "@remix-run/node";+import { json, redirect } from "@remix-run/node";import { Outlet, useLoaderData } from "@remix-run/react";import {WorkCellTypesTable,WorkCellTypesTableFilters,-} from "~/interfaces/Resources/WorkCells";+ getWorkCellTypes,+} from "~/modules/resources";import { requirePermissions } from "~/services/auth";-import { getWorkCellTypes } from "~/services/resources";import { flash } from "~/services/session";import { getGenericQueryFilters } from "~/utils/query";import { error } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/sales+/_layout.tsx b/apps/carbon/app/routes/x+/sales+/_layout.tsxindex 1471b73239..3c4eff24ff 100644--- a/apps/carbon/app/routes/x+/sales+/_layout.tsx+++ b/apps/carbon/app/routes/x+/sales+/_layout.tsx@@ -2,7 +2,7 @@ import { Grid, VStack } from "@chakra-ui/react";import type { MetaFunction } from "@remix-run/node";import { Outlet } from "@remix-run/react";import { GroupedContentSidebar } from "~/components/Layout/Sidebar";-import { useSalesSidebar } from "~/interfaces/Sales";+import { useSalesSidebar } from "~/modules/sales";export const meta: MetaFunction = () => ({title: "Carbon | Sales",diff --git a/apps/carbon/app/routes/x+/sales+/customer-types.$customerTypeId.tsx b/apps/carbon/app/routes/x+/sales+/customer-types.$customerTypeId.tsxindex 63838a46e3..5c79495922 100644--- a/apps/carbon/app/routes/x+/sales+/customer-types.$customerTypeId.tsx+++ b/apps/carbon/app/routes/x+/sales+/customer-types.$customerTypeId.tsx@@ -3,13 +3,13 @@ import { redirect } from "@remix-run/node";import { json } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";import { validationError } from "remix-validated-form";-import { CustomerTypeForm } from "~/interfaces/Sales/CustomerTypes";+import { CustomerTypeForm } from "~/modules/sales";import { requirePermissions } from "~/services/auth";import {customerTypeValidator,getCustomerType,upsertCustomerType,-} from "~/services/sales";+} from "~/modules/sales";import { flash } from "~/services/session";import { assertIsPost, notFound } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/sales+/customer-types.delete.$customerTypeId.tsx b/apps/carbon/app/routes/x+/sales+/customer-types.delete.$customerTypeId.tsxindex 22165e99c1..ec6770140d 100644--- a/apps/carbon/app/routes/x+/sales+/customer-types.delete.$customerTypeId.tsx+++ b/apps/carbon/app/routes/x+/sales+/customer-types.delete.$customerTypeId.tsx@@ -2,8 +2,8 @@ import type { ActionArgs, LoaderArgs } 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 { deleteCustomerType, getCustomerType } from "~/modules/sales";import { requirePermissions } from "~/services/auth";-import { deleteCustomerType, getCustomerType } from "~/services/sales";import { flash } from "~/services/session";import { error, success } from "~/utils/result";import { notFound } from "~/utils/http";diff --git a/apps/carbon/app/routes/x+/sales+/customer-types.new.tsx b/apps/carbon/app/routes/x+/sales+/customer-types.new.tsxindex b34e225eef..8f5705a7fd 100644--- a/apps/carbon/app/routes/x+/sales+/customer-types.new.tsx+++ b/apps/carbon/app/routes/x+/sales+/customer-types.new.tsx@@ -2,9 +2,12 @@ import type { ActionArgs, LoaderArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { json } from "@remix-run/node";import { validationError } from "remix-validated-form";-import { CustomerTypeForm } from "~/interfaces/Sales/CustomerTypes";+import {+ CustomerTypeForm,+ customerTypeValidator,+ upsertCustomerType,+} from "~/modules/sales";import { requirePermissions } from "~/services/auth";-import { customerTypeValidator, upsertCustomerType } from "~/services/sales";import { flash } from "~/services/session";import { assertIsPost } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/sales+/customer-types.tsx b/apps/carbon/app/routes/x+/sales+/customer-types.tsxindex c674aff003..6ea4687c35 100644--- a/apps/carbon/app/routes/x+/sales+/customer-types.tsx+++ b/apps/carbon/app/routes/x+/sales+/customer-types.tsx@@ -5,9 +5,9 @@ import { Outlet, useLoaderData } from "@remix-run/react";import {CustomerTypesTable,CustomerTypesTableFilters,-} from "~/interfaces/Sales/CustomerTypes";+ getCustomerTypes,+} from "~/modules/sales";import { requirePermissions } from "~/services/auth";-import { getCustomerTypes } from "~/services/sales";import { getGenericQueryFilters } from "~/utils/query";export async function loader({ request }: LoaderArgs) {diff --git a/apps/carbon/app/routes/x+/sales+/customers.$customerId.contact.$customerContactId.tsx b/apps/carbon/app/routes/x+/sales+/customers.$customerId.contact.$customerContactId.tsxindex 8a850eb203..1c0d21a322 100644--- a/apps/carbon/app/routes/x+/sales+/customers.$customerId.contact.$customerContactId.tsx+++ b/apps/carbon/app/routes/x+/sales+/customers.$customerId.contact.$customerContactId.tsx@@ -1,11 +1,11 @@import type { ActionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { validationError } from "remix-validated-form";-import { requirePermissions } from "~/services/auth";import {updateCustomerContact,customerContactValidator,-} from "~/services/sales";+} from "~/modules/sales";+import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";import { assertIsPost, badRequest, notFound } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/sales+/customers.$customerId.contact.delete.$customerContactId.tsx b/apps/carbon/app/routes/x+/sales+/customers.$customerId.contact.delete.$customerContactId.tsxindex af2b616eef..c0a5d709ca 100644--- a/apps/carbon/app/routes/x+/sales+/customers.$customerId.contact.delete.$customerContactId.tsx+++ b/apps/carbon/app/routes/x+/sales+/customers.$customerId.contact.delete.$customerContactId.tsx@@ -1,7 +1,7 @@import type { ActionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";+import { deleteCustomerContact } from "~/modules/sales";import { requirePermissions } from "~/services/auth";-import { deleteCustomerContact } from "~/services/sales";import { flash } from "~/services/session";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/sales+/customers.$customerId.contact.new.tsx b/apps/carbon/app/routes/x+/sales+/customers.$customerId.contact.new.tsxindex 08c93069a1..5cf07a291f 100644--- a/apps/carbon/app/routes/x+/sales+/customers.$customerId.contact.new.tsx+++ b/apps/carbon/app/routes/x+/sales+/customers.$customerId.contact.new.tsx@@ -1,11 +1,11 @@import type { ActionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { validationError } from "remix-validated-form";-import { requirePermissions } from "~/services/auth";import {insertCustomerContact,customerContactValidator,-} from "~/services/sales";+} from "~/modules/sales";+import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";import { assertIsPost, notFound } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/sales+/customers.$customerId.location.$customerLocationId.tsx b/apps/carbon/app/routes/x+/sales+/customers.$customerId.location.$customerLocationId.tsxindex 578cb4ece1..99496a8395 100644--- a/apps/carbon/app/routes/x+/sales+/customers.$customerId.location.$customerLocationId.tsx+++ b/apps/carbon/app/routes/x+/sales+/customers.$customerId.location.$customerLocationId.tsx@@ -1,11 +1,11 @@import type { ActionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { validationError } from "remix-validated-form";-import { requirePermissions } from "~/services/auth";import {updateCustomerLocation,customerLocationValidator,-} from "~/services/sales";+} from "~/modules/sales";+import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";import { assertIsPost, badRequest, notFound } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/sales+/customers.$customerId.location.delete.$customerLocationId.tsx b/apps/carbon/app/routes/x+/sales+/customers.$customerId.location.delete.$customerLocationId.tsxindex 6143ce5aa9..c8634aca14 100644--- a/apps/carbon/app/routes/x+/sales+/customers.$customerId.location.delete.$customerLocationId.tsx+++ b/apps/carbon/app/routes/x+/sales+/customers.$customerId.location.delete.$customerLocationId.tsx@@ -1,7 +1,7 @@import type { ActionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";+import { deleteCustomerLocation } from "~/modules/sales";import { requirePermissions } from "~/services/auth";-import { deleteCustomerLocation } from "~/services/sales";import { flash } from "~/services/session";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/sales+/customers.$customerId.location.new.tsx b/apps/carbon/app/routes/x+/sales+/customers.$customerId.location.new.tsxindex ecf1e9c9f1..52a4a72447 100644--- a/apps/carbon/app/routes/x+/sales+/customers.$customerId.location.new.tsx+++ b/apps/carbon/app/routes/x+/sales+/customers.$customerId.location.new.tsx@@ -1,11 +1,11 @@import type { ActionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { validationError } from "remix-validated-form";-import { requirePermissions } from "~/services/auth";import {insertCustomerLocation,customerLocationValidator,-} from "~/services/sales";+} from "~/modules/sales";+import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";import { assertIsPost, notFound } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/sales+/customers.$customerId.tsx b/apps/carbon/app/routes/x+/sales+/customers.$customerId.tsxindex e1feef8a97..22b5c15c09 100644--- a/apps/carbon/app/routes/x+/sales+/customers.$customerId.tsx+++ b/apps/carbon/app/routes/x+/sales+/customers.$customerId.tsx@@ -1,17 +1,16 @@import type { ActionArgs, LoaderArgs } from "@remix-run/node";-import { json } from "@remix-run/node";-import { redirect } from "@remix-run/node";+import { json, redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";import { validationError } from "remix-validated-form";-import { CustomerForm } from "~/interfaces/Sales/Customers";-import { requirePermissions } from "~/services/auth";import {+ CustomerForm,getCustomer,getCustomerContacts,getCustomerLocations,customerValidator,updateCustomer,-} from "~/services/sales";+} from "~/modules/sales";+import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";import { assertIsPost, notFound } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/sales+/customers.new.tsx b/apps/carbon/app/routes/x+/sales+/customers.new.tsxindex 3f421eacd1..8fbbacb804 100644--- a/apps/carbon/app/routes/x+/sales+/customers.new.tsx+++ b/apps/carbon/app/routes/x+/sales+/customers.new.tsx@@ -1,9 +1,12 @@import type { ActionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { validationError } from "remix-validated-form";-import { CustomerForm } from "~/interfaces/Sales/Customers";+import {+ CustomerForm,+ insertCustomer,+ customerValidator,+} from "~/modules/sales";import { requirePermissions } from "~/services/auth";-import { insertCustomer, customerValidator } from "~/services/sales";import { flash } from "~/services/session";import { assertIsPost } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/sales+/customers.tsx b/apps/carbon/app/routes/x+/sales+/customers.tsxindex 9cd34f636c..09d5af7efe 100644--- a/apps/carbon/app/routes/x+/sales+/customers.tsx+++ b/apps/carbon/app/routes/x+/sales+/customers.tsx@@ -1,18 +1,15 @@import { VStack } from "@chakra-ui/react";import type { LoaderArgs } from "@remix-run/node";-import { redirect } from "@remix-run/node";-import { json } from "@remix-run/node";+import { json, redirect } from "@remix-run/node";import { Outlet, useLoaderData } from "@remix-run/react";import {CustomersTable,CustomersTableFilters,-} from "~/interfaces/Sales/Customers";-import { requirePermissions } from "~/services/auth";-import {getCustomers,getCustomerStatuses,getCustomerTypes,-} from "~/services/sales";+} from "~/modules/sales";+import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";import { getGenericQueryFilters } from "~/utils/query";import { error } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/users+/_layout.tsx b/apps/carbon/app/routes/x+/users+/_layout.tsxindex 105c0d230d..cf0b145b73 100644--- a/apps/carbon/app/routes/x+/users+/_layout.tsx+++ b/apps/carbon/app/routes/x+/users+/_layout.tsx@@ -2,7 +2,7 @@ import { Grid, VStack } from "@chakra-ui/react";import type { MetaFunction } from "@remix-run/node";import { Outlet } from "@remix-run/react";import { GroupedContentSidebar } from "~/components/Layout/Sidebar";-import { useUsersSidebar } from "~/interfaces/Users";+import { useUsersSidebar } from "~/modules/users";export const meta: MetaFunction = () => ({title: "Carbon | Users",diff --git a/apps/carbon/app/routes/x+/users+/bulk-edit-permissions.tsx b/apps/carbon/app/routes/x+/users+/bulk-edit-permissions.tsxindex 2037cf5e30..ab1f0a8914 100644--- a/apps/carbon/app/routes/x+/users+/bulk-edit-permissions.tsx+++ b/apps/carbon/app/routes/x+/users+/bulk-edit-permissions.tsx@@ -1,7 +1,7 @@import type { ActionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { validationError } from "remix-validated-form";-import type { Permission } from "~/interfaces/Users/types";+import type { Permission } from "~/modules/users";import type { BulkPermissionsQueueData } from "~/queues";import { bulkPermissionsQueue } from "~/queues";import { requirePermissions } from "~/services/auth";@@ -9,7 +9,7 @@ import { flash } from "~/services/session";import {bulkPermissionsValidator,userPermissionsValidator,-} from "~/services/users";+} from "~/modules/users";import { assertIsPost } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/users+/customers.new.tsx b/apps/carbon/app/routes/x+/users+/customers.new.tsxindex 69075be420..5094becc1a 100644--- a/apps/carbon/app/routes/x+/users+/customers.new.tsx+++ b/apps/carbon/app/routes/x+/users+/customers.new.tsx@@ -1,14 +1,14 @@import type { ActionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { validationError } from "remix-validated-form";-import { requirePermissions } from "~/services/auth";-import { flash } from "~/services/session";import {+ CreateCustomerModal,createCustomerAccount,createCustomerAccountValidator,-} from "~/services/users";+} from "~/modules/users";+import { requirePermissions } from "~/services/auth";+import { flash } from "~/services/session";import { assertIsPost } from "~/utils/http";-import { CreateCustomerModal } from "~/interfaces/Users/Customers";export async function action({ request }: ActionArgs) {assertIsPost(request);diff --git a/apps/carbon/app/routes/x+/users+/customers.tsx b/apps/carbon/app/routes/x+/users+/customers.tsxindex ddb3e631a6..04046fdc2a 100644--- a/apps/carbon/app/routes/x+/users+/customers.tsx+++ b/apps/carbon/app/routes/x+/users+/customers.tsx@@ -1,17 +1,16 @@import { VStack } from "@chakra-ui/react";import type { LoaderArgs } from "@remix-run/node";-import { redirect } from "@remix-run/node";-import { json } from "@remix-run/node";+import { json, redirect } from "@remix-run/node";import { Outlet, useLoaderData } from "@remix-run/react";import { usePermissions } from "~/hooks";+import { getCustomerTypes } from "~/modules/sales";import {CustomerAccountsTable,CustomerAccountsTableFilters,-} from "~/interfaces/Users/Customers";+ getCustomers,+} from "~/modules/users";import { requirePermissions } from "~/services/auth";-import { getCustomerTypes } from "~/services/sales";import { flash } from "~/services/session";-import { getCustomers } from "~/services/users";import { getGenericQueryFilters } from "~/utils/query";import { error } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/users+/deactivate.tsx b/apps/carbon/app/routes/x+/users+/deactivate.tsxindex 2d269bf4b6..4e3f1cf19c 100644--- a/apps/carbon/app/routes/x+/users+/deactivate.tsx+++ b/apps/carbon/app/routes/x+/users+/deactivate.tsx@@ -2,10 +2,10 @@ import type { ActionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { validationError } from "remix-validated-form";import type { DeactivateUserQueueData } from "~/queues";+import { deactivateUser, deactivateUsersValidator } from "~/modules/users";import { deactivateUsersQueue } from "~/queues";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";-import { deactivateUser, deactivateUsersValidator } from "~/services/users";import { safeRedirect } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/users+/employee-types.$employeeTypeId.tsx b/apps/carbon/app/routes/x+/users+/employee-types.$employeeTypeId.tsxindex 77faca736a..ccc6e1ed31 100644--- a/apps/carbon/app/routes/x+/users+/employee-types.$employeeTypeId.tsx+++ b/apps/carbon/app/routes/x+/users+/employee-types.$employeeTypeId.tsx@@ -3,17 +3,17 @@ import { redirect } from "@remix-run/node";import { json } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";import { validationError } from "remix-validated-form";-import { EmployeeTypeForm } from "~/interfaces/Users/EmployeeTypes";-import { requirePermissions } from "~/services/auth";import {+ EmployeeTypeForm,employeeTypeValidator,+ employeeTypePermissionsValidator,getEmployeeType,getPermissionsByEmployeeType,makePermissionsFromEmployeeType,- employeeTypePermissionsValidator,upsertEmployeeType,upsertEmployeeTypePermissions,-} from "~/services/users";+} from "~/modules/users";+import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";import { assertIsPost, notFound } from "~/utils/http";import { error, success } from "~/utils/result";@@ -62,6 +62,7 @@ export async function action({ request }: ActionArgs) {}const { id, name, color, data } = validation.data;+ if (!id) throw notFound("id not found");const permissions = JSON.parse(data);const jsonValidation =@@ -79,7 +80,7 @@ export async function action({ request }: ActionArgs) {const updateEmployeeType = await upsertEmployeeType(client, {id,name,- color: color || null,+ color: color ?? undefined,});if (updateEmployeeType.error) {@@ -128,5 +129,10 @@ export default function EditEmployeeTypesRoute() {permissions: employeeTypePermissions,};- return <EmployeeTypeForm initialValues={initialValues} />;+ return (+ <EmployeeTypeForm+ // @ts-expect-error+ initialValues={initialValues}+ />+ );}diff --git a/apps/carbon/app/routes/x+/users+/employee-types.delete.$employeeTypeId.tsx b/apps/carbon/app/routes/x+/users+/employee-types.delete.$employeeTypeId.tsxindex 03d635dd45..d5fad93a0b 100644--- a/apps/carbon/app/routes/x+/users+/employee-types.delete.$employeeTypeId.tsx+++ b/apps/carbon/app/routes/x+/users+/employee-types.delete.$employeeTypeId.tsx@@ -2,8 +2,8 @@ import type { ActionArgs, LoaderArgs } 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 { deleteEmployeeType, getEmployeeType } from "~/modules/users";import { requirePermissions } from "~/services/auth";-import { deleteEmployeeType, getEmployeeType } from "~/services/users";import { flash } from "~/services/session";import { error, success } from "~/utils/result";import { notFound } from "~/utils/http";diff --git a/apps/carbon/app/routes/x+/users+/employee-types.new.tsx b/apps/carbon/app/routes/x+/users+/employee-types.new.tsxindex 9b5a27237d..1b8a5f6315 100644--- a/apps/carbon/app/routes/x+/users+/employee-types.new.tsx+++ b/apps/carbon/app/routes/x+/users+/employee-types.new.tsx@@ -3,16 +3,16 @@ import { redirect } from "@remix-run/node";import { json } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";import { validationError } from "remix-validated-form";-import { EmployeeTypeForm } from "~/interfaces/Users/EmployeeTypes";-import { requirePermissions } from "~/services/auth";import {+ EmployeeTypeForm,employeeTypeValidator,employeeTypePermissionsValidator,getFeatures,insertEmployeeType,makeEmptyPermissionsFromFeatures,upsertEmployeeTypePermissions,-} from "~/services/users";+} from "~/modules/users";+import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";import { assertIsPost } from "~/utils/http";import { error, success } from "~/utils/result";@@ -123,5 +123,10 @@ export default function NewEmployeeTypesRoute() {permissions,};- return <EmployeeTypeForm initialValues={initialValues} />;+ return (+ <EmployeeTypeForm+ //@ts-expect-error+ initialValues={initialValues}+ />+ );}diff --git a/apps/carbon/app/routes/x+/users+/employee-types.tsx b/apps/carbon/app/routes/x+/users+/employee-types.tsxindex 0d19d721c0..8b7086652a 100644--- a/apps/carbon/app/routes/x+/users+/employee-types.tsx+++ b/apps/carbon/app/routes/x+/users+/employee-types.tsx@@ -5,9 +5,9 @@ import { Outlet, useLoaderData } from "@remix-run/react";import {EmployeeTypesTable,EmployeeTypesTableFilters,-} from "~/interfaces/Users/EmployeeTypes";+ getEmployeeTypes,+} from "~/modules/users";import { requirePermissions } from "~/services/auth";-import { getEmployeeTypes } from "~/services/users";import { getGenericQueryFilters } from "~/utils/query";export async function loader({ request }: LoaderArgs) {diff --git a/apps/carbon/app/routes/x+/users+/employees.$employeeId.tsx b/apps/carbon/app/routes/x+/users+/employees.$employeeId.tsxindex fd774795d0..6579b4cfc7 100644--- a/apps/carbon/app/routes/x+/users+/employees.$employeeId.tsx+++ b/apps/carbon/app/routes/x+/users+/employees.$employeeId.tsx@@ -3,17 +3,17 @@ import { json } from "@remix-run/node";import { redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";import { validationError } from "remix-validated-form";-import { EmployeePermissionsForm } from "~/interfaces/Users/Employees";-import { requirePermissions } from "~/services/auth";-import { flash } from "~/services/session";import {- userPermissionsValidator,+ EmployeePermissionsForm,employeeValidator,getClaims,getEmployee,makePermissionsFromClaims,updateEmployee,-} from "~/services/users";+ userPermissionsValidator,+} from "~/modules/users";+import { requirePermissions } from "~/services/auth";+import { flash } from "~/services/session";import { assertIsPost, notFound } from "~/utils/http";import { error } from "~/utils/result";@@ -108,6 +108,7 @@ export default function UsersEmployeeRoute() {return (<EmployeePermissionsFormname={`${employee?.user?.firstName} ${employee?.user?.lastName}`}+ // @ts-expect-errorinitialValues={initialValues}/>);diff --git a/apps/carbon/app/routes/x+/users+/employees.new.tsx b/apps/carbon/app/routes/x+/users+/employees.new.tsxindex e35ef3054b..a1d81ed979 100644--- a/apps/carbon/app/routes/x+/users+/employees.new.tsx+++ b/apps/carbon/app/routes/x+/users+/employees.new.tsx@@ -4,11 +4,11 @@ import { validationError } from "remix-validated-form";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";import {+ CreateEmployeeModal,createEmployeeAccount,createEmployeeValidator,-} from "~/services/users";+} from "~/modules/users";import { assertIsPost } from "~/utils/http";-import { CreateEmployeeModal } from "~/interfaces/Users/Employees";export async function action({ request }: ActionArgs) {assertIsPost(request);diff --git a/apps/carbon/app/routes/x+/users+/employees.tsx b/apps/carbon/app/routes/x+/users+/employees.tsxindex 18a7f05168..d20a31d663 100644--- a/apps/carbon/app/routes/x+/users+/employees.tsx+++ b/apps/carbon/app/routes/x+/users+/employees.tsx@@ -1,16 +1,16 @@import { VStack } from "@chakra-ui/react";import type { LoaderArgs } from "@remix-run/node";-import { redirect } from "@remix-run/node";-import { json } from "@remix-run/node";+import { json, redirect } from "@remix-run/node";import { Outlet, useLoaderData } from "@remix-run/react";import { usePermissions } from "~/hooks";import {EmployeesTable,EmployeesTableFilters,-} from "~/interfaces/Users/Employees";+ getEmployees,+ getEmployeeTypes,+} from "~/modules/users";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";-import { getEmployees, getEmployeeTypes } from "~/services/users";import { getGenericQueryFilters } from "~/utils/query";import { error } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/users+/groups.$groupId.tsx b/apps/carbon/app/routes/x+/users+/groups.$groupId.tsxindex 1f85468393..cee115adbc 100644--- a/apps/carbon/app/routes/x+/users+/groups.$groupId.tsx+++ b/apps/carbon/app/routes/x+/users+/groups.$groupId.tsx@@ -3,15 +3,15 @@ import { json } from "@remix-run/node";import { redirect } from "@remix-run/node";import { useLoaderData } from "@remix-run/react";import { validationError } from "remix-validated-form";-import { GroupForm } from "~/interfaces/Users/Groups";-import { requirePermissions } from "~/services/auth";-import { flash } from "~/services/session";import {+ GroupForm,getGroupMembers,groupValidator,upsertGroup,upsertGroupMembers,-} from "~/services/users";+} from "~/modules/users";+import { requirePermissions } from "~/services/auth";+import { flash } from "~/services/session";import { assertIsPost, notFound } from "~/utils/http";import { error, success } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/users+/groups.delete.$groupId.tsx b/apps/carbon/app/routes/x+/users+/groups.delete.$groupId.tsxindex c9d7eba715..4029ff3ecc 100644--- a/apps/carbon/app/routes/x+/users+/groups.delete.$groupId.tsx+++ b/apps/carbon/app/routes/x+/users+/groups.delete.$groupId.tsx@@ -2,8 +2,8 @@ import type { ActionArgs, LoaderArgs } 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 { deleteGroup, getGroup } from "~/modules/users";import { requirePermissions } from "~/services/auth";-import { deleteGroup, getGroup } from "~/services/users";import { flash } from "~/services/session";import { error, success } from "~/utils/result";import { notFound } from "~/utils/http";diff --git a/apps/carbon/app/routes/x+/users+/groups.new.tsx b/apps/carbon/app/routes/x+/users+/groups.new.tsxindex 4017d8f866..24bee2fd0c 100644--- a/apps/carbon/app/routes/x+/users+/groups.new.tsx+++ b/apps/carbon/app/routes/x+/users+/groups.new.tsx@@ -2,17 +2,17 @@ import type { ActionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { json } from "@remix-run/node";import { validationError } from "remix-validated-form";-import { GroupForm } from "~/interfaces/Users/Groups";-import { flash } from "~/services/session";-import { assertIsPost } from "~/utils/http";-import { error, success } from "~/utils/result";-import { requirePermissions } from "~/services/auth";import {+ GroupForm,insertGroup,deleteGroup,groupValidator,upsertGroupMembers,-} from "~/services/users";+} from "~/modules/users";+import { flash } from "~/services/session";+import { assertIsPost } from "~/utils/http";+import { error, success } from "~/utils/result";+import { requirePermissions } from "~/services/auth";export async function action({ request }: ActionArgs) {assertIsPost(request);@@ -69,6 +69,7 @@ export async function action({ request }: ActionArgs) {export default function NewGroupRoute() {const initialValues = {+ id: "",name: "",selections: [],};diff --git a/apps/carbon/app/routes/x+/users+/groups.tsx b/apps/carbon/app/routes/x+/users+/groups.tsxindex 11a28035f2..f08e39f560 100644--- a/apps/carbon/app/routes/x+/users+/groups.tsx+++ b/apps/carbon/app/routes/x+/users+/groups.tsx@@ -3,11 +3,10 @@ import type { LoaderArgs } from "@remix-run/node";import { json } from "@remix-run/node";import { Outlet, useLoaderData } from "@remix-run/react";import { arrayToTree } from "performant-array-to-tree";-import { GroupsTable, GroupsTableFilters } from "~/interfaces/Users/Groups";-import type { Group } from "~/interfaces/Users/types";+import type { Group } from "~/modules/users";+import { GroupsTable, GroupsTableFilters, getGroups } from "~/modules/users";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";-import { getGroups } from "~/services/users";import { getGenericQueryFilters } from "~/utils/query";import { error } from "~/utils/result";diff --git a/apps/carbon/app/routes/x+/users+/resend-invite.tsx b/apps/carbon/app/routes/x+/users+/resend-invite.tsxindex 38aef9e3bf..6c1e290dc6 100644--- a/apps/carbon/app/routes/x+/users+/resend-invite.tsx+++ b/apps/carbon/app/routes/x+/users+/resend-invite.tsx@@ -1,11 +1,11 @@import type { ActionArgs } from "@remix-run/node";import { json } from "@remix-run/node";import { validationError } from "remix-validated-form";+import { resendInvite, resendInviteValidator } from "~/modules/users";import type { ResendInvitesQueueData } from "~/queues";import { resendInvitesQueue } from "~/queues";import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";-import { resendInvite, resendInviteValidator } from "~/services/users";import { error, success } from "~/utils/result";export async function action({ request }: ActionArgs) {diff --git a/apps/carbon/app/routes/x+/users+/suppliers.new.tsx b/apps/carbon/app/routes/x+/users+/suppliers.new.tsxindex 85537b22af..c04a7e6a88 100644--- a/apps/carbon/app/routes/x+/users+/suppliers.new.tsx+++ b/apps/carbon/app/routes/x+/users+/suppliers.new.tsx@@ -1,14 +1,14 @@import type { ActionArgs } from "@remix-run/node";import { redirect } from "@remix-run/node";import { validationError } from "remix-validated-form";-import { requirePermissions } from "~/services/auth";-import { flash } from "~/services/session";import {+ CreateSupplierModal,createSupplierAccount,createSupplierAccountValidator,-} from "~/services/users";+} from "~/modules/users";+import { requirePermissions } from "~/services/auth";+import { flash } from "~/services/session";import { assertIsPost } from "~/utils/http";-import { CreateSupplierModal } from "~/interfaces/Users/Suppliers";export async function action({ request }: ActionArgs) {assertIsPost(request);diff --git a/apps/carbon/app/routes/x+/users+/suppliers.tsx b/apps/carbon/app/routes/x+/users+/suppliers.tsxindex baa98fe6dd..9f865ab8fa 100644--- a/apps/carbon/app/routes/x+/users+/suppliers.tsx+++ b/apps/carbon/app/routes/x+/users+/suppliers.tsx@@ -4,14 +4,14 @@ import { redirect } from "@remix-run/node";import { json } from "@remix-run/node";import { Outlet, useLoaderData } from "@remix-run/react";import { usePermissions } from "~/hooks";+import { getSupplierTypes } from "~/modules/purchasing";import {SupplierAccountsTable,SupplierAccountsTableFilters,-} from "~/interfaces/Users/Suppliers";+ getSuppliers,+} from "~/modules/users";import { requirePermissions } from "~/services/auth";-import { getSupplierTypes } from "~/services/purchasing";import { flash } from "~/services/session";-import { getSuppliers } from "~/services/users";import { getGenericQueryFilters } from "~/utils/query";import { error } from "~/utils/result";diff --git a/apps/carbon/app/services/auth/auth.server.ts b/apps/carbon/app/services/auth/auth.server.tsindex b86ecd49bb..f330d63c16 100644--- a/apps/carbon/app/services/auth/auth.server.ts+++ b/apps/carbon/app/services/auth/auth.server.ts@@ -8,7 +8,7 @@ import { VERCEL_URL } from "~/config/env";import { REFRESH_ACCESS_TOKEN_THRESHOLD } from "~/config/env";import { getSupabase, getSupabaseServiceRole } from "~/lib/supabase";import { requireAuthSession, flash } from "~/services/session";-import { getUserClaims } from "~/services/users";+import { getUserClaims } from "~/modules/users";import { error } from "~/utils/result";import type { AuthSession } from "./types";diff --git a/docs/.gitkeep b/docs/.gitkeepdeleted file mode 100644index e69de29bb2..0000000000diff --git a/package.json b/package.jsonindex c474ac6739..8577156063 100755--- a/package.json+++ b/package.json@@ -2,7 +2,7 @@"private": true,"workspaces": ["apps/*",- "docs",+ "www","packages/*"],"scripts": {@@ -29,7 +29,7 @@"deploy": "turbo run deploy","dev": "turbo run dev --no-cache --parallel --continue --filter=./apps/* --filter=./packages/*","dev:apps": "turbo run dev --no-cache --parallel --continue --filter=./apps/*",- "dev:docs": "turbo run dev --no-cache --parallel --continue --filter=./docs",+ "dev:www": "turbo run dev --no-cache --parallel --continue --filter=./www","dev:packages": "turbo run dev --no-cache --parallel --continue --filter=./packages/*","format": "prettier --write \"**/*.{ts,tsx,md}\"","init": "run-s db:init db:start",@@ -52,7 +52,7 @@"node": ">=16"},"lint-staged": {- "(apps|docs|packages)/**/*.{js,ts,jsx,tsx}": [+ "(apps|packages|www)/**/*.{js,ts,jsx,tsx}": ["prettier --write","eslint --fix --max-warnings=0"],diff --git a/packages/carbon-database/src/types.ts b/packages/carbon-database/src/types.tsindex e69de29bb2..18631ffd5d 100644--- a/packages/carbon-database/src/types.ts+++ b/packages/carbon-database/src/types.ts@@ -0,0 +1,1485 @@+export type Json =+ | string+ | number+ | boolean+ | null+ | { [key: string]: Json }+ | Json[];++export interface Database {+ public: {+ Tables: {+ ability: {+ Row: {+ name: string;+ createdBy: string;+ updatedAt: string | null;+ updatedBy: string | null;+ id: string;+ curve: Json;+ shadowWeeks: number;+ active: boolean;+ createdAt: string;+ };+ Insert: {+ name: string;+ createdBy: string;+ updatedAt?: string | null;+ updatedBy?: string | null;+ id?: string;+ curve?: Json;+ shadowWeeks?: number;+ active?: boolean;+ createdAt?: string;+ };+ Update: {+ name?: string;+ createdBy?: string;+ updatedAt?: string | null;+ updatedBy?: string | null;+ id?: string;+ curve?: Json;+ shadowWeeks?: number;+ active?: boolean;+ createdAt?: string;+ };+ };+ address: {+ Row: {+ addressLine1: string | null;+ addressLine2: string | null;+ city: string | null;+ state: string | null;+ postalCode: string | null;+ countryId: number | null;+ phone: string | null;+ fax: string | null;+ id: string;+ };+ Insert: {+ addressLine1?: string | null;+ addressLine2?: string | null;+ city?: string | null;+ state?: string | null;+ postalCode?: string | null;+ countryId?: number | null;+ phone?: string | null;+ fax?: string | null;+ id?: string;+ };+ Update: {+ addressLine1?: string | null;+ addressLine2?: string | null;+ city?: string | null;+ state?: string | null;+ postalCode?: string | null;+ countryId?: number | null;+ phone?: string | null;+ fax?: string | null;+ id?: string;+ };+ };+ attributeDataType: {+ Row: {+ label: string;+ id: number;+ isBoolean: boolean;+ isDate: boolean;+ isList: boolean;+ isNumeric: boolean;+ isText: boolean;+ isUser: boolean;+ };+ Insert: {+ label: string;+ id?: number;+ isBoolean?: boolean;+ isDate?: boolean;+ isList?: boolean;+ isNumeric?: boolean;+ isText?: boolean;+ isUser?: boolean;+ };+ Update: {+ label?: string;+ id?: number;+ isBoolean?: boolean;+ isDate?: boolean;+ isList?: boolean;+ isNumeric?: boolean;+ isText?: boolean;+ isUser?: boolean;+ };+ };+ contact: {+ Row: {+ firstName: string;+ lastName: string;+ email: string;+ title: string | null;+ mobilePhone: string | null;+ homePhone: string | null;+ workPhone: string | null;+ fax: string | null;+ addressLine1: string | null;+ addressLine2: string | null;+ city: string | null;+ state: string | null;+ postalCode: string | null;+ countryId: number | null;+ birthday: string | null;+ notes: string | null;+ id: string;+ };+ Insert: {+ firstName: string;+ lastName: string;+ email: string;+ title?: string | null;+ mobilePhone?: string | null;+ homePhone?: string | null;+ workPhone?: string | null;+ fax?: string | null;+ addressLine1?: string | null;+ addressLine2?: string | null;+ city?: string | null;+ state?: string | null;+ postalCode?: string | null;+ countryId?: number | null;+ birthday?: string | null;+ notes?: string | null;+ id?: string;+ };+ Update: {+ firstName?: string;+ lastName?: string;+ email?: string;+ title?: string | null;+ mobilePhone?: string | null;+ homePhone?: string | null;+ workPhone?: string | null;+ fax?: string | null;+ addressLine1?: string | null;+ addressLine2?: string | null;+ city?: string | null;+ state?: string | null;+ postalCode?: string | null;+ countryId?: number | null;+ birthday?: string | null;+ notes?: string | null;+ id?: string;+ };+ };+ country: {+ Row: {+ name: string;+ code: string;+ id: number;+ };+ Insert: {+ name: string;+ code: string;+ id?: number;+ };+ Update: {+ name?: string;+ code?: string;+ id?: number;+ };+ };+ crew: {+ Row: {+ name: string;+ description: string | null;+ crewLeaderId: string | null;+ groupId: string;+ workCellId: string | null;+ id: string;+ };+ Insert: {+ name: string;+ description?: string | null;+ crewLeaderId?: string | null;+ groupId: string;+ workCellId?: string | null;+ id?: string;+ };+ Update: {+ name?: string;+ description?: string | null;+ crewLeaderId?: string | null;+ groupId?: string;+ workCellId?: string | null;+ id?: string;+ };+ };+ crewAbility: {+ Row: {+ crewId: string;+ abilityId: string;+ id: string;+ active: boolean;+ };+ Insert: {+ crewId: string;+ abilityId: string;+ id?: string;+ active?: boolean;+ };+ Update: {+ crewId?: string;+ abilityId?: string;+ id?: string;+ active?: boolean;+ };+ };+ customer: {+ Row: {+ name: string;+ description: string | null;+ customerTypeId: string | null;+ customerStatusId: string | null;+ taxId: string | null;+ accountManagerId: string | null;+ logo: string | null;+ createdBy: string | null;+ updatedAt: string | null;+ updatedBy: string | null;+ id: string;+ createdAt: string;+ };+ Insert: {+ name: string;+ description?: string | null;+ customerTypeId?: string | null;+ customerStatusId?: string | null;+ taxId?: string | null;+ accountManagerId?: string | null;+ logo?: string | null;+ createdBy?: string | null;+ updatedAt?: string | null;+ updatedBy?: string | null;+ id?: string;+ createdAt?: string;+ };+ Update: {+ name?: string;+ description?: string | null;+ customerTypeId?: string | null;+ customerStatusId?: string | null;+ taxId?: string | null;+ accountManagerId?: string | null;+ logo?: string | null;+ createdBy?: string | null;+ updatedAt?: string | null;+ updatedBy?: string | null;+ id?: string;+ createdAt?: string;+ };+ };+ customerAccount: {+ Row: {+ id: string;+ customerId: string;+ };+ Insert: {+ id: string;+ customerId: string;+ };+ Update: {+ id?: string;+ customerId?: string;+ };+ };+ customerContact: {+ Row: {+ customerId: string;+ contactId: string;+ customerLocationId: string | null;+ userId: string | null;+ id: string;+ };+ Insert: {+ customerId: string;+ contactId: string;+ customerLocationId?: string | null;+ userId?: string | null;+ id?: string;+ };+ Update: {+ customerId?: string;+ contactId?: string;+ customerLocationId?: string | null;+ userId?: string | null;+ id?: string;+ };+ };+ customerLocation: {+ Row: {+ customerId: string;+ addressId: string;+ id: string;+ };+ Insert: {+ customerId: string;+ addressId: string;+ id?: string;+ };+ Update: {+ customerId?: string;+ addressId?: string;+ id?: string;+ };+ };+ customerStatus: {+ Row: {+ name: string;+ updatedAt: string | null;+ id: string;+ createdAt: string;+ };+ Insert: {+ name: string;+ updatedAt?: string | null;+ id?: string;+ createdAt?: string;+ };+ Update: {+ name?: string;+ updatedAt?: string | null;+ id?: string;+ createdAt?: string;+ };+ };+ customerType: {+ Row: {+ name: string;+ updatedAt: string | null;+ id: string;+ color: string | null;+ protected: boolean;+ createdAt: string;+ };+ Insert: {+ name: string;+ updatedAt?: string | null;+ id?: string;+ color?: string | null;+ protected?: boolean;+ createdAt?: string;+ };+ Update: {+ name?: string;+ updatedAt?: string | null;+ id?: string;+ color?: string | null;+ protected?: boolean;+ createdAt?: string;+ };+ };+ department: {+ Row: {+ name: string;+ parentDepartmentId: string | null;+ createdBy: string;+ updatedBy: string | null;+ updatedAt: string | null;+ id: string;+ color: string;+ createdAt: string;+ };+ Insert: {+ name: string;+ parentDepartmentId?: string | null;+ createdBy: string;+ updatedBy?: string | null;+ updatedAt?: string | null;+ id?: string;+ color?: string;+ createdAt?: string;+ };+ Update: {+ name?: string;+ parentDepartmentId?: string | null;+ createdBy?: string;+ updatedBy?: string | null;+ updatedAt?: string | null;+ id?: string;+ color?: string;+ createdAt?: string;+ };+ };+ employee: {+ Row: {+ id: string;+ employeeTypeId: string;+ };+ Insert: {+ id: string;+ employeeTypeId: string;+ };+ Update: {+ id?: string;+ employeeTypeId?: string;+ };+ };+ employeeAbility: {+ Row: {+ employeeId: string;+ abilityId: string;+ lastTrainingDate: string | null;+ id: string;+ active: boolean;+ trainingDays: number;+ trainingCompleted: boolean | null;+ };+ Insert: {+ employeeId: string;+ abilityId: string;+ lastTrainingDate?: string | null;+ id?: string;+ active?: boolean;+ trainingDays?: number;+ trainingCompleted?: boolean | null;+ };+ Update: {+ employeeId?: string;+ abilityId?: string;+ lastTrainingDate?: string | null;+ id?: string;+ active?: boolean;+ trainingDays?: number;+ trainingCompleted?: boolean | null;+ };+ };+ employeeJob: {+ Row: {+ id: string;+ locationId: string | null;+ shiftId: string | null;+ managerId: string | null;+ title: string | null;+ startDate: string | null;+ departmentId: string | null;+ workCellId: string | null;+ };+ Insert: {+ id: string;+ locationId?: string | null;+ shiftId?: string | null;+ managerId?: string | null;+ title?: string | null;+ startDate?: string | null;+ departmentId?: string | null;+ workCellId?: string | null;+ };+ Update: {+ id?: string;+ locationId?: string | null;+ shiftId?: string | null;+ managerId?: string | null;+ title?: string | null;+ startDate?: string | null;+ departmentId?: string | null;+ workCellId?: string | null;+ };+ };+ employeeShift: {+ Row: {+ employeeId: string;+ shiftId: string;+ id: string;+ };+ Insert: {+ employeeId: string;+ shiftId: string;+ id?: string;+ };+ Update: {+ employeeId?: string;+ shiftId?: string;+ id?: string;+ };+ };+ employeeType: {+ Row: {+ name: string;+ updatedAt: string | null;+ id: string;+ color: string;+ protected: boolean;+ createdAt: string;+ };+ Insert: {+ name: string;+ updatedAt?: string | null;+ id?: string;+ color?: string;+ protected?: boolean;+ createdAt?: string;+ };+ Update: {+ name?: string;+ updatedAt?: string | null;+ id?: string;+ color?: string;+ protected?: boolean;+ createdAt?: string;+ };+ };+ employeeTypePermission: {+ Row: {+ employeeTypeId: string;+ featureId: string;+ updatedAt: string | null;+ create: boolean;+ delete: boolean;+ update: boolean;+ view: boolean;+ createdAt: string;+ };+ Insert: {+ employeeTypeId: string;+ featureId: string;+ updatedAt?: string | null;+ create?: boolean;+ delete?: boolean;+ update?: boolean;+ view?: boolean;+ createdAt?: string;+ };+ Update: {+ employeeTypeId?: string;+ featureId?: string;+ updatedAt?: string | null;+ create?: boolean;+ delete?: boolean;+ update?: boolean;+ view?: boolean;+ createdAt?: string;+ };+ };+ equipment: {+ Row: {+ name: string;+ description: string | null;+ equipmentTypeId: string;+ locationId: string;+ workCellId: string | null;+ activeDate: string | null;+ createdBy: string;+ updatedBy: string | null;+ updatedAt: string | null;+ id: string;+ operatorsRequired: number;+ setupHours: number;+ active: boolean;+ createdAt: string;+ };+ Insert: {+ name: string;+ description?: string | null;+ equipmentTypeId: string;+ locationId: string;+ workCellId?: string | null;+ activeDate?: string | null;+ createdBy: string;+ updatedBy?: string | null;+ updatedAt?: string | null;+ id?: string;+ operatorsRequired?: number;+ setupHours?: number;+ active?: boolean;+ createdAt?: string;+ };+ Update: {+ name?: string;+ description?: string | null;+ equipmentTypeId?: string;+ locationId?: string;+ workCellId?: string | null;+ activeDate?: string | null;+ createdBy?: string;+ updatedBy?: string | null;+ updatedAt?: string | null;+ id?: string;+ operatorsRequired?: number;+ setupHours?: number;+ active?: boolean;+ createdAt?: string;+ };+ };+ equipmentType: {+ Row: {+ name: string;+ description: string | null;+ requiredAbility: string | null;+ createdBy: string;+ updatedBy: string | null;+ updatedAt: string | null;+ id: string;+ color: string;+ active: boolean;+ createdAt: string;+ };+ Insert: {+ name: string;+ description?: string | null;+ requiredAbility?: string | null;+ createdBy: string;+ updatedBy?: string | null;+ updatedAt?: string | null;+ id?: string;+ color?: string;+ active?: boolean;+ createdAt?: string;+ };+ Update: {+ name?: string;+ description?: string | null;+ requiredAbility?: string | null;+ createdBy?: string;+ updatedBy?: string | null;+ updatedAt?: string | null;+ id?: string;+ color?: string;+ active?: boolean;+ createdAt?: string;+ };+ };+ feature: {+ Row: {+ name: string;+ updatedAt: string | null;+ id: string;+ createdAt: string;+ };+ Insert: {+ name: string;+ updatedAt?: string | null;+ id?: string;+ createdAt?: string;+ };+ Update: {+ name?: string;+ updatedAt?: string | null;+ id?: string;+ createdAt?: string;+ };+ };+ group: {+ Row: {+ name: string;+ id: string;+ updatedAt: string | null;+ isIdentityGroup: boolean;+ isEmployeeTypeGroup: boolean;+ isCustomerOrgGroup: boolean;+ isCustomerTypeGroup: boolean;+ isSupplierTypeGroup: boolean;+ isSupplierOrgGroup: boolean;+ createdAt: string;+ };+ Insert: {+ name: string;+ id?: string;+ updatedAt?: string | null;+ isIdentityGroup?: boolean;+ isEmployeeTypeGroup?: boolean;+ isCustomerOrgGroup?: boolean;+ isCustomerTypeGroup?: boolean;+ isSupplierTypeGroup?: boolean;+ isSupplierOrgGroup?: boolean;+ createdAt?: string;+ };+ Update: {+ name?: string;+ id?: string;+ updatedAt?: string | null;+ isIdentityGroup?: boolean;+ isEmployeeTypeGroup?: boolean;+ isCustomerOrgGroup?: boolean;+ isCustomerTypeGroup?: boolean;+ isSupplierTypeGroup?: boolean;+ isSupplierOrgGroup?: boolean;+ createdAt?: string;+ };+ };+ holiday: {+ Row: {+ name: string;+ date: string;+ createdBy: string;+ updatedBy: string | null;+ updatedAt: string | null;+ id: string;+ year: number | null;+ createdAt: string;+ };+ Insert: {+ name: string;+ date: string;+ createdBy: string;+ updatedBy?: string | null;+ updatedAt?: string | null;+ id?: string;+ year?: number | null;+ createdAt?: string;+ };+ Update: {+ name?: string;+ date?: string;+ createdBy?: string;+ updatedBy?: string | null;+ updatedAt?: string | null;+ id?: string;+ year?: number | null;+ createdAt?: string;+ };+ };+ location: {+ Row: {+ name: string;+ timezone: string;+ latitude: number | null;+ longitude: number | null;+ createdBy: string;+ updatedBy: string | null;+ updatedAt: string | null;+ id: string;+ createdAt: string;+ };+ Insert: {+ name: string;+ timezone: string;+ latitude?: number | null;+ longitude?: number | null;+ createdBy: string;+ updatedBy?: string | null;+ updatedAt?: string | null;+ id?: string;+ createdAt?: string;+ };+ Update: {+ name?: string;+ timezone?: string;+ latitude?: number | null;+ longitude?: number | null;+ createdBy?: string;+ updatedBy?: string | null;+ updatedAt?: string | null;+ id?: string;+ createdAt?: string;+ };+ };+ membership: {+ Row: {+ groupId: string;+ memberGroupId: string | null;+ memberUserId: string | null;+ id: number;+ };+ Insert: {+ groupId: string;+ memberGroupId?: string | null;+ memberUserId?: string | null;+ id?: number;+ };+ Update: {+ groupId?: string;+ memberGroupId?: string | null;+ memberUserId?: string | null;+ id?: number;+ };+ };+ partner: {+ Row: {+ id: string;+ createdBy: string;+ updatedBy: string | null;+ updatedAt: string | null;+ hoursPerWeek: number;+ active: boolean;+ createdAt: string;+ };+ Insert: {+ id: string;+ createdBy: string;+ updatedBy?: string | null;+ updatedAt?: string | null;+ hoursPerWeek?: number;+ active?: boolean;+ createdAt?: string;+ };+ Update: {+ id?: string;+ createdBy?: string;+ updatedBy?: string | null;+ updatedAt?: string | null;+ hoursPerWeek?: number;+ active?: boolean;+ createdAt?: string;+ };+ };+ search: {+ Row: {+ id: number;+ name: string;+ entity: Database["public"]["Enums"]["search_entity"] | null;+ uuid: string | null;+ link: string;+ description: string | null;+ fts: unknown | null;+ };+ Insert: {+ id?: number;+ name: string;+ entity?: Database["public"]["Enums"]["search_entity"] | null;+ uuid?: string | null;+ link: string;+ description?: string | null;+ fts?: unknown | null;+ };+ Update: {+ id?: number;+ name?: string;+ entity?: Database["public"]["Enums"]["search_entity"] | null;+ uuid?: string | null;+ link?: string;+ description?: string | null;+ fts?: unknown | null;+ };+ };+ shift: {+ Row: {+ name: string;+ startTime: string;+ endTime: string;+ locationId: string;+ id: string;+ sunday: boolean;+ monday: boolean;+ tuesday: boolean;+ wednesday: boolean;+ thursday: boolean;+ friday: boolean;+ saturday: boolean;+ active: boolean;+ };+ Insert: {+ name: string;+ startTime: string;+ endTime: string;+ locationId: string;+ id?: string;+ sunday?: boolean;+ monday?: boolean;+ tuesday?: boolean;+ wednesday?: boolean;+ thursday?: boolean;+ friday?: boolean;+ saturday?: boolean;+ active?: boolean;+ };+ Update: {+ name?: string;+ startTime?: string;+ endTime?: string;+ locationId?: string;+ id?: string;+ sunday?: boolean;+ monday?: boolean;+ tuesday?: boolean;+ wednesday?: boolean;+ thursday?: boolean;+ friday?: boolean;+ saturday?: boolean;+ active?: boolean;+ };+ };+ supplier: {+ Row: {+ name: string;+ description: string | null;+ supplierTypeId: string | null;+ supplierStatusId: string | null;+ taxId: string | null;+ accountManagerId: string | null;+ logo: string | null;+ createdBy: string | null;+ updatedAt: string | null;+ updatedBy: string | null;+ id: string;+ createdAt: string;+ };+ Insert: {+ name: string;+ description?: string | null;+ supplierTypeId?: string | null;+ supplierStatusId?: string | null;+ taxId?: string | null;+ accountManagerId?: string | null;+ logo?: string | null;+ createdBy?: string | null;+ updatedAt?: string | null;+ updatedBy?: string | null;+ id?: string;+ createdAt?: string;+ };+ Update: {+ name?: string;+ description?: string | null;+ supplierTypeId?: string | null;+ supplierStatusId?: string | null;+ taxId?: string | null;+ accountManagerId?: string | null;+ logo?: string | null;+ createdBy?: string | null;+ updatedAt?: string | null;+ updatedBy?: string | null;+ id?: string;+ createdAt?: string;+ };+ };+ supplierAccount: {+ Row: {+ id: string;+ supplierId: string;+ };+ Insert: {+ id: string;+ supplierId: string;+ };+ Update: {+ id?: string;+ supplierId?: string;+ };+ };+ supplierContact: {+ Row: {+ supplierId: string;+ contactId: string;+ supplierLocationId: string | null;+ userId: string | null;+ id: string;+ };+ Insert: {+ supplierId: string;+ contactId: string;+ supplierLocationId?: string | null;+ userId?: string | null;+ id?: string;+ };+ Update: {+ supplierId?: string;+ contactId?: string;+ supplierLocationId?: string | null;+ userId?: string | null;+ id?: string;+ };+ };+ supplierLocation: {+ Row: {+ supplierId: string;+ addressId: string;+ id: string;+ };+ Insert: {+ supplierId: string;+ addressId: string;+ id?: string;+ };+ Update: {+ supplierId?: string;+ addressId?: string;+ id?: string;+ };+ };+ supplierStatus: {+ Row: {+ name: string;+ updatedAt: string | null;+ id: string;+ createdAt: string;+ };+ Insert: {+ name: string;+ updatedAt?: string | null;+ id?: string;+ createdAt?: string;+ };+ Update: {+ name?: string;+ updatedAt?: string | null;+ id?: string;+ createdAt?: string;+ };+ };+ supplierType: {+ Row: {+ name: string;+ updatedAt: string | null;+ id: string;+ color: string | null;+ protected: boolean;+ createdAt: string;+ };+ Insert: {+ name: string;+ updatedAt?: string | null;+ id?: string;+ color?: string | null;+ protected?: boolean;+ createdAt?: string;+ };+ Update: {+ name?: string;+ updatedAt?: string | null;+ id?: string;+ color?: string | null;+ protected?: boolean;+ createdAt?: string;+ };+ };+ user: {+ Row: {+ id: string;+ email: string;+ firstName: string;+ lastName: string;+ avatarUrl: string | null;+ emailVerified: string | null;+ updatedAt: string | null;+ fullName: string | null;+ about: string;+ active: boolean | null;+ createdAt: string;+ };+ Insert: {+ id: string;+ email: string;+ firstName: string;+ lastName: string;+ avatarUrl?: string | null;+ emailVerified?: string | null;+ updatedAt?: string | null;+ fullName?: string | null;+ about?: string;+ active?: boolean | null;+ createdAt?: string;+ };+ Update: {+ id?: string;+ email?: string;+ firstName?: string;+ lastName?: string;+ avatarUrl?: string | null;+ emailVerified?: string | null;+ updatedAt?: string | null;+ fullName?: string | null;+ about?: string;+ active?: boolean | null;+ createdAt?: string;+ };+ };+ userAttribute: {+ Row: {+ name: string;+ userAttributeCategoryId: string;+ attributeDataTypeId: number;+ listOptions: string[] | null;+ createdBy: string;+ updatedAt: string | null;+ updatedBy: string | null;+ id: string;+ sortOrder: number;+ canSelfManage: boolean | null;+ active: boolean | null;+ createdAt: string;+ };+ Insert: {+ name: string;+ userAttributeCategoryId: string;+ attributeDataTypeId: number;+ listOptions?: string[] | null;+ createdBy: string;+ updatedAt?: string | null;+ updatedBy?: string | null;+ id?: string;+ sortOrder?: number;+ canSelfManage?: boolean | null;+ active?: boolean | null;+ createdAt?: string;+ };+ Update: {+ name?: string;+ userAttributeCategoryId?: string;+ attributeDataTypeId?: number;+ listOptions?: string[] | null;+ createdBy?: string;+ updatedAt?: string | null;+ updatedBy?: string | null;+ id?: string;+ sortOrder?: number;+ canSelfManage?: boolean | null;+ active?: boolean | null;+ createdAt?: string;+ };+ };+ userAttributeCategory: {+ Row: {+ name: string;+ createdBy: string;+ updatedAt: string | null;+ updatedBy: string | null;+ id: string;+ public: boolean | null;+ protected: boolean | null;+ active: boolean | null;+ createdAt: string;+ };+ Insert: {+ name: string;+ createdBy: string;+ updatedAt?: string | null;+ updatedBy?: string | null;+ id?: string;+ public?: boolean | null;+ protected?: boolean | null;+ active?: boolean | null;+ createdAt?: string;+ };+ Update: {+ name?: string;+ createdBy?: string;+ updatedAt?: string | null;+ updatedBy?: string | null;+ id?: string;+ public?: boolean | null;+ protected?: boolean | null;+ active?: boolean | null;+ createdAt?: string;+ };+ };+ userAttributeValue: {+ Row: {+ userAttributeId: string;+ userId: string;+ valueBoolean: boolean | null;+ valueDate: string | null;+ valueNumeric: number | null;+ valueText: string | null;+ valueUser: string | null;+ createdBy: string;+ updatedAt: string | null;+ updatedBy: string | null;+ id: string;+ createdAt: string;+ };+ Insert: {+ userAttributeId: string;+ userId: string;+ valueBoolean?: boolean | null;+ valueDate?: string | null;+ valueNumeric?: number | null;+ valueText?: string | null;+ valueUser?: string | null;+ createdBy: string;+ updatedAt?: string | null;+ updatedBy?: string | null;+ id?: string;+ createdAt?: string;+ };+ Update: {+ userAttributeId?: string;+ userId?: string;+ valueBoolean?: boolean | null;+ valueDate?: string | null;+ valueNumeric?: number | null;+ valueText?: string | null;+ valueUser?: string | null;+ createdBy?: string;+ updatedAt?: string | null;+ updatedBy?: string | null;+ id?: string;+ createdAt?: string;+ };+ };+ userNote: {+ Row: {+ userId: string;+ note: string;+ createdBy: string;+ id: string;+ noteRichText: Json;+ active: boolean;+ createdAt: string;+ updatedAt: string | null;+ };+ Insert: {+ userId: string;+ note: string;+ createdBy: string;+ id?: string;+ noteRichText?: Json;+ active?: boolean;+ createdAt?: string;+ updatedAt?: string | null;+ };+ Update: {+ userId?: string;+ note?: string;+ createdBy?: string;+ id?: string;+ noteRichText?: Json;+ active?: boolean;+ createdAt?: string;+ updatedAt?: string | null;+ };+ };+ workCell: {+ Row: {+ name: string;+ description: string | null;+ departmentId: string;+ locationId: string | null;+ workCellTypeId: string;+ activeDate: string | null;+ createdBy: string;+ updatedBy: string | null;+ updatedAt: string | null;+ id: string;+ defaultStandardFactor: Database["public"]["Enums"]["factor"];+ active: boolean;+ createdAt: string;+ };+ Insert: {+ name: string;+ description?: string | null;+ departmentId: string;+ locationId?: string | null;+ workCellTypeId: string;+ activeDate?: string | null;+ createdBy: string;+ updatedBy?: string | null;+ updatedAt?: string | null;+ id?: string;+ defaultStandardFactor?: Database["public"]["Enums"]["factor"];+ active?: boolean;+ createdAt?: string;+ };+ Update: {+ name?: string;+ description?: string | null;+ departmentId?: string;+ locationId?: string | null;+ workCellTypeId?: string;+ activeDate?: string | null;+ createdBy?: string;+ updatedBy?: string | null;+ updatedAt?: string | null;+ id?: string;+ defaultStandardFactor?: Database["public"]["Enums"]["factor"];+ active?: boolean;+ createdAt?: string;+ };+ };+ workCellType: {+ Row: {+ name: string;+ description: string | null;+ requiredAbility: string | null;+ createdBy: string;+ updatedBy: string | null;+ updatedAt: string | null;+ id: string;+ color: string;+ active: boolean;+ createdAt: string;+ };+ Insert: {+ name: string;+ description?: string | null;+ requiredAbility?: string | null;+ createdBy: string;+ updatedBy?: string | null;+ updatedAt?: string | null;+ id?: string;+ color?: string;+ active?: boolean;+ createdAt?: string;+ };+ Update: {+ name?: string;+ description?: string | null;+ requiredAbility?: string | null;+ createdBy?: string;+ updatedBy?: string | null;+ updatedAt?: string | null;+ id?: string;+ color?: string;+ active?: boolean;+ createdAt?: string;+ };+ };+ };+ Views: {+ group_member: {+ Row: {+ id: number | null;+ name: string | null;+ isIdentityGroup: boolean | null;+ isEmployeeTypeGroup: boolean | null;+ isCustomerOrgGroup: boolean | null;+ isCustomerTypeGroup: boolean | null;+ isSupplierOrgGroup: boolean | null;+ isSupplierTypeGroup: boolean | null;+ groupId: string | null;+ memberGroupId: string | null;+ memberUserId: string | null;+ user: Json | null;+ };+ };+ groups_recursive: {+ Row: {+ groupId: string | null;+ name: string | null;+ parentId: string | null;+ isIdentityGroup: boolean | null;+ isEmployeeTypeGroup: boolean | null;+ isCustomerOrgGroup: boolean | null;+ isCustomerTypeGroup: boolean | null;+ isSupplierOrgGroup: boolean | null;+ isSupplierTypeGroup: boolean | null;+ user: Json | null;+ };+ };+ groups_view: {+ Row: {+ id: string | null;+ isEmployeeTypeGroup: boolean | null;+ isCustomerOrgGroup: boolean | null;+ isCustomerTypeGroup: boolean | null;+ isSupplierOrgGroup: boolean | null;+ isSupplierTypeGroup: boolean | null;+ name: string | null;+ parentId: string | null;+ users: Json | null;+ };+ };+ holiday_years: {+ Row: {+ year: number | null;+ };+ };+ };+ Functions: {+ _xid_machine_id: {+ Args: Record<PropertyKey, never>;+ Returns: number;+ };+ delete_claim: {+ Args: { uid: string; claim: string };+ Returns: string;+ };+ get_claim: {+ Args: { uid: string; claim: string };+ Returns: Json;+ };+ get_claims: {+ Args: { uid: string };+ Returns: Json;+ };+ get_my_claim: {+ Args: { claim: string };+ Returns: Json;+ };+ get_my_claims: {+ Args: Record<PropertyKey, never>;+ Returns: Json;+ };+ groups_for_user: {+ Args: { uid: string };+ Returns: Json;+ };+ groups_query: {+ Args: { _name: string; _uid: string };+ Returns: {+ id: string;+ name: string;+ parentId: string;+ isEmployeeTypeGroup: boolean;+ isCustomerOrgGroup: boolean;+ isCustomerTypeGroup: boolean;+ isSupplierOrgGroup: boolean;+ isSupplierTypeGroup: boolean;+ users: Json;+ }[];+ };+ is_claims_admin: {+ Args: Record<PropertyKey, never>;+ Returns: boolean;+ };+ set_claim: {+ Args: { uid: string; claim: string; value: Json };+ Returns: string;+ };+ users_for_groups: {+ Args: { groups: string[] };+ Returns: Json;+ };+ xid: {+ Args: { _at: string };+ Returns: unknown;+ };+ xid_counter: {+ Args: { _xid: unknown };+ Returns: number;+ };+ xid_decode: {+ Args: { _xid: unknown };+ Returns: number[];+ };+ xid_encode: {+ Args: { _id: number[] };+ Returns: unknown;+ };+ xid_machine: {+ Args: { _xid: unknown };+ Returns: number[];+ };+ xid_pid: {+ Args: { _xid: unknown };+ Returns: number;+ };+ xid_time: {+ Args: { _xid: unknown };+ Returns: string;+ };+ };+ Enums: {+ factor:+ | "Hours/Piece"+ | "Hours/100 Pieces"+ | "Hours/1000 Pieces"+ | "Minutes/Piece"+ | "Minutes/100 Pieces"+ | "Minutes/1000 Pieces"+ | "Pieces/Hour"+ | "Pieces/Minute"+ | "Seconds/Piece"+ | "Total Hours"+ | "Total Minutes";+ search_entity:+ | "Resource"+ | "Person"+ | "Customer"+ | "Supplier"+ | "Job"+ | "Part"+ | "Purchase Order"+ | "Sales Order"+ | "Document";+ };+ };+}diff --git a/packages/carbon-database/supabase/migrations/20230224035103_shifts.sql b/packages/carbon-database/supabase/migrations/20230224035103_shifts.sqlindex 90e5ad3a36..0feda08d77 100644--- a/packages/carbon-database/supabase/migrations/20230224035103_shifts.sql+++ b/packages/carbon-database/supabase/migrations/20230224035103_shifts.sql@@ -142,6 +142,7 @@ CREATE TABLE "employeeJob" ("shiftId" TEXT,"managerId" TEXT,"title" TEXT,+ "startDate" DATE,CONSTRAINT "employeeJob_pkey" PRIMARY KEY ("id"),CONSTRAINT "employeeJob_id_fkey" FOREIGN KEY ("id") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE CASCADE,diff --git a/packages/carbon-database/supabase/migrations/20230319224154_partners.sql b/packages/carbon-database/supabase/migrations/20230319224154_partners.sqlnew file mode 100644index 0000000000..bd23d71233--- /dev/null+++ b/packages/carbon-database/supabase/migrations/20230319224154_partners.sql@@ -0,0 +1,14 @@+CREATE TABLE "partner" (+ "id" TEXT NOT NULL,+ "hoursPerWeek" INTEGER NOT NULL DEFAULT 0,+ "active" BOOLEAN NOT NULL DEFAULT true,+ "createdBy" TEXT NOT NULL,+ "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),+ "updatedBy" TEXT,+ "updatedAt" TIMESTAMP WITH TIME ZONE,++ CONSTRAINT "partner_pkey" PRIMARY KEY ("id"),+ CONSTRAINT "partner_id_fkey" FOREIGN KEY ("id") REFERENCES "supplier"("id"),+ CONSTRAINT "partner_createdBy_fkey" FOREIGN KEY ("createdBy") REFERENCES "user"("id"),+ CONSTRAINT "partner_updatedBy_fkey" FOREIGN KEY ("updatedBy") REFERENCES "user"("id")+);\ No newline at end of filediff --git a/packages/carbon-database/tsup.config.bundled_o7g8q4dn64b.mjs b/packages/carbon-database/tsup.config.bundled_o7g8q4dn64b.mjsnew file mode 100644index 0000000000..acf61a5741--- /dev/null+++ b/packages/carbon-database/tsup.config.bundled_o7g8q4dn64b.mjs@@ -0,0 +1,15 @@+// tsup.config.ts+import { defineConfig } from "tsup";+var isProduction = process.env.NODE_ENV === "production";+var tsup_config_default = defineConfig({+ clean: true,+ dts: true,+ entry: ["src/index.ts"],+ format: ["cjs", "esm"],+ minify: isProduction,+ sourcemap: true+});+export {+ tsup_config_default as default+};+//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidHN1cC5jb25maWcudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9faW5qZWN0ZWRfZmlsZW5hbWVfXyA9IFwiL1VzZXJzL2JiYXJiaW4vQ29kZS9jYXJib24vcGFja2FnZXMvY2FyYm9uLWRhdGFiYXNlL3RzdXAuY29uZmlnLnRzXCI7Y29uc3QgX19pbmplY3RlZF9kaXJuYW1lX18gPSBcIi9Vc2Vycy9iYmFyYmluL0NvZGUvY2FyYm9uL3BhY2thZ2VzL2NhcmJvbi1kYXRhYmFzZVwiO2NvbnN0IF9faW5qZWN0ZWRfaW1wb3J0X21ldGFfdXJsX18gPSBcImZpbGU6Ly8vVXNlcnMvYmJhcmJpbi9Db2RlL2NhcmJvbi9wYWNrYWdlcy9jYXJib24tZGF0YWJhc2UvdHN1cC5jb25maWcudHNcIjtpbXBvcnQgeyBkZWZpbmVDb25maWcgfSBmcm9tIFwidHN1cFwiO1xuXG5jb25zdCBpc1Byb2R1Y3Rpb24gPSBwcm9jZXNzLmVudi5OT0RFX0VOViA9PT0gXCJwcm9kdWN0aW9uXCI7XG5cbmV4cG9ydCBkZWZhdWx0IGRlZmluZUNvbmZpZyh7XG4gIGNsZWFuOiB0cnVlLFxuICBkdHM6IHRydWUsXG4gIGVudHJ5OiBbXCJzcmMvaW5kZXgudHNcIl0sXG4gIGZvcm1hdDogW1wiY2pzXCIsIFwiZXNtXCJdLFxuICBtaW5pZnk6IGlzUHJvZHVjdGlvbixcbiAgc291cmNlbWFwOiB0cnVlLFxufSk7XG4iXSwKICAibWFwcGluZ3MiOiAiO0FBQXVTLFNBQVMsb0JBQW9CO0FBRXBVLElBQU0sZUFBZSxRQUFRLElBQUksYUFBYTtBQUU5QyxJQUFPLHNCQUFRLGFBQWE7QUFBQSxFQUMxQixPQUFPO0FBQUEsRUFDUCxLQUFLO0FBQUEsRUFDTCxPQUFPLENBQUMsY0FBYztBQUFBLEVBQ3RCLFFBQVEsQ0FBQyxPQUFPLEtBQUs7QUFBQSxFQUNyQixRQUFRO0FBQUEsRUFDUixXQUFXO0FBQ2IsQ0FBQzsiLAogICJuYW1lcyI6IFtdCn0Kdiff --git a/packages/carbon-redis/tsup.config.bundled_r5u3e79sewr.mjs b/packages/carbon-redis/tsup.config.bundled_r5u3e79sewr.mjsnew file mode 100644index 0000000000..3f51cd567b--- /dev/null+++ b/packages/carbon-redis/tsup.config.bundled_r5u3e79sewr.mjs@@ -0,0 +1,15 @@+// tsup.config.ts+import { defineConfig } from "tsup";+var isProduction = process.env.NODE_ENV === "production";+var tsup_config_default = defineConfig({+ clean: true,+ dts: true,+ entry: ["src/index.ts"],+ format: ["cjs", "esm"],+ minify: isProduction,+ sourcemap: true+});+export {+ tsup_config_default as default+};+//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidHN1cC5jb25maWcudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9faW5qZWN0ZWRfZmlsZW5hbWVfXyA9IFwiL1VzZXJzL2JiYXJiaW4vQ29kZS9jYXJib24vcGFja2FnZXMvY2FyYm9uLXJlZGlzL3RzdXAuY29uZmlnLnRzXCI7Y29uc3QgX19pbmplY3RlZF9kaXJuYW1lX18gPSBcIi9Vc2Vycy9iYmFyYmluL0NvZGUvY2FyYm9uL3BhY2thZ2VzL2NhcmJvbi1yZWRpc1wiO2NvbnN0IF9faW5qZWN0ZWRfaW1wb3J0X21ldGFfdXJsX18gPSBcImZpbGU6Ly8vVXNlcnMvYmJhcmJpbi9Db2RlL2NhcmJvbi9wYWNrYWdlcy9jYXJib24tcmVkaXMvdHN1cC5jb25maWcudHNcIjtpbXBvcnQgeyBkZWZpbmVDb25maWcgfSBmcm9tIFwidHN1cFwiO1xuXG5jb25zdCBpc1Byb2R1Y3Rpb24gPSBwcm9jZXNzLmVudi5OT0RFX0VOViA9PT0gXCJwcm9kdWN0aW9uXCI7XG5cbmV4cG9ydCBkZWZhdWx0IGRlZmluZUNvbmZpZyh7XG4gIGNsZWFuOiB0cnVlLFxuICBkdHM6IHRydWUsXG4gIGVudHJ5OiBbXCJzcmMvaW5kZXgudHNcIl0sXG4gIGZvcm1hdDogW1wiY2pzXCIsIFwiZXNtXCJdLFxuICBtaW5pZnk6IGlzUHJvZHVjdGlvbixcbiAgc291cmNlbWFwOiB0cnVlLFxufSk7XG4iXSwKICAibWFwcGluZ3MiOiAiO0FBQThSLFNBQVMsb0JBQW9CO0FBRTNULElBQU0sZUFBZSxRQUFRLElBQUksYUFBYTtBQUU5QyxJQUFPLHNCQUFRLGFBQWE7QUFBQSxFQUMxQixPQUFPO0FBQUEsRUFDUCxLQUFLO0FBQUEsRUFDTCxPQUFPLENBQUMsY0FBYztBQUFBLEVBQ3RCLFFBQVEsQ0FBQyxPQUFPLEtBQUs7QUFBQSxFQUNyQixRQUFRO0FBQUEsRUFDUixXQUFXO0FBQ2IsQ0FBQzsiLAogICJuYW1lcyI6IFtdCn0Kdiff --git a/docs/.eslintrc.js b/www/.eslintrc.jssimilarity index 100%rename from docs/.eslintrc.jsrename to www/.eslintrc.jsdiff --git a/docs/README.md b/www/README.mdsimilarity index 95%rename from docs/README.mdrename to www/README.mdindex 4d87288ff2..95d81fcfbd 100644--- a/docs/README.md+++ b/www/README.md@@ -9,5 +9,5 @@ After reading the documentation, you should have enough knowledge to modify a moFrom the root repo run:```bash-$ yarn dev:docs+$ yarn dev:www```diff --git a/docs/components/features.tsx b/www/components/features.tsxsimilarity index 100%rename from docs/components/features.tsxrename to www/components/features.tsxdiff --git a/docs/components/index.ts b/www/components/index.tssimilarity index 100%rename from docs/components/index.tsrename to www/components/index.tsdiff --git a/www/components/pages/Home.tsx b/www/components/pages/Home.tsxnew file mode 100644index 0000000000..13e100c583--- /dev/null+++ b/www/components/pages/Home.tsx@@ -0,0 +1,47 @@+import React from "react";+import Head from "next/head";+import Features from "../features";++export default function Home() {+ return (+ <>+ <Head>+ <title>Carbon ERP</title>+ <meta+ name="og:description"+ content="Carbon ERP is an open source high performance ERP for manufacturing."+ />+ </Head>++ <div className="px-4 py-16 mx-auto sm:pt-20 sm:pb-24 lg:max-w-7xl lg:pt-24">+ <div className="flex flex-col justify-between text-center">+ <div>+ <h1 className="max-w-5xl mx-auto nx-text-6xl font-extrabold tracking-tighter leading-[1.1] text-6xl sm:text-7xl lg:nx-text-8xl xl:nx-text-8xl">+ ERP + <span className="pr-1 inline-block text-transparent bg-clip-text bg-gradient-to-r from-green-500 to-blue-500 ">+ for the builders+ </span>+ </h1>+ <p className="mt-6 nx-text-xl font-medium leading-tight text-gray-400 sm:nx-text-2xl md:nx-text-3xl lg:nx-text-4xl">+ Carbon ERP is an open source high performance ERP for+ manufacturers.+ </p>+ </div>+ </div>+ </div>++ <div className="relative from-gray-50 to-gray-100">+ <div className="px-4 py-16 mx-auto sm:pt-20 sm:pb-24 lg:max-w-7xl lg:pt-24">+ <h2 className="nx-text-4xl font-extrabold tracking-tight lg:nx-text-5xl xl:nx-text-6xl lg:text-center dark:text-white">+ Fully customizable and extensible+ </h2>+ <p className="mx-auto mt-4 text-lg font-medium text-gray-400 lg:max-w-3xl lg:text-xl lg:text-center">+ We've taken the best of modern, open-source technology and combined+ it into a lightning-fast, easy-to-use, open-source ERP system.+ </p>+ <Features />+ </div>+ </div>+ </>+ );+}diff --git a/docs/next-env.d.ts b/www/next-env.d.tssimilarity index 100%rename from docs/next-env.d.tsrename to www/next-env.d.tsdiff --git a/docs/next.config.js b/www/next.config.jssimilarity index 100%rename from docs/next.config.jsrename to www/next.config.jsdiff --git a/docs/package.json b/www/package.jsonsimilarity index 97%rename from docs/package.jsonrename to www/package.jsonindex d546f6b439..938f54b253 100644--- a/docs/package.json+++ b/www/package.json@@ -1,5 +1,5 @@{- "name": "docs",+ "name": "www","version": "0.0.0","private": true,"scripts": {diff --git a/docs/pages/_app.tsx b/www/pages/_app.tsxsimilarity index 100%rename from docs/pages/_app.tsxrename to www/pages/_app.tsxdiff --git a/www/pages/_meta.json b/www/pages/_meta.jsonnew file mode 100644index 0000000000..10ca8b2e2c--- /dev/null+++ b/www/pages/_meta.json@@ -0,0 +1,16 @@+{+ "*": {+ "type": "page"+ },+ "index": {+ "title": "Home",+ "type": "page",+ "display": "hidden",+ "theme": {+ "layout": "raw",+ "sidebar": false,+ "toc": true+ }+ },+ "docs": "Docs"+}diff --git a/docs/pages/_meta.json b/www/pages/docs/_meta.jsonsimilarity index 100%rename from docs/pages/_meta.jsonrename to www/pages/docs/_meta.jsondiff --git a/docs/pages/core-concepts/_meta.json b/www/pages/docs/core-concepts/_meta.jsonsimilarity index 100%rename from docs/pages/core-concepts/_meta.jsonrename to www/pages/docs/core-concepts/_meta.jsondiff --git a/docs/pages/getting-started.mdx b/www/pages/docs/getting-started.mdxsimilarity index 98%rename from docs/pages/getting-started.mdxrename to www/pages/docs/getting-started.mdxindex 11be163b1d..42c294a0d7 100644--- a/docs/pages/getting-started.mdx+++ b/www/pages/docs/getting-started.mdx@@ -5,7 +5,7 @@ description: Carbon ERP is a high-performance, open-source ERP for manufacturing# Getting Started-Before getting started with development, it's good to have a basic understanding of our [tech stack](/stack)+Before getting started with development, it's good to have a basic understanding of our [tech stack](/stack).You'll also need to have [Docker installed](https://docs.docker.com/desktop/install/mac-install/) and [yarn installed](https://yarnpkg.com/lang/en/docs/install/#debian-stable)on your system since this monorepo uses the yarn package manager.diff --git a/docs/pages/index.mdx b/www/pages/docs/index.mdxsimilarity index 97%rename from docs/pages/index.mdxrename to www/pages/docs/index.mdxindex be807e216b..96f0033c2f 100644--- a/docs/pages/index.mdx+++ b/www/pages/docs/index.mdx@@ -3,7 +3,7 @@ title: What is Carbon ERP?description: Carbon ERP is a high-performance, open-source ERP for manufacturing.----import { Features } from "../components";+import { Features } from "../../components";# Carbon ERPdiff --git a/docs/pages/principles/_meta.json b/www/pages/docs/principles/_meta.jsonsimilarity index 74%rename from docs/pages/principles/_meta.jsonrename to www/pages/docs/principles/_meta.jsonindex cd99813538..26efabd18d 100644--- a/docs/pages/principles/_meta.json+++ b/www/pages/docs/principles/_meta.json@@ -1,5 +1,6 @@{"simplicity": "Simple",+ "extensiblity": "Extensible","open-source": "Open Source","productivity": "Productive"}diff --git a/www/pages/index.mdx b/www/pages/index.mdxnew file mode 100644index 0000000000..115217e62c--- /dev/null+++ b/www/pages/index.mdx@@ -0,0 +1,7 @@+---+title: Carbon ERP | An open source high performance ERP for manufacturing+---++import Home from "../components/pages/Home";++<Home />diff --git a/docs/postcss.config.js b/www/postcss.config.jssimilarity index 100%rename from docs/postcss.config.jsrename to www/postcss.config.jsdiff --git a/docs/public/favicon.ico b/www/public/favicon.icosimilarity index 100%rename from docs/public/favicon.icorename to www/public/favicon.icodiff --git a/docs/public/logo-dark.png b/www/public/logo-dark.pngsimilarity index 100%rename from docs/public/logo-dark.pngrename to www/public/logo-dark.pngdiff --git a/docs/public/logo-light.png b/www/public/logo-light.pngsimilarity index 100%rename from docs/public/logo-light.pngrename to www/public/logo-light.pngdiff --git a/docs/styles.css b/www/styles.csssimilarity index 100%rename from docs/styles.cssrename to www/styles.cssdiff --git a/docs/tailwind.config.js b/www/tailwind.config.jssimilarity index 100%rename from docs/tailwind.config.jsrename to www/tailwind.config.jsdiff --git a/docs/theme.config.js b/www/theme.config.jssimilarity index 88%rename from docs/theme.config.jsrename to www/theme.config.jsindex 8100dc788b..d6c056c77d 100644--- a/docs/theme.config.js+++ b/www/theme.config.js@@ -17,12 +17,14 @@ export default {project: {link: "https://github.com/barbinbrad/carbon", // GitHub link in the navbar},- docsRepositoryBase:- "https://github.com/barbinbrad/carbon/blob/main/apps/docs", // base URL for the docs repository+ docsRepositoryBase: "https://github.com/barbinbrad/carbon/blob/main/apps/www", // base URL for the docs repositorynavigation: {next: true,prev: true,},+ sidebar: {+ defaultMenuCollapseLevel: 1,+ },darkMode: true,footer: {text: `Carbon ERP ${new Date().getFullYear()}. All rights reserved.`,diff --git a/docs/tsconfig.json b/www/tsconfig.jsonsimilarity index 100%rename from docs/tsconfig.jsonrename to www/tsconfig.jsondiff --git a/docs/vercel.json b/www/vercel.jsonsimilarity index 100%rename from docs/vercel.jsonrename to www/vercel.json