Skip to content

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

feat/white-label

Brad Barbin78d5c91b4ab8
diff --git a/apps/carbon/app/components/Layout/Topbar/Create.tsx b/apps/carbon/app/components/Layout/Topbar/CreateMenu.tsx
similarity index 93%
rename from apps/carbon/app/components/Layout/Topbar/Create.tsx
rename to apps/carbon/app/components/Layout/Topbar/CreateMenu.tsx
index f77f44d106..70a14a789a 100644
--- a/apps/carbon/app/components/Layout/Topbar/Create.tsx
+++ b/apps/carbon/app/components/Layout/Topbar/CreateMenu.tsx
@@ -9,7 +9,7 @@ import {
import { Link } from "@remix-run/react";
import useCreate from "./useCreate";
-const Create = () => {
+const CreateMenu = () => {
const createLinks = useCreate();
if (!createLinks.length) return null;
@@ -33,4 +33,4 @@ const Create = () => {
);
};
-export default Create;
+export default CreateMenu;
diff --git a/apps/carbon/app/components/Layout/Topbar/HelpMenu.tsx b/apps/carbon/app/components/Layout/Topbar/HelpMenu.tsx
new file mode 100644
index 0000000000..ac47cf2e98
--- /dev/null
+++ b/apps/carbon/app/components/Layout/Topbar/HelpMenu.tsx
@@ -0,0 +1,44 @@
+import {
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuIcon,
+ DropdownMenuItem,
+ DropdownMenuTrigger,
+ IconButton,
+} from "@carbon/react";
+import { BiHelpCircle } from "react-icons/bi";
+import { BsChatSquare } from "react-icons/bs";
+
+const HelpMenu = () => {
+ return (
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild>
+ <IconButton aria-label="Help" icon={<BiHelpCircle />} variant="ghost" />
+ </DropdownMenuTrigger>
+ <DropdownMenuContent align="end" className="w-48">
+ <DropdownMenuItem asChild>
+ <a
+ href="https://github.com/barbinbrad/carbon/issues/new/choose"
+ target="_blank"
+ rel="noreferrer"
+ >
+ <DropdownMenuIcon icon={<BiHelpCircle />} />
+ Help
+ </a>
+ </DropdownMenuItem>
+ <DropdownMenuItem asChild>
+ <a
+ href="https://github.com/barbinbrad/carbon/discussions/new/choose"
+ target="_blank"
+ rel="noreferrer"
+ >
+ <DropdownMenuIcon icon={<BsChatSquare />} />
+ Feedback
+ </a>
+ </DropdownMenuItem>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ );
+};
+
+export default HelpMenu;
diff --git a/apps/carbon/app/components/Layout/Topbar/ModeSwitcher.tsx b/apps/carbon/app/components/Layout/Topbar/ModeSwitcher.tsx
new file mode 100644
index 0000000000..f813019f1e
--- /dev/null
+++ b/apps/carbon/app/components/Layout/Topbar/ModeSwitcher.tsx
@@ -0,0 +1,32 @@
+import { IconButton } from "@carbon/react";
+import { useFetcher } from "@remix-run/react";
+import { BiLaptop, BiMoon, BiSun } from "react-icons/bi";
+import { useMode } from "~/hooks/useMode";
+import type { action } from "~/root";
+import { path } from "~/utils/path";
+
+const ModeSwitcher = () => {
+ const mode = useMode();
+ const nextMode = mode === "light" ? "dark" : "light";
+ const modeLabel = {
+ light: <BiSun />,
+ dark: <BiMoon />,
+ system: <BiLaptop />,
+ };
+
+ const fetcher = useFetcher<typeof action>();
+
+ return (
+ <fetcher.Form action={path.to.root} method="post">
+ <input type="hidden" name="mode" value={nextMode} />
+ <IconButton
+ icon={modeLabel[mode]}
+ aria-label="Light Mode"
+ variant="ghost"
+ type="submit"
+ />
+ </fetcher.Form>
+ );
+};
+
+export default ModeSwitcher;
diff --git a/apps/carbon/app/components/Layout/Topbar/Topbar.tsx b/apps/carbon/app/components/Layout/Topbar/Topbar.tsx
index 43cae32c79..afe57b4c36 100644
--- a/apps/carbon/app/components/Layout/Topbar/Topbar.tsx
+++ b/apps/carbon/app/components/Layout/Topbar/Topbar.tsx
@@ -1,10 +1,10 @@
-import { Button, HStack } from "@carbon/react";
-import { BiHelpCircle } from "react-icons/bi";
-import { BsChatSquare } from "react-icons/bs";
+import { HStack } from "@carbon/react";
import { Search } from "~/components/Search";
import AvatarMenu from "./AvatarMenu";
import Breadcrumbs from "./Breadcrumbs";
-import Create from "./Create";
+import CreateMenu from "./CreateMenu";
+import HelpMenu from "./HelpMenu";
+import ModeSwitcher from "./ModeSwitcher";
const Topbar = () => {
return (
@@ -12,25 +12,9 @@ const Topbar = () => {
<Breadcrumbs />
<Search />
<HStack spacing={1} className="justify-end py-2">
- <Create />
- <Button asChild leftIcon={<BiHelpCircle />} variant="secondary">
- <a
- target="_blank"
- href="https://github.com/barbinbrad/carbon/issues/new/choose"
- rel="noreferrer"
- >
- Help
- </a>
- </Button>
- <Button asChild leftIcon={<BsChatSquare />} variant="secondary">
- <a
- target="_blank"
- href="https://github.com/barbinbrad/carbon/discussions/new/choose"
- rel="noreferrer"
- >
- Feedback
- </a>
- </Button>
+ <CreateMenu />
+ <HelpMenu />
+ <ModeSwitcher />
<AvatarMenu />
</HStack>
</div>
diff --git a/apps/carbon/app/hooks/useMode.tsx b/apps/carbon/app/hooks/useMode.tsx
new file mode 100644
index 0000000000..a810cc4cf4
--- /dev/null
+++ b/apps/carbon/app/hooks/useMode.tsx
@@ -0,0 +1,32 @@
+import { useFetchers } from "@remix-run/react";
+import type { Mode } from "~/types/validators";
+import { modeValidator } from "~/types/validators";
+import { path } from "~/utils/path";
+import { useRouteData } from "./useRouteData";
+
+export function useOptimisticMode() {
+ const fetchers = useFetchers();
+ const modeFetcher = fetchers.find((f) => f.formAction === "/");
+
+ if (modeFetcher && modeFetcher.formData) {
+ const mode = { mode: modeFetcher.formData.get("mode") };
+ const submission = modeValidator.safeParse(mode);
+
+ if (submission.success) {
+ return submission.data.mode;
+ }
+ }
+}
+
+export function useMode() {
+ const optimisticMode = useOptimisticMode();
+ const routeData = useRouteData<{ mode: Mode }>(path.to.root);
+
+ let mode = routeData?.mode ?? "light";
+
+ if (optimisticMode && optimisticMode !== "system") {
+ mode = optimisticMode;
+ }
+
+ return mode;
+}
diff --git a/apps/carbon/app/modules/settings/ui/Theme/ThemeForm.tsx b/apps/carbon/app/modules/settings/ui/Theme/ThemeForm.tsx
index 8869529eeb..223688e6f5 100644
--- a/apps/carbon/app/modules/settings/ui/Theme/ThemeForm.tsx
+++ b/apps/carbon/app/modules/settings/ui/Theme/ThemeForm.tsx
@@ -1,10 +1,11 @@
-import { Button, VStack, cn, useMount } from "@carbon/react";
+import { Button, VStack, cn } from "@carbon/react";
import type { Theme } from "@carbon/utils";
import { themes } from "@carbon/utils";
-import { useState } from "react";
+import { useEffect, useState } from "react";
import { RxCheck } from "react-icons/rx";
import { ValidatedForm } from "remix-validated-form";
import { Hidden, Submit } from "~/components/Form";
+import { useMode } from "~/hooks/useMode";
import type { Theme as ThemeValue } from "~/modules/settings";
import { themeValidator } from "~/modules/settings";
import type { TypeOfValidator } from "~/types/validators";
@@ -16,22 +17,26 @@ type ThemeFormProps = {
const ThemeForm = ({ theme: defaultValues }: ThemeFormProps) => {
const [theme, setTheme] = useState<ThemeValue>(defaultValues.theme);
- const [isDark, setIsDark] = useState(false);
-
- useMount(() => {
- setIsDark(document.body.classList.contains("dark"));
- });
+ const mode = useMode();
const onThemeChange = (t: Theme) => {
setTheme(t.name);
- const variables = isDark ? t.cssVars.dark : t.cssVars.light;
+ const variables = mode === "dark" ? t.cssVars.dark : t.cssVars.light;
Object.entries(variables).forEach(([key, value]) => {
document.body.style.setProperty(`--${key}`, value);
});
};
+ useEffect(() => {
+ const t = themes.find((t) => t.name === theme);
+ if (t) {
+ onThemeChange(t);
+ }
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [mode]);
+
return (
<div className="w-full">
<ValidatedForm
@@ -57,7 +62,7 @@ const ThemeForm = ({ theme: defaultValues }: ThemeFormProps) => {
style={
{
"--theme-primary": `hsl(${
- t?.activeColor[isDark ? "dark" : "light"]
+ t?.activeColor[mode === "dark" ? "dark" : "light"]
})`,
} as React.CSSProperties
}
diff --git a/apps/carbon/app/modules/users/users.server.ts b/apps/carbon/app/modules/users/users.server.ts
index c39028133e..41e4f5f471 100644
--- a/apps/carbon/app/modules/users/users.server.ts
+++ b/apps/carbon/app/modules/users/users.server.ts
@@ -18,7 +18,7 @@ import {
sendInviteByEmail,
sendMagicLink,
} from "~/services/auth";
-import { flash, requireAuthSession } from "~/services/session";
+import { flash, requireAuthSession } from "~/services/session.server";
import type { ListItem, Result } from "~/types";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/root.tsx b/apps/carbon/app/root.tsx
index a4fc894464..9d2718c595 100644
--- a/apps/carbon/app/root.tsx
+++ b/apps/carbon/app/root.tsx
@@ -1,6 +1,10 @@
// root.tsx
import { Heading } from "@carbon/react";
-import type { MetaFunction } from "@remix-run/node";
+import type {
+ ActionFunctionArgs,
+ LoaderFunctionArgs,
+ MetaFunction,
+} from "@remix-run/node";
import { json } from "@remix-run/node";
import {
Links,
@@ -13,13 +17,17 @@ import {
useLoaderData,
useRouteError,
} from "@remix-run/react";
+import { withZod } from "@remix-validated-form/with-zod";
import { Analytics } from "@vercel/analytics/react";
import React from "react";
import { getBrowserEnv } from "~/config/env";
-
+import { getMode, setMode } from "~/services/mode.server";
import Background from "~/styles/background.css";
import NProgress from "~/styles/nprogress.css";
import Tailwind from "~/styles/tailwind.css";
+import { error } from "~/utils/result";
+import { useMode } from "./hooks/useMode";
+import { modeValidator } from "./types/validators";
export function links() {
return [
@@ -44,25 +52,47 @@ export const meta: MetaFunction = () => {
];
};
-export async function loader() {
+export async function loader({ request }: LoaderFunctionArgs) {
const { SUPABASE_API_URL, SUPABASE_ANON_PUBLIC } = getBrowserEnv();
return json({
env: {
SUPABASE_API_URL,
SUPABASE_ANON_PUBLIC,
},
+ mode: getMode(request),
});
}
+export async function action({ request }: ActionFunctionArgs) {
+ const validation = await withZod(modeValidator).validate(
+ await request.formData()
+ );
+
+ if (validation.error) {
+ return json(error(validation.error, "Invalid mode"), {
+ status: 400,
+ });
+ }
+
+ return json(
+ {},
+ {
+ headers: { "Set-Cookie": setMode(validation.data.mode) },
+ }
+ );
+}
+
function Document({
children,
title = "Carbon ERP",
+ mode = "light",
}: {
children: React.ReactNode;
title?: string;
+ mode?: "light" | "dark";
}) {
return (
- <html lang="en">
+ <html lang="en" className={`${mode} h-full overflow-x-hidden`}>
<head>
<Meta />
<title>{title}</title>
@@ -83,8 +113,10 @@ export default function App() {
const loaderData = useLoaderData<typeof loader>();
const env = loaderData?.env ?? {};
+ const mode = useMode();
+
return (
- <Document>
+ <Document mode={mode}>
<Outlet />
<script
dangerouslySetInnerHTML={{
diff --git a/apps/carbon/app/routes/_public+/callback.tsx b/apps/carbon/app/routes/_public+/callback.tsx
index fecefc5e68..b29432107f 100644
--- a/apps/carbon/app/routes/_public+/callback.tsx
+++ b/apps/carbon/app/routes/_public+/callback.tsx
@@ -6,13 +6,13 @@ import { useFetcher } from "@remix-run/react";
import { getSupabase } from "~/lib/supabase";
import { getUserByEmail } from "~/modules/users/users.server";
import { refreshAccessToken } from "~/services/auth";
-import { callbackValidator } from "~/services/auth/auth.form";
+import { callbackValidator } from "~/services/auth/auth.models";
import {
commitAuthSession,
destroyAuthSession,
flash,
getAuthSession,
-} from "~/services/session";
+} from "~/services/session.server";
import type { FormActionData } from "~/types";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/routes/_public+/forgot-password.tsx b/apps/carbon/app/routes/_public+/forgot-password.tsx
index 950283997a..659e21a0d5 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 { getUserByEmail } from "~/modules/users/users.server";
import { forgotPasswordValidator, sendMagicLink } from "~/services/auth";
-import { getAuthSession } from "~/services/session";
+import { getAuthSession } from "~/services/session.server";
import type { FormActionData, Result } from "~/types";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/routes/_public+/login.tsx b/apps/carbon/app/routes/_public+/login.tsx
index 8505ad0d8f..314812096e 100644
--- a/apps/carbon/app/routes/_public+/login.tsx
+++ b/apps/carbon/app/routes/_public+/login.tsx
@@ -15,7 +15,7 @@ import {
signInWithEmail,
verifyAuthSession,
} from "~/services/auth";
-import { createAuthSession, getAuthSession } from "~/services/session";
+import { createAuthSession, getAuthSession } from "~/services/session.server";
import type { FormActionData, Result } from "~/types";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/routes/_public+/logout.tsx b/apps/carbon/app/routes/_public+/logout.tsx
index 728283058b..264baa9e5c 100644
--- a/apps/carbon/app/routes/_public+/logout.tsx
+++ b/apps/carbon/app/routes/_public+/logout.tsx
@@ -1,7 +1,7 @@
import type { ActionFunctionArgs } from "@remix-run/node";
import { redirect } from "@remix-run/node";
-import { destroyAuthSession } from "~/services/session";
+import { destroyAuthSession } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/routes/_public+/refresh-session.tsx b/apps/carbon/app/routes/_public+/refresh-session.tsx
index e8de057062..5016fef9bf 100644
--- a/apps/carbon/app/routes/_public+/refresh-session.tsx
+++ b/apps/carbon/app/routes/_public+/refresh-session.tsx
@@ -2,7 +2,10 @@ import type { ActionFunctionArgs } from "@remix-run/node";
import { json } from "@remix-run/node";
import { useNavigate } from "@remix-run/react";
-import { commitAuthSession, refreshAuthSession } from "~/services/session";
+import {
+ commitAuthSession,
+ refreshAuthSession,
+} from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/routes/_public+/reset-password.tsx b/apps/carbon/app/routes/_public+/reset-password.tsx
index 6e190809ca..1702442f22 100644
--- a/apps/carbon/app/routes/_public+/reset-password.tsx
+++ b/apps/carbon/app/routes/_public+/reset-password.tsx
@@ -7,7 +7,7 @@ import { ValidatedForm, validationError } from "remix-validated-form";
import { Password, Submit } from "~/components/Form";
import { resetPassword } from "~/modules/users/users.server";
import { resetPasswordValidator } from "~/services/auth";
-import { flash, requireAuthSession } from "~/services/session";
+import { flash, requireAuthSession } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/api+/accounting.subcategories.ts b/apps/carbon/app/routes/api+/accounting.subcategories.ts
index 021fae002e..9762e06b60 100644
--- a/apps/carbon/app/routes/api+/accounting.subcategories.ts
+++ b/apps/carbon/app/routes/api+/accounting.subcategories.ts
@@ -2,7 +2,7 @@ import type { LoaderFunctionArgs } from "@remix-run/node";
import { json } from "@remix-run/node";
import { getAccountSubcategoriesByCategory } from "~/modules/accounting";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { error } from "~/utils/result";
export async function loader({ request }: LoaderFunctionArgs) {
diff --git a/apps/carbon/app/routes/api+/parts.list.ts b/apps/carbon/app/routes/api+/parts.list.ts
index 3b191478c0..f440f46345 100644
--- a/apps/carbon/app/routes/api+/parts.list.ts
+++ b/apps/carbon/app/routes/api+/parts.list.ts
@@ -3,7 +3,7 @@ import { json } from "@remix-run/node";
import type { PartReplenishmentSystem } from "~/modules/parts";
import { getPartsList } from "~/modules/parts";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { error } from "~/utils/result";
export async function loader({ request }: LoaderFunctionArgs) {
diff --git a/apps/carbon/app/routes/api+/parts.services.ts b/apps/carbon/app/routes/api+/parts.services.ts
index 28035d1359..aa6805b5c8 100644
--- a/apps/carbon/app/routes/api+/parts.services.ts
+++ b/apps/carbon/app/routes/api+/parts.services.ts
@@ -3,7 +3,7 @@ import { json } from "@remix-run/node";
import type { ServiceType } from "~/modules/parts";
import { getServicesList } from "~/modules/parts";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { error } from "~/utils/result";
export async function loader({ request }: LoaderFunctionArgs) {
diff --git a/apps/carbon/app/routes/api+/purchasing.supplier-contacts.ts b/apps/carbon/app/routes/api+/purchasing.supplier-contacts.ts
index 0cd5cb9593..24cbc602ce 100644
--- a/apps/carbon/app/routes/api+/purchasing.supplier-contacts.ts
+++ b/apps/carbon/app/routes/api+/purchasing.supplier-contacts.ts
@@ -2,7 +2,7 @@ import type { LoaderFunctionArgs } from "@remix-run/node";
import { json } from "@remix-run/node";
import { getSupplierContacts } from "~/modules/purchasing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { error } from "~/utils/result";
export async function loader({ request }: LoaderFunctionArgs) {
diff --git a/apps/carbon/app/routes/api+/purchasing.supplier-locations.ts b/apps/carbon/app/routes/api+/purchasing.supplier-locations.ts
index c7bad7bac3..9aae46c35e 100644
--- a/apps/carbon/app/routes/api+/purchasing.supplier-locations.ts
+++ b/apps/carbon/app/routes/api+/purchasing.supplier-locations.ts
@@ -2,7 +2,7 @@ import type { LoaderFunctionArgs } from "@remix-run/node";
import { json } from "@remix-run/node";
import { getSupplierLocations } from "~/modules/purchasing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { error } from "~/utils/result";
export async function loader({ request }: LoaderFunctionArgs) {
diff --git a/apps/carbon/app/routes/api+/sales.customer-contacts.ts b/apps/carbon/app/routes/api+/sales.customer-contacts.ts
index 8c2d826353..d5817a9b9a 100644
--- a/apps/carbon/app/routes/api+/sales.customer-contacts.ts
+++ b/apps/carbon/app/routes/api+/sales.customer-contacts.ts
@@ -2,7 +2,7 @@ import type { LoaderFunctionArgs } from "@remix-run/node";
import { json } from "@remix-run/node";
import { getCustomerContacts } from "~/modules/sales";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { error } from "~/utils/result";
export async function loader({ request }: LoaderFunctionArgs) {
diff --git a/apps/carbon/app/routes/api+/sales.customer-locations.ts b/apps/carbon/app/routes/api+/sales.customer-locations.ts
index 8e798e8a2e..1bc9602ad0 100644
--- a/apps/carbon/app/routes/api+/sales.customer-locations.ts
+++ b/apps/carbon/app/routes/api+/sales.customer-locations.ts
@@ -2,7 +2,7 @@ import type { LoaderFunctionArgs } from "@remix-run/node";
import { json } from "@remix-run/node";
import { getCustomerLocations } from "~/modules/sales";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { error } from "~/utils/result";
export async function loader({ request }: LoaderFunctionArgs) {
diff --git a/apps/carbon/app/routes/api+/settings.sequence.next.ts b/apps/carbon/app/routes/api+/settings.sequence.next.ts
index b79b156417..da077096c5 100644
--- a/apps/carbon/app/routes/api+/settings.sequence.next.ts
+++ b/apps/carbon/app/routes/api+/settings.sequence.next.ts
@@ -2,7 +2,7 @@ import type { LoaderFunctionArgs } from "@remix-run/node";
import { json } from "@remix-run/node";
import { getNextSequence } from "~/modules/settings";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { error } from "~/utils/result";
export async function loader({ request }: LoaderFunctionArgs) {
diff --git a/apps/carbon/app/routes/api+/settings.sequence.rollback.ts b/apps/carbon/app/routes/api+/settings.sequence.rollback.ts
index 5ef7ce3783..d1e96d0bff 100644
--- a/apps/carbon/app/routes/api+/settings.sequence.rollback.ts
+++ b/apps/carbon/app/routes/api+/settings.sequence.rollback.ts
@@ -2,7 +2,7 @@ import type { ActionFunctionArgs } from "@remix-run/node";
import { json } from "@remix-run/node";
import { getCurrentSequence, rollbackNextSequence } from "~/modules/settings";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsDelete } from "~/utils/http";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/api+/users.empty-permissions.ts b/apps/carbon/app/routes/api+/users.empty-permissions.ts
index ddaca84bf0..15ec2c338f 100644
--- a/apps/carbon/app/routes/api+/users.empty-permissions.ts
+++ b/apps/carbon/app/routes/api+/users.empty-permissions.ts
@@ -3,7 +3,7 @@ import { json } from "@remix-run/node";
import { getFeatures } from "~/modules/users";
import { makeEmptyPermissionsFromFeatures } from "~/modules/users/users.server";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { error } from "~/utils/result";
export async function loader({ request }: LoaderFunctionArgs) {
diff --git a/apps/carbon/app/routes/api+/users.groups.tsx b/apps/carbon/app/routes/api+/users.groups.tsx
index 93bf25e1e0..8e83d622f4 100644
--- a/apps/carbon/app/routes/api+/users.groups.tsx
+++ b/apps/carbon/app/routes/api+/users.groups.tsx
@@ -3,7 +3,7 @@ import { json } from "@remix-run/node";
import { arrayToTree } from "performant-array-to-tree";
import type { Group } from "~/modules/users";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { error } from "~/utils/result";
export async function loader({ request }: LoaderFunctionArgs) {
diff --git a/apps/carbon/app/routes/index.tsx b/apps/carbon/app/routes/index.tsx
index d888e2d694..3a819cd2c5 100644
--- a/apps/carbon/app/routes/index.tsx
+++ b/apps/carbon/app/routes/index.tsx
@@ -1,6 +1,6 @@
import type { LoaderFunctionArgs } from "@remix-run/node";
import { redirect } from "@remix-run/node";
-import { requireAuthSession } from "~/services/session";
+import { requireAuthSession } from "~/services/session.server";
import { path } from "~/utils/path";
export async function loader({ request }: LoaderFunctionArgs) {
diff --git a/apps/carbon/app/routes/onboarding+/user.tsx b/apps/carbon/app/routes/onboarding+/user.tsx
index 8180389ce5..31f7a102f1 100644
--- a/apps/carbon/app/routes/onboarding+/user.tsx
+++ b/apps/carbon/app/routes/onboarding+/user.tsx
@@ -21,7 +21,7 @@ import {
} from "~/modules/account";
import { getUser } from "~/modules/users/users.server";
import { requirePermissions } from "~/services/auth";
-import { destroyAuthSession } from "~/services/session";
+import { destroyAuthSession } from "~/services/session.server";
import type { TypeOfValidator } from "~/types/validators";
import { assertIsPost } from "~/utils/http";
diff --git a/apps/carbon/app/routes/x+/_layout.tsx b/apps/carbon/app/routes/x+/_layout.tsx
index b090cff866..854bc5059c 100644
--- a/apps/carbon/app/routes/x+/_layout.tsx
+++ b/apps/carbon/app/routes/x+/_layout.tsx
@@ -18,7 +18,7 @@ import {
destroyAuthSession,
getSessionFlash,
requireAuthSession,
-} from "~/services/session";
+} from "~/services/session.server";
import { path } from "~/utils/path";
export async function loader({ request }: LoaderFunctionArgs) {
diff --git a/apps/carbon/app/routes/x+/account+/$userId.attribute.tsx b/apps/carbon/app/routes/x+/account+/$userId.attribute.tsx
index fa3ebf806d..0087be8d00 100644
--- a/apps/carbon/app/routes/x+/account+/$userId.attribute.tsx
+++ b/apps/carbon/app/routes/x+/account+/$userId.attribute.tsx
@@ -11,7 +11,7 @@ import {
import { getAttribute } from "~/modules/resources";
import { getUserClaims } from "~/modules/users/users.server";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
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.tsx
index af394637a7..11eeb1ce30 100644
--- a/apps/carbon/app/routes/x+/account+/$userId.delete.attribute.tsx
+++ b/apps/carbon/app/routes/x+/account+/$userId.delete.attribute.tsx
@@ -4,7 +4,7 @@ import { deleteUserAttributeValue } from "~/modules/account";
import { getAttribute } from "~/modules/resources";
import { getUserClaims } from "~/modules/users/users.server";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/account+/password.tsx b/apps/carbon/app/routes/x+/account+/password.tsx
index a2101da5c5..c97b5d6344 100644
--- a/apps/carbon/app/routes/x+/account+/password.tsx
+++ b/apps/carbon/app/routes/x+/account+/password.tsx
@@ -5,7 +5,7 @@ import { PageTitle } from "~/components/Layout";
import { getSupabaseServiceRole } from "~/lib/supabase";
import { PasswordForm, accountPasswordValidator } from "~/modules/account";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/routes/x+/account+/personal.tsx b/apps/carbon/app/routes/x+/account+/personal.tsx
index 31481d6cf9..8d5725c258 100644
--- a/apps/carbon/app/routes/x+/account+/personal.tsx
+++ b/apps/carbon/app/routes/x+/account+/personal.tsx
@@ -12,7 +12,7 @@ import { PageTitle } from "~/components/Layout";
import type { PrivateAttributes } from "~/modules/account";
import { UserAttributesForm, getPrivateAttributes } from "~/modules/account";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/account+/profile.tsx b/apps/carbon/app/routes/x+/account+/profile.tsx
index 8d23dbf005..5dc0afb7fe 100644
--- a/apps/carbon/app/routes/x+/account+/profile.tsx
+++ b/apps/carbon/app/routes/x+/account+/profile.tsx
@@ -21,7 +21,7 @@ import {
updatePublicAccount,
} from "~/modules/account";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/routes/x+/accounting+/_layout.tsx b/apps/carbon/app/routes/x+/accounting+/_layout.tsx
index 0964fdde79..ce8b4fdedb 100644
--- a/apps/carbon/app/routes/x+/accounting+/_layout.tsx
+++ b/apps/carbon/app/routes/x+/accounting+/_layout.tsx
@@ -9,7 +9,7 @@ import {
useAccountingSidebar,
} from "~/modules/accounting";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/accounting+/categories.$categoryId.tsx b/apps/carbon/app/routes/x+/accounting+/categories.$categoryId.tsx
index 7c81162aff..19a7d37189 100644
--- a/apps/carbon/app/routes/x+/accounting+/categories.$categoryId.tsx
+++ b/apps/carbon/app/routes/x+/accounting+/categories.$categoryId.tsx
@@ -9,7 +9,7 @@ import {
upsertAccountCategory,
} from "~/modules/accounting";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/accounting+/categories.delete.$categoryId.tsx b/apps/carbon/app/routes/x+/accounting+/categories.delete.$categoryId.tsx
index 9c310a98ef..909269f840 100644
--- a/apps/carbon/app/routes/x+/accounting+/categories.delete.$categoryId.tsx
+++ b/apps/carbon/app/routes/x+/accounting+/categories.delete.$categoryId.tsx
@@ -2,7 +2,7 @@ import type { LoaderFunctionArgs } from "@remix-run/node";
import { redirect } from "@remix-run/node";
import { deleteAccountCategory } from "~/modules/accounting";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/accounting+/categories.list.$categoryId.$subcategoryId.tsx b/apps/carbon/app/routes/x+/accounting+/categories.list.$categoryId.$subcategoryId.tsx
index 7d5556da74..e836bd4f62 100644
--- a/apps/carbon/app/routes/x+/accounting+/categories.list.$categoryId.$subcategoryId.tsx
+++ b/apps/carbon/app/routes/x+/accounting+/categories.list.$categoryId.$subcategoryId.tsx
@@ -6,7 +6,7 @@ import {
getAccountSubcategory,
} from "~/modules/accounting";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/accounting+/categories.list.$categoryId.new.tsx b/apps/carbon/app/routes/x+/accounting+/categories.list.$categoryId.new.tsx
index c81d1619d9..546f60a78e 100644
--- a/apps/carbon/app/routes/x+/accounting+/categories.list.$categoryId.new.tsx
+++ b/apps/carbon/app/routes/x+/accounting+/categories.list.$categoryId.new.tsx
@@ -1,15 +1,14 @@
import { useNavigate, useParams } from "@remix-run/react";
-import { AccountSubcategoryForm } from "~/modules/accounting";
+import { AccountSubcategoryForm ,
+ accountSubcategoryValidator,
+ upsertAccountSubcategory,
+} from "~/modules/accounting";
import type { ActionFunctionArgs } from "@remix-run/node";
import { json, redirect } from "@remix-run/node";
import { validationError } from "remix-validated-form";
-import {
- accountSubcategoryValidator,
- upsertAccountSubcategory,
-} from "~/modules/accounting";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/accounting+/categories.list.$categoryId.tsx b/apps/carbon/app/routes/x+/accounting+/categories.list.$categoryId.tsx
index 05e8a513f1..00d023b16e 100644
--- a/apps/carbon/app/routes/x+/accounting+/categories.list.$categoryId.tsx
+++ b/apps/carbon/app/routes/x+/accounting+/categories.list.$categoryId.tsx
@@ -8,7 +8,7 @@ import {
getAccountSubcategoriesByCategory,
} from "~/modules/accounting";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/accounting+/categories.new.tsx b/apps/carbon/app/routes/x+/accounting+/categories.new.tsx
index 3e7e7d1e55..985025a21f 100644
--- a/apps/carbon/app/routes/x+/accounting+/categories.new.tsx
+++ b/apps/carbon/app/routes/x+/accounting+/categories.new.tsx
@@ -9,7 +9,7 @@ import {
upsertAccountCategory,
} from "~/modules/accounting";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/accounting+/categories.tsx b/apps/carbon/app/routes/x+/accounting+/categories.tsx
index 129d17a1de..4557c5d471 100644
--- a/apps/carbon/app/routes/x+/accounting+/categories.tsx
+++ b/apps/carbon/app/routes/x+/accounting+/categories.tsx
@@ -8,7 +8,7 @@ import {
getAccountCategories,
} from "~/modules/accounting";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { getGenericQueryFilters } from "~/utils/query";
diff --git a/apps/carbon/app/routes/x+/accounting+/charts.$accountId.tsx b/apps/carbon/app/routes/x+/accounting+/charts.$accountId.tsx
index bf802a92a5..8a73cf3b75 100644
--- a/apps/carbon/app/routes/x+/accounting+/charts.$accountId.tsx
+++ b/apps/carbon/app/routes/x+/accounting+/charts.$accountId.tsx
@@ -10,7 +10,7 @@ import {
upsertAccount,
} from "~/modules/accounting";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/accounting+/charts.delete.$accountId.tsx b/apps/carbon/app/routes/x+/accounting+/charts.delete.$accountId.tsx
index dcc0dde3ed..29c3313c60 100644
--- a/apps/carbon/app/routes/x+/accounting+/charts.delete.$accountId.tsx
+++ b/apps/carbon/app/routes/x+/accounting+/charts.delete.$accountId.tsx
@@ -4,7 +4,7 @@ import { useLoaderData, useNavigate, useParams } from "@remix-run/react";
import { ConfirmDelete } from "~/components/Modals";
import { deleteAccount, getAccount } from "~/modules/accounting";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/accounting+/charts.new.tsx b/apps/carbon/app/routes/x+/accounting+/charts.new.tsx
index 0f8aeb5ce7..373aff205e 100644
--- a/apps/carbon/app/routes/x+/accounting+/charts.new.tsx
+++ b/apps/carbon/app/routes/x+/accounting+/charts.new.tsx
@@ -13,7 +13,7 @@ import {
upsertAccount,
} from "~/modules/accounting";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/accounting+/charts.tsx b/apps/carbon/app/routes/x+/accounting+/charts.tsx
index 75757c4999..dbedc71e53 100644
--- a/apps/carbon/app/routes/x+/accounting+/charts.tsx
+++ b/apps/carbon/app/routes/x+/accounting+/charts.tsx
@@ -5,7 +5,7 @@ import { Outlet, useLoaderData } from "@remix-run/react";
import { ChartOfAccountsTable, getChartOfAccounts } from "~/modules/accounting";
import ChartOfAccountsTableFilters from "~/modules/accounting/ui/ChartOfAccounts/ChartOfAccountsTableFilters";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/accounting+/currencies.$currencyId.tsx b/apps/carbon/app/routes/x+/accounting+/currencies.$currencyId.tsx
index a756586e63..af582b331e 100644
--- a/apps/carbon/app/routes/x+/accounting+/currencies.$currencyId.tsx
+++ b/apps/carbon/app/routes/x+/accounting+/currencies.$currencyId.tsx
@@ -10,7 +10,7 @@ import {
upsertCurrency,
} from "~/modules/accounting";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/accounting+/currencies.delete.$currencyId.tsx b/apps/carbon/app/routes/x+/accounting+/currencies.delete.$currencyId.tsx
index 89d70ac40c..6d583e9974 100644
--- a/apps/carbon/app/routes/x+/accounting+/currencies.delete.$currencyId.tsx
+++ b/apps/carbon/app/routes/x+/accounting+/currencies.delete.$currencyId.tsx
@@ -4,7 +4,7 @@ import { useLoaderData, useNavigate, useParams } from "@remix-run/react";
import { ConfirmDelete } from "~/components/Modals";
import { deleteCurrency, getCurrency } from "~/modules/accounting";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/accounting+/currencies.new.tsx b/apps/carbon/app/routes/x+/accounting+/currencies.new.tsx
index 4aa2de56e5..e237647107 100644
--- a/apps/carbon/app/routes/x+/accounting+/currencies.new.tsx
+++ b/apps/carbon/app/routes/x+/accounting+/currencies.new.tsx
@@ -7,7 +7,7 @@ import {
upsertCurrency,
} from "~/modules/accounting";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/accounting+/defaults.tsx b/apps/carbon/app/routes/x+/accounting+/defaults.tsx
index 66f4bf35f8..ef3d11a726 100644
--- a/apps/carbon/app/routes/x+/accounting+/defaults.tsx
+++ b/apps/carbon/app/routes/x+/accounting+/defaults.tsx
@@ -13,7 +13,7 @@ import {
updateDefaultAccounts,
} from "~/modules/accounting";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/routes/x+/accounting+/groups.inventory.tsx b/apps/carbon/app/routes/x+/accounting+/groups.inventory.tsx
index e5083cc777..96b5cad016 100644
--- a/apps/carbon/app/routes/x+/accounting+/groups.inventory.tsx
+++ b/apps/carbon/app/routes/x+/accounting+/groups.inventory.tsx
@@ -12,7 +12,7 @@ import {
import { getPartGroupsList } from "~/modules/parts";
import { getLocationsList } from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { getGenericQueryFilters } from "~/utils/query";
diff --git a/apps/carbon/app/routes/x+/accounting+/groups.purchasing.tsx b/apps/carbon/app/routes/x+/accounting+/groups.purchasing.tsx
index 48fddd8d63..efb0b8c8eb 100644
--- a/apps/carbon/app/routes/x+/accounting+/groups.purchasing.tsx
+++ b/apps/carbon/app/routes/x+/accounting+/groups.purchasing.tsx
@@ -12,7 +12,7 @@ import {
import { getPartGroupsList } from "~/modules/parts";
import { getSupplierTypesList } from "~/modules/purchasing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { getGenericQueryFilters } from "~/utils/query";
diff --git a/apps/carbon/app/routes/x+/accounting+/groups.sales.tsx b/apps/carbon/app/routes/x+/accounting+/groups.sales.tsx
index f6bbe5f23a..e9040165be 100644
--- a/apps/carbon/app/routes/x+/accounting+/groups.sales.tsx
+++ b/apps/carbon/app/routes/x+/accounting+/groups.sales.tsx
@@ -12,7 +12,7 @@ import {
import { getPartGroupsList } from "~/modules/parts";
import { getCustomerTypesList } from "~/modules/sales";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { getGenericQueryFilters } from "~/utils/query";
diff --git a/apps/carbon/app/routes/x+/accounting+/payment-terms.$paymentTermId.tsx b/apps/carbon/app/routes/x+/accounting+/payment-terms.$paymentTermId.tsx
index cbc1d76174..e7a74fdb84 100644
--- a/apps/carbon/app/routes/x+/accounting+/payment-terms.$paymentTermId.tsx
+++ b/apps/carbon/app/routes/x+/accounting+/payment-terms.$paymentTermId.tsx
@@ -4,13 +4,13 @@ import { useLoaderData } from "@remix-run/react";
import { validationError } from "remix-validated-form";
import type { PaymentTermCalculationMethod } from "~/modules/accounting";
import {
- getPaymentTerm,
PaymentTermForm,
+ getPaymentTerm,
paymentTermValidator,
upsertPaymentTerm,
} from "~/modules/accounting";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/accounting+/payment-terms.delete.$paymentTermId.tsx b/apps/carbon/app/routes/x+/accounting+/payment-terms.delete.$paymentTermId.tsx
index 7fb52284a1..340c7e728e 100644
--- a/apps/carbon/app/routes/x+/accounting+/payment-terms.delete.$paymentTermId.tsx
+++ b/apps/carbon/app/routes/x+/accounting+/payment-terms.delete.$paymentTermId.tsx
@@ -4,7 +4,7 @@ import { useLoaderData, useNavigate, useParams } from "@remix-run/react";
import { ConfirmDelete } from "~/components/Modals";
import { deletePaymentTerm, getPaymentTerm } from "~/modules/accounting";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/accounting+/payment-terms.new.tsx b/apps/carbon/app/routes/x+/accounting+/payment-terms.new.tsx
index 5925947d10..64ac4eb422 100644
--- a/apps/carbon/app/routes/x+/accounting+/payment-terms.new.tsx
+++ b/apps/carbon/app/routes/x+/accounting+/payment-terms.new.tsx
@@ -8,7 +8,7 @@ import {
upsertPaymentTerm,
} from "~/modules/accounting";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/accounting+/subcategory.$subcategoryId.tsx b/apps/carbon/app/routes/x+/accounting+/subcategory.$subcategoryId.tsx
index 5148a8f581..d52099e557 100644
--- a/apps/carbon/app/routes/x+/accounting+/subcategory.$subcategoryId.tsx
+++ b/apps/carbon/app/routes/x+/accounting+/subcategory.$subcategoryId.tsx
@@ -6,7 +6,7 @@ import {
upsertAccountSubcategory,
} from "~/modules/accounting";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/accounting+/subcategory.delete.$subcategoryId.tsx b/apps/carbon/app/routes/x+/accounting+/subcategory.delete.$subcategoryId.tsx
index a6f6b80c92..2a4d012bff 100644
--- a/apps/carbon/app/routes/x+/accounting+/subcategory.delete.$subcategoryId.tsx
+++ b/apps/carbon/app/routes/x+/accounting+/subcategory.delete.$subcategoryId.tsx
@@ -2,7 +2,7 @@ import type { LoaderFunctionArgs } from "@remix-run/node";
import { redirect } from "@remix-run/node";
import { deleteAccountSubcategory } from "~/modules/accounting";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/accounting+/years.tsx b/apps/carbon/app/routes/x+/accounting+/years.tsx
index d5e739c562..61893e109c 100644
--- a/apps/carbon/app/routes/x+/accounting+/years.tsx
+++ b/apps/carbon/app/routes/x+/accounting+/years.tsx
@@ -11,7 +11,7 @@ import {
updateFiscalYearSettings,
} from "~/modules/accounting";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/routes/x+/customer+/$customerId.contacts.$customerContactId.tsx b/apps/carbon/app/routes/x+/customer+/$customerId.contacts.$customerContactId.tsx
index cb59b9d98d..888b83d457 100644
--- a/apps/carbon/app/routes/x+/customer+/$customerId.contacts.$customerContactId.tsx
+++ b/apps/carbon/app/routes/x+/customer+/$customerId.contacts.$customerContactId.tsx
@@ -9,7 +9,7 @@ import {
updateCustomerContact,
} from "~/modules/sales";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, badRequest, notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/customer+/$customerId.contacts.delete.$customerContactId.tsx b/apps/carbon/app/routes/x+/customer+/$customerId.contacts.delete.$customerContactId.tsx
index 810aae3d78..52e2130961 100644
--- a/apps/carbon/app/routes/x+/customer+/$customerId.contacts.delete.$customerContactId.tsx
+++ b/apps/carbon/app/routes/x+/customer+/$customerId.contacts.delete.$customerContactId.tsx
@@ -2,7 +2,7 @@ import type { ActionFunctionArgs } from "@remix-run/node";
import { redirect } from "@remix-run/node";
import { deleteCustomerContact } from "~/modules/sales";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/customer+/$customerId.contacts.new.tsx b/apps/carbon/app/routes/x+/customer+/$customerId.contacts.new.tsx
index 54e8143496..7f8eabe428 100644
--- a/apps/carbon/app/routes/x+/customer+/$customerId.contacts.new.tsx
+++ b/apps/carbon/app/routes/x+/customer+/$customerId.contacts.new.tsx
@@ -8,7 +8,7 @@ import {
insertCustomerContact,
} from "~/modules/sales";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/customer+/$customerId.contacts.tsx b/apps/carbon/app/routes/x+/customer+/$customerId.contacts.tsx
index c4ab88c11e..ac79ce8cf3 100644
--- a/apps/carbon/app/routes/x+/customer+/$customerId.contacts.tsx
+++ b/apps/carbon/app/routes/x+/customer+/$customerId.contacts.tsx
@@ -3,7 +3,7 @@ import { json, redirect } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
import { CustomerContacts, getCustomerContacts } from "~/modules/sales";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/customer+/$customerId.index.tsx b/apps/carbon/app/routes/x+/customer+/$customerId.index.tsx
index c131655ab2..eb15746965 100644
--- a/apps/carbon/app/routes/x+/customer+/$customerId.index.tsx
+++ b/apps/carbon/app/routes/x+/customer+/$customerId.index.tsx
@@ -10,7 +10,7 @@ import {
updateCustomer,
} from "~/modules/sales";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/customer+/$customerId.locations.$customerLocationId.tsx b/apps/carbon/app/routes/x+/customer+/$customerId.locations.$customerLocationId.tsx
index 5722c7a271..c77482ccf1 100644
--- a/apps/carbon/app/routes/x+/customer+/$customerId.locations.$customerLocationId.tsx
+++ b/apps/carbon/app/routes/x+/customer+/$customerId.locations.$customerLocationId.tsx
@@ -9,7 +9,7 @@ import {
updateCustomerLocation,
} from "~/modules/sales";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, badRequest, notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/customer+/$customerId.locations.delete.$customerLocationId.tsx b/apps/carbon/app/routes/x+/customer+/$customerId.locations.delete.$customerLocationId.tsx
index bb19a3cbdb..433ff756b4 100644
--- a/apps/carbon/app/routes/x+/customer+/$customerId.locations.delete.$customerLocationId.tsx
+++ b/apps/carbon/app/routes/x+/customer+/$customerId.locations.delete.$customerLocationId.tsx
@@ -2,7 +2,7 @@ import type { ActionFunctionArgs } from "@remix-run/node";
import { redirect } from "@remix-run/node";
import { deleteCustomerLocation } from "~/modules/sales";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/customer+/$customerId.locations.new.tsx b/apps/carbon/app/routes/x+/customer+/$customerId.locations.new.tsx
index 4c79009b6e..ce8a34219b 100644
--- a/apps/carbon/app/routes/x+/customer+/$customerId.locations.new.tsx
+++ b/apps/carbon/app/routes/x+/customer+/$customerId.locations.new.tsx
@@ -7,7 +7,7 @@ import {
insertCustomerLocation,
} from "~/modules/sales";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/customer+/$customerId.locations.tsx b/apps/carbon/app/routes/x+/customer+/$customerId.locations.tsx
index 0c93fa12c7..ead8e22f1c 100644
--- a/apps/carbon/app/routes/x+/customer+/$customerId.locations.tsx
+++ b/apps/carbon/app/routes/x+/customer+/$customerId.locations.tsx
@@ -3,7 +3,7 @@ import { json, redirect } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
import { CustomerLocations, getCustomerLocations } from "~/modules/sales";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/customer+/$customerId.payments.tsx b/apps/carbon/app/routes/x+/customer+/$customerId.payments.tsx
index 1046a528db..fe1f8c06a5 100644
--- a/apps/carbon/app/routes/x+/customer+/$customerId.payments.tsx
+++ b/apps/carbon/app/routes/x+/customer+/$customerId.payments.tsx
@@ -9,7 +9,7 @@ import {
updateCustomerPayment,
} from "~/modules/sales";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/customer+/$customerId.shipping.tsx b/apps/carbon/app/routes/x+/customer+/$customerId.shipping.tsx
index b5d566d4f2..b33de57f46 100644
--- a/apps/carbon/app/routes/x+/customer+/$customerId.shipping.tsx
+++ b/apps/carbon/app/routes/x+/customer+/$customerId.shipping.tsx
@@ -9,7 +9,7 @@ import {
updateCustomerShipping,
} from "~/modules/sales";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/customer+/$customerId.tsx b/apps/carbon/app/routes/x+/customer+/$customerId.tsx
index f953153c2b..de241b172b 100644
--- a/apps/carbon/app/routes/x+/customer+/$customerId.tsx
+++ b/apps/carbon/app/routes/x+/customer+/$customerId.tsx
@@ -9,7 +9,7 @@ import {
getCustomerLocations,
} from "~/modules/sales";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/customer+/new.tsx b/apps/carbon/app/routes/x+/customer+/new.tsx
index f512ccf3f1..df4729f06b 100644
--- a/apps/carbon/app/routes/x+/customer+/new.tsx
+++ b/apps/carbon/app/routes/x+/customer+/new.tsx
@@ -7,7 +7,7 @@ import {
insertCustomer,
} from "~/modules/sales";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/documents+/$documentId.delete.tsx b/apps/carbon/app/routes/x+/documents+/$documentId.delete.tsx
index 8f0ac683e0..1e1d05d9d6 100644
--- a/apps/carbon/app/routes/x+/documents+/$documentId.delete.tsx
+++ b/apps/carbon/app/routes/x+/documents+/$documentId.delete.tsx
@@ -2,7 +2,7 @@ import type { ActionFunctionArgs } from "@remix-run/node";
import { redirect } from "@remix-run/node";
import { deleteDocument } from "~/modules/documents";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/documents+/$documentId.labels.tsx b/apps/carbon/app/routes/x+/documents+/$documentId.labels.tsx
index cb10252d22..ec274d0410 100644
--- a/apps/carbon/app/routes/x+/documents+/$documentId.labels.tsx
+++ b/apps/carbon/app/routes/x+/documents+/$documentId.labels.tsx
@@ -6,7 +6,7 @@ import {
updateDocumentLabels,
} from "~/modules/documents";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/documents+/$documentId.restore.tsx b/apps/carbon/app/routes/x+/documents+/$documentId.restore.tsx
index 793a79a0cc..86de9ee97a 100644
--- a/apps/carbon/app/routes/x+/documents+/$documentId.restore.tsx
+++ b/apps/carbon/app/routes/x+/documents+/$documentId.restore.tsx
@@ -2,7 +2,7 @@ import type { ActionFunctionArgs } from "@remix-run/node";
import { redirect } from "@remix-run/node";
import { restoreDocument } from "~/modules/documents";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/documents+/new.tsx b/apps/carbon/app/routes/x+/documents+/new.tsx
index b3449d6aa8..c38dc9bcde 100644
--- a/apps/carbon/app/routes/x+/documents+/new.tsx
+++ b/apps/carbon/app/routes/x+/documents+/new.tsx
@@ -2,7 +2,7 @@ import type { ActionFunctionArgs } from "@remix-run/node";
import { redirect } from "@remix-run/node";
import { upsertDocument } from "~/modules/documents";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/documents+/search.$documentId.tsx b/apps/carbon/app/routes/x+/documents+/search.$documentId.tsx
index da307fe036..5a9f478b28 100644
--- a/apps/carbon/app/routes/x+/documents+/search.$documentId.tsx
+++ b/apps/carbon/app/routes/x+/documents+/search.$documentId.tsx
@@ -9,7 +9,7 @@ import {
upsertDocument,
} from "~/modules/documents";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/documents+/search.tsx b/apps/carbon/app/routes/x+/documents+/search.tsx
index e815f357bd..7dbc272773 100644
--- a/apps/carbon/app/routes/x+/documents+/search.tsx
+++ b/apps/carbon/app/routes/x+/documents+/search.tsx
@@ -10,7 +10,7 @@ import {
getDocuments,
} from "~/modules/documents";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
import { getGenericQueryFilters } from "~/utils/query";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/inventory+/receipts.$receiptId.post.tsx b/apps/carbon/app/routes/x+/inventory+/receipts.$receiptId.post.tsx
index 3d9c6e98bd..9ebe8d52e8 100644
--- a/apps/carbon/app/routes/x+/inventory+/receipts.$receiptId.post.tsx
+++ b/apps/carbon/app/routes/x+/inventory+/receipts.$receiptId.post.tsx
@@ -3,7 +3,7 @@ import { redirect } from "@remix-run/node";
import { ReceiptPostModal } from "~/modules/inventory";
import { postingQueue, PostingQueueType } from "~/queues";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/inventory+/receipts.$receiptId.tsx b/apps/carbon/app/routes/x+/inventory+/receipts.$receiptId.tsx
index 9c6ddf7258..23e9c9283f 100644
--- a/apps/carbon/app/routes/x+/inventory+/receipts.$receiptId.tsx
+++ b/apps/carbon/app/routes/x+/inventory+/receipts.$receiptId.tsx
@@ -11,7 +11,7 @@ import {
} from "~/modules/inventory";
import { getNotes } from "~/modules/shared";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/inventory+/receipts.delete.$receiptId.tsx b/apps/carbon/app/routes/x+/inventory+/receipts.delete.$receiptId.tsx
index 6996429e83..eb29373670 100644
--- a/apps/carbon/app/routes/x+/inventory+/receipts.delete.$receiptId.tsx
+++ b/apps/carbon/app/routes/x+/inventory+/receipts.delete.$receiptId.tsx
@@ -4,7 +4,7 @@ import { useLoaderData, useNavigate, useParams } from "@remix-run/react";
import { ConfirmDelete } from "~/components/Modals";
import { deleteReceipt, getReceipt } from "~/modules/inventory";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/inventory+/receipts.new.tsx b/apps/carbon/app/routes/x+/inventory+/receipts.new.tsx
index edeab044ca..b4c5ac7432 100644
--- a/apps/carbon/app/routes/x+/inventory+/receipts.new.tsx
+++ b/apps/carbon/app/routes/x+/inventory+/receipts.new.tsx
@@ -7,7 +7,7 @@ import { getPurchaseOrder } from "~/modules/purchasing";
import { getNextSequence, rollbackNextSequence } from "~/modules/settings";
import { getUserDefaults } from "~/modules/users/users.server";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/inventory+/receipts.tsx b/apps/carbon/app/routes/x+/inventory+/receipts.tsx
index 3dd18479e6..5842f9c06f 100644
--- a/apps/carbon/app/routes/x+/inventory+/receipts.tsx
+++ b/apps/carbon/app/routes/x+/inventory+/receipts.tsx
@@ -9,7 +9,7 @@ import {
} from "~/modules/inventory";
import { getLocationsList } from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { getGenericQueryFilters } from "~/utils/query";
diff --git a/apps/carbon/app/routes/x+/inventory+/shipping-methods.$shippingMethodId.tsx b/apps/carbon/app/routes/x+/inventory+/shipping-methods.$shippingMethodId.tsx
index d016efc9e0..fc05cf6877 100644
--- a/apps/carbon/app/routes/x+/inventory+/shipping-methods.$shippingMethodId.tsx
+++ b/apps/carbon/app/routes/x+/inventory+/shipping-methods.$shippingMethodId.tsx
@@ -4,13 +4,13 @@ import { useLoaderData } from "@remix-run/react";
import { validationError } from "remix-validated-form";
import type { ShippingCarrier } from "~/modules/inventory";
import {
- getShippingMethod,
ShippingMethodForm,
+ getShippingMethod,
shippingMethodValidator,
upsertShippingMethod,
} from "~/modules/inventory";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/inventory+/shipping-methods.delete.$shippingMethodId.tsx b/apps/carbon/app/routes/x+/inventory+/shipping-methods.delete.$shippingMethodId.tsx
index a327f213de..e0d43770b6 100644
--- a/apps/carbon/app/routes/x+/inventory+/shipping-methods.delete.$shippingMethodId.tsx
+++ b/apps/carbon/app/routes/x+/inventory+/shipping-methods.delete.$shippingMethodId.tsx
@@ -4,7 +4,7 @@ import { useLoaderData, useNavigate, useParams } from "@remix-run/react";
import { ConfirmDelete } from "~/components/Modals";
import { deleteShippingMethod, getShippingMethod } from "~/modules/inventory";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/inventory+/shipping-methods.new.tsx b/apps/carbon/app/routes/x+/inventory+/shipping-methods.new.tsx
index 31e9c15fa4..52c308dc25 100644
--- a/apps/carbon/app/routes/x+/inventory+/shipping-methods.new.tsx
+++ b/apps/carbon/app/routes/x+/inventory+/shipping-methods.new.tsx
@@ -8,7 +8,7 @@ import {
upsertShippingMethod,
} from "~/modules/inventory";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/inventory+/shipping-methods.tsx b/apps/carbon/app/routes/x+/inventory+/shipping-methods.tsx
index 96ed57ac0f..53c9664ad4 100644
--- a/apps/carbon/app/routes/x+/inventory+/shipping-methods.tsx
+++ b/apps/carbon/app/routes/x+/inventory+/shipping-methods.tsx
@@ -9,7 +9,7 @@ import {
getShippingMethods,
} from "~/modules/inventory";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { getGenericQueryFilters } from "~/utils/query";
diff --git a/apps/carbon/app/routes/x+/invoicing+/purchasing.tsx b/apps/carbon/app/routes/x+/invoicing+/purchasing.tsx
index 9a30ac9559..f1aab9f6f1 100644
--- a/apps/carbon/app/routes/x+/invoicing+/purchasing.tsx
+++ b/apps/carbon/app/routes/x+/invoicing+/purchasing.tsx
@@ -8,7 +8,7 @@ import {
getPurchaseInvoices,
} from "~/modules/invoicing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { getGenericQueryFilters } from "~/utils/query";
diff --git a/apps/carbon/app/routes/x+/part+/$partId.costing.tsx b/apps/carbon/app/routes/x+/part+/$partId.costing.tsx
index b6069e0081..fa28a021a7 100644
--- a/apps/carbon/app/routes/x+/part+/$partId.costing.tsx
+++ b/apps/carbon/app/routes/x+/part+/$partId.costing.tsx
@@ -10,7 +10,7 @@ import {
upsertPartCost,
} from "~/modules/parts";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/part+/$partId.index.tsx b/apps/carbon/app/routes/x+/part+/$partId.index.tsx
index a42c8849c5..c36bc8bc24 100644
--- a/apps/carbon/app/routes/x+/part+/$partId.index.tsx
+++ b/apps/carbon/app/routes/x+/part+/$partId.index.tsx
@@ -6,7 +6,7 @@ import { useRouteData } from "~/hooks";
import type { PartSummary } from "~/modules/parts";
import { PartForm, partValidator, upsertPart } from "~/modules/parts";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/part+/$partId.inventory.tsx b/apps/carbon/app/routes/x+/part+/$partId.inventory.tsx
index 2ee68df1bf..5170c30030 100644
--- a/apps/carbon/app/routes/x+/part+/$partId.inventory.tsx
+++ b/apps/carbon/app/routes/x+/part+/$partId.inventory.tsx
@@ -14,7 +14,7 @@ import {
import { getLocationsList } from "~/modules/resources";
import { getUserDefaults } from "~/modules/users/users.server";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { ListItem } from "~/types";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/routes/x+/part+/$partId.manufacturing.tsx b/apps/carbon/app/routes/x+/part+/$partId.manufacturing.tsx
index 714079a06c..17514e33d3 100644
--- a/apps/carbon/app/routes/x+/part+/$partId.manufacturing.tsx
+++ b/apps/carbon/app/routes/x+/part+/$partId.manufacturing.tsx
@@ -9,7 +9,7 @@ import {
upsertPartManufacturing,
} from "~/modules/parts";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/part+/$partId.planning.tsx b/apps/carbon/app/routes/x+/part+/$partId.planning.tsx
index 1e67dba453..8e733ddb59 100644
--- a/apps/carbon/app/routes/x+/part+/$partId.planning.tsx
+++ b/apps/carbon/app/routes/x+/part+/$partId.planning.tsx
@@ -12,7 +12,7 @@ import {
import { getLocationsList } from "~/modules/resources";
import { getUserDefaults } from "~/modules/users/users.server";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { ListItem } from "~/types";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/routes/x+/part+/$partId.purchasing.tsx b/apps/carbon/app/routes/x+/part+/$partId.purchasing.tsx
index 0368782881..7cfe7d67b4 100644
--- a/apps/carbon/app/routes/x+/part+/$partId.purchasing.tsx
+++ b/apps/carbon/app/routes/x+/part+/$partId.purchasing.tsx
@@ -5,13 +5,13 @@ import { validationError } from "remix-validated-form";
import { useRouteData } from "~/hooks";
import type { UnitOfMeasureListItem } from "~/modules/parts";
import {
- getPartPurchasing,
PartPurchasingForm,
+ getPartPurchasing,
partPurchasingValidator,
upsertPartPurchasing,
} from "~/modules/parts";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/part+/$partId.sale-price.tsx b/apps/carbon/app/routes/x+/part+/$partId.sale-price.tsx
index 545b2b7e63..2da1102e38 100644
--- a/apps/carbon/app/routes/x+/part+/$partId.sale-price.tsx
+++ b/apps/carbon/app/routes/x+/part+/$partId.sale-price.tsx
@@ -5,13 +5,13 @@ import { validationError } from "remix-validated-form";
import { useRouteData } from "~/hooks";
import type { UnitOfMeasureListItem } from "~/modules/parts";
import {
- getPartUnitSalePrice,
PartSalePriceForm,
+ getPartUnitSalePrice,
partUnitSalePriceValidator,
upsertPartUnitSalePrice,
} from "~/modules/parts";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/part+/$partId.suppliers.new.tsx b/apps/carbon/app/routes/x+/part+/$partId.suppliers.new.tsx
index 002f4203e9..6993fab14c 100644
--- a/apps/carbon/app/routes/x+/part+/$partId.suppliers.new.tsx
+++ b/apps/carbon/app/routes/x+/part+/$partId.suppliers.new.tsx
@@ -8,7 +8,7 @@ import {
upsertPartSupplier,
} from "~/modules/parts";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/part+/$partId.suppliers.tsx b/apps/carbon/app/routes/x+/part+/$partId.suppliers.tsx
index 61d2e39ec1..6d483b73ce 100644
--- a/apps/carbon/app/routes/x+/part+/$partId.suppliers.tsx
+++ b/apps/carbon/app/routes/x+/part+/$partId.suppliers.tsx
@@ -1,9 +1,9 @@
import type { LoaderFunctionArgs } from "@remix-run/node";
import { json, redirect } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
-import { getPartSuppliers, PartSuppliers } from "~/modules/parts";
+import { PartSuppliers, getPartSuppliers } from "~/modules/parts";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/part+/$partId.tsx b/apps/carbon/app/routes/x+/part+/$partId.tsx
index 0b0d7f7999..7e7b011248 100644
--- a/apps/carbon/app/routes/x+/part+/$partId.tsx
+++ b/apps/carbon/app/routes/x+/part+/$partId.tsx
@@ -3,7 +3,7 @@ import { json, redirect } from "@remix-run/node";
import { Outlet } from "@remix-run/react";
import { PartPreview, PartSidebar, getPartSummary } from "~/modules/parts";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/part+/new.tsx b/apps/carbon/app/routes/x+/part+/new.tsx
index 389d7104d5..08ca7c39b6 100644
--- a/apps/carbon/app/routes/x+/part+/new.tsx
+++ b/apps/carbon/app/routes/x+/part+/new.tsx
@@ -3,7 +3,7 @@ import { redirect } from "@remix-run/node";
import { validationError } from "remix-validated-form";
import { PartForm, partValidator, upsertPart } from "~/modules/parts";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/parts+/groups.$groupId.tsx b/apps/carbon/app/routes/x+/parts+/groups.$groupId.tsx
index ddafaf6a40..78cd8adc88 100644
--- a/apps/carbon/app/routes/x+/parts+/groups.$groupId.tsx
+++ b/apps/carbon/app/routes/x+/parts+/groups.$groupId.tsx
@@ -3,13 +3,13 @@ import { json, redirect } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
import { validationError } from "remix-validated-form";
import {
- getPartGroup,
PartGroupForm,
+ getPartGroup,
partGroupValidator,
upsertPartGroup,
} from "~/modules/parts";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/parts+/groups.delete.$groupId.tsx b/apps/carbon/app/routes/x+/parts+/groups.delete.$groupId.tsx
index c0aa6bba19..82f0740b68 100644
--- a/apps/carbon/app/routes/x+/parts+/groups.delete.$groupId.tsx
+++ b/apps/carbon/app/routes/x+/parts+/groups.delete.$groupId.tsx
@@ -4,7 +4,7 @@ import { useLoaderData, useNavigate, useParams } from "@remix-run/react";
import { ConfirmDelete } from "~/components/Modals";
import { deletePartGroup, getPartGroup } from "~/modules/parts";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/parts+/groups.new.tsx b/apps/carbon/app/routes/x+/parts+/groups.new.tsx
index 1685bc69c0..08efc41dbb 100644
--- a/apps/carbon/app/routes/x+/parts+/groups.new.tsx
+++ b/apps/carbon/app/routes/x+/parts+/groups.new.tsx
@@ -7,7 +7,7 @@ import {
upsertPartGroup,
} from "~/modules/parts";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/parts+/groups.tsx b/apps/carbon/app/routes/x+/parts+/groups.tsx
index 2378bad901..69d3f7c2f8 100644
--- a/apps/carbon/app/routes/x+/parts+/groups.tsx
+++ b/apps/carbon/app/routes/x+/parts+/groups.tsx
@@ -9,7 +9,7 @@ import {
getPartGroups,
} from "~/modules/parts";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { getGenericQueryFilters } from "~/utils/query";
diff --git a/apps/carbon/app/routes/x+/parts+/search.tsx b/apps/carbon/app/routes/x+/parts+/search.tsx
index 81e732ea43..6316074fe8 100644
--- a/apps/carbon/app/routes/x+/parts+/search.tsx
+++ b/apps/carbon/app/routes/x+/parts+/search.tsx
@@ -9,7 +9,7 @@ import {
getParts,
} from "~/modules/parts";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
import { getGenericQueryFilters } from "~/utils/query";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/parts+/services.tsx b/apps/carbon/app/routes/x+/parts+/services.tsx
index 544a79394a..d1f64582ee 100644
--- a/apps/carbon/app/routes/x+/parts+/services.tsx
+++ b/apps/carbon/app/routes/x+/parts+/services.tsx
@@ -9,7 +9,7 @@ import {
getServices,
} from "~/modules/parts";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { getGenericQueryFilters } from "~/utils/query";
diff --git a/apps/carbon/app/routes/x+/parts+/uom.$uomId.tsx b/apps/carbon/app/routes/x+/parts+/uom.$uomId.tsx
index 23b16e5f47..722de9e713 100644
--- a/apps/carbon/app/routes/x+/parts+/uom.$uomId.tsx
+++ b/apps/carbon/app/routes/x+/parts+/uom.$uomId.tsx
@@ -3,13 +3,13 @@ import { json, redirect } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
import { validationError } from "remix-validated-form";
import {
- getUnitOfMeasure,
UnitOfMeasureForm,
+ getUnitOfMeasure,
unitOfMeasureValidator,
upsertUnitOfMeasure,
} from "~/modules/parts";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/parts+/uom.delete.$uomId.tsx b/apps/carbon/app/routes/x+/parts+/uom.delete.$uomId.tsx
index 971d947fde..356724663a 100644
--- a/apps/carbon/app/routes/x+/parts+/uom.delete.$uomId.tsx
+++ b/apps/carbon/app/routes/x+/parts+/uom.delete.$uomId.tsx
@@ -4,7 +4,7 @@ import { useLoaderData, useNavigate, useParams } from "@remix-run/react";
import { ConfirmDelete } from "~/components/Modals";
import { deleteUnitOfMeasure, getUnitOfMeasure } from "~/modules/parts";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/parts+/uom.new.tsx b/apps/carbon/app/routes/x+/parts+/uom.new.tsx
index b2594e3e44..6f370e029b 100644
--- a/apps/carbon/app/routes/x+/parts+/uom.new.tsx
+++ b/apps/carbon/app/routes/x+/parts+/uom.new.tsx
@@ -7,7 +7,7 @@ import {
upsertUnitOfMeasure,
} from "~/modules/parts";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/person+/$personId.index.tsx b/apps/carbon/app/routes/x+/person+/$personId.index.tsx
index 24c13d6e6d..5fc1309989 100644
--- a/apps/carbon/app/routes/x+/person+/$personId.index.tsx
+++ b/apps/carbon/app/routes/x+/person+/$personId.index.tsx
@@ -2,7 +2,7 @@ import type { LoaderFunctionArgs } from "@remix-run/node";
import { json, redirect } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/person+/$personId.job.tsx b/apps/carbon/app/routes/x+/person+/$personId.job.tsx
index 705c70c6c5..c4ac2b0ca2 100644
--- a/apps/carbon/app/routes/x+/person+/$personId.job.tsx
+++ b/apps/carbon/app/routes/x+/person+/$personId.job.tsx
@@ -2,7 +2,7 @@ import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";
import { json, redirect } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/person+/$personId.notes.tsx b/apps/carbon/app/routes/x+/person+/$personId.notes.tsx
index f0d0b10bf0..973e353c16 100644
--- a/apps/carbon/app/routes/x+/person+/$personId.notes.tsx
+++ b/apps/carbon/app/routes/x+/person+/$personId.notes.tsx
@@ -5,7 +5,7 @@ import { useLoaderData, useParams } from "@remix-run/react";
import { Notes, getNotes } from "~/modules/shared";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/person+/$personId.private.tsx b/apps/carbon/app/routes/x+/person+/$personId.private.tsx
index fe564c2939..92b4a7ef97 100644
--- a/apps/carbon/app/routes/x+/person+/$personId.private.tsx
+++ b/apps/carbon/app/routes/x+/person+/$personId.private.tsx
@@ -8,7 +8,7 @@ import type { PrivateAttributes } from "~/modules/account";
import { UserAttributesForm, getPrivateAttributes } from "~/modules/account";
import { employeeJobValidator, upsertEmployeeJob } from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/person+/$personId.public.tsx b/apps/carbon/app/routes/x+/person+/$personId.public.tsx
index f100d075e1..a8865890b6 100644
--- a/apps/carbon/app/routes/x+/person+/$personId.public.tsx
+++ b/apps/carbon/app/routes/x+/person+/$personId.public.tsx
@@ -8,7 +8,7 @@ import type { PublicAttributes } from "~/modules/account";
import { UserAttributesForm, getPublicAttributes } from "~/modules/account";
import { employeeJobValidator, upsertEmployeeJob } from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/person+/$personId.tsx b/apps/carbon/app/routes/x+/person+/$personId.tsx
index 9666de8e3c..0b6fdd3ce6 100644
--- a/apps/carbon/app/routes/x+/person+/$personId.tsx
+++ b/apps/carbon/app/routes/x+/person+/$personId.tsx
@@ -12,7 +12,7 @@ import {
getEmployeeSummary,
} from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.details.tsx b/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.details.tsx
index f71c8d63c5..6b02565f7a 100644
--- a/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.details.tsx
+++ b/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.details.tsx
@@ -10,7 +10,7 @@ import {
upsertPurchaseInvoice,
} from "~/modules/invoicing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { ListItem } from "~/types";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.lines.$lineId.tsx b/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.lines.$lineId.tsx
index b1e3e89bcf..7d65be3d26 100644
--- a/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.lines.$lineId.tsx
+++ b/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.lines.$lineId.tsx
@@ -10,7 +10,7 @@ import {
upsertPurchaseInvoiceLine,
} from "~/modules/invoicing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.lines.delete.$lineId.tsx b/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.lines.delete.$lineId.tsx
index 6b86366c47..eccd184f9c 100644
--- a/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.lines.delete.$lineId.tsx
+++ b/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.lines.delete.$lineId.tsx
@@ -7,7 +7,7 @@ import {
getPurchaseInvoiceLine,
} from "~/modules/invoicing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.lines.new.tsx b/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.lines.new.tsx
index 93bd590908..bd65a3691d 100644
--- a/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.lines.new.tsx
+++ b/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.lines.new.tsx
@@ -9,7 +9,7 @@ import {
upsertPurchaseInvoiceLine,
} from "~/modules/invoicing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.lines.tsx b/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.lines.tsx
index 3669fa4957..2483171c8f 100644
--- a/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.lines.tsx
+++ b/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.lines.tsx
@@ -7,7 +7,7 @@ import {
upsertPurchaseInvoice,
} from "~/modules/invoicing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.post.tsx b/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.post.tsx
index ce6304b125..7b4deeac99 100644
--- a/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.post.tsx
+++ b/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.post.tsx
@@ -2,7 +2,7 @@ import type { ActionFunctionArgs } from "@remix-run/node";
import { redirect } from "@remix-run/node";
import { PostingQueueType, postingQueue } from "~/queues";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.tsx b/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.tsx
index 07df262802..695f235d35 100644
--- a/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.tsx
+++ b/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.tsx
@@ -11,7 +11,7 @@ import {
} from "~/modules/invoicing";
import { getLocationsList } from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/purchase-invoice+/delete.$invoiceId.tsx b/apps/carbon/app/routes/x+/purchase-invoice+/delete.$invoiceId.tsx
index e57c6379ac..109b8582ae 100644
--- a/apps/carbon/app/routes/x+/purchase-invoice+/delete.$invoiceId.tsx
+++ b/apps/carbon/app/routes/x+/purchase-invoice+/delete.$invoiceId.tsx
@@ -2,7 +2,7 @@ import type { ActionFunctionArgs } from "@remix-run/node";
import { redirect } from "@remix-run/node";
import { deletePurchaseInvoice } from "~/modules/invoicing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/purchase-invoice+/new.tsx b/apps/carbon/app/routes/x+/purchase-invoice+/new.tsx
index 823d0cadcd..01b537a914 100644
--- a/apps/carbon/app/routes/x+/purchase-invoice+/new.tsx
+++ b/apps/carbon/app/routes/x+/purchase-invoice+/new.tsx
@@ -15,7 +15,7 @@ import {
} from "~/modules/invoicing/invoicing.server";
import { getNextSequence, rollbackNextSequence } from "~/modules/settings";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { ListItem } from "~/types";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/routes/x+/purchase-order+/$orderId.delivery.tsx b/apps/carbon/app/routes/x+/purchase-order+/$orderId.delivery.tsx
index e09a7e8c33..90837b373a 100644
--- a/apps/carbon/app/routes/x+/purchase-order+/$orderId.delivery.tsx
+++ b/apps/carbon/app/routes/x+/purchase-order+/$orderId.delivery.tsx
@@ -7,13 +7,13 @@ import {
getShippingTermsList,
} from "~/modules/inventory";
import {
- getPurchaseOrderDelivery,
PurchaseOrderDeliveryForm,
+ getPurchaseOrderDelivery,
purchaseOrderDeliveryValidator,
upsertPurchaseOrderDelivery,
} from "~/modules/purchasing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/purchase-order+/$orderId.details.tsx b/apps/carbon/app/routes/x+/purchase-order+/$orderId.details.tsx
index a9517809fc..26ca284369 100644
--- a/apps/carbon/app/routes/x+/purchase-order+/$orderId.details.tsx
+++ b/apps/carbon/app/routes/x+/purchase-order+/$orderId.details.tsx
@@ -10,7 +10,7 @@ import {
upsertPurchaseOrder,
} from "~/modules/purchasing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/purchase-order+/$orderId.lines.$lineId.tsx b/apps/carbon/app/routes/x+/purchase-order+/$orderId.lines.$lineId.tsx
index b4c9237c1d..3647b65312 100644
--- a/apps/carbon/app/routes/x+/purchase-order+/$orderId.lines.$lineId.tsx
+++ b/apps/carbon/app/routes/x+/purchase-order+/$orderId.lines.$lineId.tsx
@@ -10,7 +10,7 @@ import {
upsertPurchaseOrderLine,
} from "~/modules/purchasing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/purchase-order+/$orderId.lines.delete.$lineId.tsx b/apps/carbon/app/routes/x+/purchase-order+/$orderId.lines.delete.$lineId.tsx
index c647822e59..b7c86bf169 100644
--- a/apps/carbon/app/routes/x+/purchase-order+/$orderId.lines.delete.$lineId.tsx
+++ b/apps/carbon/app/routes/x+/purchase-order+/$orderId.lines.delete.$lineId.tsx
@@ -7,7 +7,7 @@ import {
getPurchaseOrderLine,
} from "~/modules/purchasing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/purchase-order+/$orderId.lines.new.tsx b/apps/carbon/app/routes/x+/purchase-order+/$orderId.lines.new.tsx
index 6a7baf6bca..90b961ef88 100644
--- a/apps/carbon/app/routes/x+/purchase-order+/$orderId.lines.new.tsx
+++ b/apps/carbon/app/routes/x+/purchase-order+/$orderId.lines.new.tsx
@@ -9,7 +9,7 @@ import {
upsertPurchaseOrderLine,
} from "~/modules/purchasing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/purchase-order+/$orderId.payment.tsx b/apps/carbon/app/routes/x+/purchase-order+/$orderId.payment.tsx
index 108d6899e6..a58e0f29c5 100644
--- a/apps/carbon/app/routes/x+/purchase-order+/$orderId.payment.tsx
+++ b/apps/carbon/app/routes/x+/purchase-order+/$orderId.payment.tsx
@@ -10,7 +10,7 @@ import {
upsertPurchaseOrderPayment,
} from "~/modules/purchasing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/purchase-order+/$orderId.release.tsx b/apps/carbon/app/routes/x+/purchase-order+/$orderId.release.tsx
index 708f43048c..df7a64c20f 100644
--- a/apps/carbon/app/routes/x+/purchase-order+/$orderId.release.tsx
+++ b/apps/carbon/app/routes/x+/purchase-order+/$orderId.release.tsx
@@ -15,7 +15,7 @@ import { getCompany } from "~/modules/settings";
import { getUser } from "~/modules/users/users.server";
import { loader as pdfLoader } from "~/routes/file+/purchase-order+/$orderId[.]pdf";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/purchase-order+/$orderId.tsx b/apps/carbon/app/routes/x+/purchase-order+/$orderId.tsx
index 1a36047b76..fe01dee45c 100644
--- a/apps/carbon/app/routes/x+/purchase-order+/$orderId.tsx
+++ b/apps/carbon/app/routes/x+/purchase-order+/$orderId.tsx
@@ -13,7 +13,7 @@ import {
} from "~/modules/purchasing";
import { getLocationsList } from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/purchase-order+/delete.$orderId.tsx b/apps/carbon/app/routes/x+/purchase-order+/delete.$orderId.tsx
index cdf7de1ecf..dc8e506362 100644
--- a/apps/carbon/app/routes/x+/purchase-order+/delete.$orderId.tsx
+++ b/apps/carbon/app/routes/x+/purchase-order+/delete.$orderId.tsx
@@ -2,7 +2,7 @@ import type { ActionFunctionArgs } from "@remix-run/node";
import { redirect } from "@remix-run/node";
import { deletePurchaseOrder } from "~/modules/purchasing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/purchase-order+/new.tsx b/apps/carbon/app/routes/x+/purchase-order+/new.tsx
index 99a9b584e9..f04ff07ea7 100644
--- a/apps/carbon/app/routes/x+/purchase-order+/new.tsx
+++ b/apps/carbon/app/routes/x+/purchase-order+/new.tsx
@@ -14,7 +14,7 @@ import {
} from "~/modules/purchasing";
import { getNextSequence, rollbackNextSequence } from "~/modules/settings";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/purchasing+/orders.tsx b/apps/carbon/app/routes/x+/purchasing+/orders.tsx
index 3921eb5bc8..78e49d01a1 100644
--- a/apps/carbon/app/routes/x+/purchasing+/orders.tsx
+++ b/apps/carbon/app/routes/x+/purchasing+/orders.tsx
@@ -8,7 +8,7 @@ import {
getPurchaseOrders,
} from "~/modules/purchasing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { getGenericQueryFilters } from "~/utils/query";
diff --git a/apps/carbon/app/routes/x+/purchasing+/supplier-types.$supplierTypeId.tsx b/apps/carbon/app/routes/x+/purchasing+/supplier-types.$supplierTypeId.tsx
index b0b24722a0..695bc91825 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 { json, redirect } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
import { validationError } from "remix-validated-form";
import {
- getSupplierType,
SupplierTypeForm,
+ getSupplierType,
supplierTypeValidator,
upsertSupplierType,
} from "~/modules/purchasing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
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.tsx
index f577487eb1..dd459a222f 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
@@ -4,7 +4,7 @@ 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 { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/purchasing+/supplier-types.new.tsx b/apps/carbon/app/routes/x+/purchasing+/supplier-types.new.tsx
index e232447998..8952cdf9e5 100644
--- a/apps/carbon/app/routes/x+/purchasing+/supplier-types.new.tsx
+++ b/apps/carbon/app/routes/x+/purchasing+/supplier-types.new.tsx
@@ -7,7 +7,7 @@ import {
upsertSupplierType,
} from "~/modules/purchasing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
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.tsx
index 0e116b8e7a..86d9820efd 100644
--- a/apps/carbon/app/routes/x+/purchasing+/suppliers.tsx
+++ b/apps/carbon/app/routes/x+/purchasing+/suppliers.tsx
@@ -10,7 +10,7 @@ import {
getSuppliers,
} from "~/modules/purchasing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { getGenericQueryFilters } from "~/utils/query";
diff --git a/apps/carbon/app/routes/x+/resources+/abilities.delete.$abilityId.tsx b/apps/carbon/app/routes/x+/resources+/abilities.delete.$abilityId.tsx
index f0e62743c3..e9991e279e 100644
--- a/apps/carbon/app/routes/x+/resources+/abilities.delete.$abilityId.tsx
+++ b/apps/carbon/app/routes/x+/resources+/abilities.delete.$abilityId.tsx
@@ -4,7 +4,7 @@ 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 { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/resources+/abilities.new.tsx b/apps/carbon/app/routes/x+/resources+/abilities.new.tsx
index be9e614009..11e5c77498 100644
--- a/apps/carbon/app/routes/x+/resources+/abilities.new.tsx
+++ b/apps/carbon/app/routes/x+/resources+/abilities.new.tsx
@@ -9,7 +9,7 @@ import {
insertEmployeeAbilities,
} from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/resources+/abilities.tsx b/apps/carbon/app/routes/x+/resources+/abilities.tsx
index e1199cb887..04f905477e 100644
--- a/apps/carbon/app/routes/x+/resources+/abilities.tsx
+++ b/apps/carbon/app/routes/x+/resources+/abilities.tsx
@@ -8,7 +8,7 @@ import {
getAbilities,
} from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { getGenericQueryFilters } from "~/utils/query";
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.tsx
index 2347522dd6..99132ae6f1 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
@@ -13,7 +13,7 @@ import {
} from "~/modules/resources";
import { EmployeeAbilityForm } from "~/modules/resources/ui/Abilities";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --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.tsx
index 153a53cf62..4e50e00a27 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
@@ -6,7 +6,7 @@ import { useRouteData } from "~/hooks";
import type { Ability } from "~/modules/resources";
import { deleteEmployeeAbility } from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
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.tsx
index 011bc1e551..d9894021d3 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
@@ -11,7 +11,7 @@ import {
} from "~/modules/resources";
import { EmployeeAbilityForm } from "~/modules/resources/ui/Abilities";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/resources+/ability.$abilityId.tsx b/apps/carbon/app/routes/x+/resources+/ability.$abilityId.tsx
index abf52d5c47..fa9614c3c9 100644
--- a/apps/carbon/app/routes/x+/resources+/ability.$abilityId.tsx
+++ b/apps/carbon/app/routes/x+/resources+/ability.$abilityId.tsx
@@ -31,7 +31,7 @@ import {
updateAbility,
} from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
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.tsx
index f07d907e5e..1c34f7ebf4 100644
--- a/apps/carbon/app/routes/x+/resources+/attribute.$attributeId.tsx
+++ b/apps/carbon/app/routes/x+/resources+/attribute.$attributeId.tsx
@@ -3,7 +3,7 @@ import { redirect } from "@remix-run/node";
import { validationError } from "remix-validated-form";
import { attributeValidator, updateAttribute } from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
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.tsx
index c5f30b4d45..c2b7ce43f9 100644
--- a/apps/carbon/app/routes/x+/resources+/attribute.delete.$attributeId.tsx
+++ b/apps/carbon/app/routes/x+/resources+/attribute.delete.$attributeId.tsx
@@ -2,7 +2,7 @@ import type { LoaderFunctionArgs } from "@remix-run/node";
import { redirect } from "@remix-run/node";
import { deleteAttribute } from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
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.tsx
index 219292aaf9..28cca9c63d 100644
--- a/apps/carbon/app/routes/x+/resources+/attribute.new.tsx
+++ b/apps/carbon/app/routes/x+/resources+/attribute.new.tsx
@@ -3,7 +3,7 @@ import { json, 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 { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/resources+/attributes.$categoryId.tsx b/apps/carbon/app/routes/x+/resources+/attributes.$categoryId.tsx
index bada970da1..0b44a6dd25 100644
--- a/apps/carbon/app/routes/x+/resources+/attributes.$categoryId.tsx
+++ b/apps/carbon/app/routes/x+/resources+/attributes.$categoryId.tsx
@@ -9,7 +9,7 @@ import {
updateAttributeCategory,
} from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
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.tsx
index df95963a4c..27d18fac4e 100644
--- a/apps/carbon/app/routes/x+/resources+/attributes.delete.$categoryId.tsx
+++ b/apps/carbon/app/routes/x+/resources+/attributes.delete.$categoryId.tsx
@@ -2,7 +2,7 @@ import type { LoaderFunctionArgs } from "@remix-run/node";
import { redirect } from "@remix-run/node";
import { deleteAttributeCategory } from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
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.tsx
index e4560d6f4e..0362d4e464 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
@@ -5,7 +5,7 @@ import { useRouteData } from "~/hooks";
import type { AttributeDataType } from "~/modules/resources";
import { AttributeForm, getAttribute } from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/resources+/attributes.list.$categoryId.tsx b/apps/carbon/app/routes/x+/resources+/attributes.list.$categoryId.tsx
index 3c24456d05..df8b946448 100644
--- a/apps/carbon/app/routes/x+/resources+/attributes.list.$categoryId.tsx
+++ b/apps/carbon/app/routes/x+/resources+/attributes.list.$categoryId.tsx
@@ -8,7 +8,7 @@ import {
updateAttributeSortOrder,
} from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
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.tsx
index 2dc8c739d1..602889400e 100644
--- a/apps/carbon/app/routes/x+/resources+/attributes.new.tsx
+++ b/apps/carbon/app/routes/x+/resources+/attributes.new.tsx
@@ -8,7 +8,7 @@ import {
insertAttributeCategory,
} from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/resources+/attributes.tsx b/apps/carbon/app/routes/x+/resources+/attributes.tsx
index 8938b9bc5e..b7f6340e7a 100644
--- a/apps/carbon/app/routes/x+/resources+/attributes.tsx
+++ b/apps/carbon/app/routes/x+/resources+/attributes.tsx
@@ -9,7 +9,7 @@ import {
getAttributeDataTypes,
} from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { getGenericQueryFilters } from "~/utils/query";
diff --git a/apps/carbon/app/routes/x+/resources+/contractors.$supplierContactId.tsx b/apps/carbon/app/routes/x+/resources+/contractors.$supplierContactId.tsx
index c5deb03b44..a120880963 100644
--- a/apps/carbon/app/routes/x+/resources+/contractors.$supplierContactId.tsx
+++ b/apps/carbon/app/routes/x+/resources+/contractors.$supplierContactId.tsx
@@ -9,7 +9,7 @@ import {
upsertContractor,
} from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/resources+/contractors.delete.$supplierId.tsx b/apps/carbon/app/routes/x+/resources+/contractors.delete.$supplierId.tsx
index f9578a15d3..fe83c7267a 100644
--- a/apps/carbon/app/routes/x+/resources+/contractors.delete.$supplierId.tsx
+++ b/apps/carbon/app/routes/x+/resources+/contractors.delete.$supplierId.tsx
@@ -4,7 +4,7 @@ import { useLoaderData, useNavigate } from "@remix-run/react";
import { ConfirmDelete } from "~/components/Modals";
import { deleteContractor, getContractor } from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/resources+/contractors.new.tsx b/apps/carbon/app/routes/x+/resources+/contractors.new.tsx
index e0e116b8f7..6bb1dbd97c 100644
--- a/apps/carbon/app/routes/x+/resources+/contractors.new.tsx
+++ b/apps/carbon/app/routes/x+/resources+/contractors.new.tsx
@@ -8,7 +8,7 @@ import {
upsertContractor,
} from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/resources+/contractors.tsx b/apps/carbon/app/routes/x+/resources+/contractors.tsx
index 683f161b75..6cc8cffe5a 100644
--- a/apps/carbon/app/routes/x+/resources+/contractors.tsx
+++ b/apps/carbon/app/routes/x+/resources+/contractors.tsx
@@ -9,7 +9,7 @@ import {
getContractors,
} from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { getGenericQueryFilters } from "~/utils/query";
diff --git a/apps/carbon/app/routes/x+/resources+/departments.$departmentId.tsx b/apps/carbon/app/routes/x+/resources+/departments.$departmentId.tsx
index 18cdda07ec..011c6f1a21 100644
--- a/apps/carbon/app/routes/x+/resources+/departments.$departmentId.tsx
+++ b/apps/carbon/app/routes/x+/resources+/departments.$departmentId.tsx
@@ -9,7 +9,7 @@ import {
upsertDepartment,
} from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
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.tsx
index 09612802fa..7ab6f61531 100644
--- a/apps/carbon/app/routes/x+/resources+/departments.delete.$departmentId.tsx
+++ b/apps/carbon/app/routes/x+/resources+/departments.delete.$departmentId.tsx
@@ -4,7 +4,7 @@ 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 { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/resources+/departments.new.tsx b/apps/carbon/app/routes/x+/resources+/departments.new.tsx
index bedfb6f316..4a89aa80d1 100644
--- a/apps/carbon/app/routes/x+/resources+/departments.new.tsx
+++ b/apps/carbon/app/routes/x+/resources+/departments.new.tsx
@@ -7,7 +7,7 @@ import {
upsertDepartment,
} from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
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.tsx
index 1391451204..fb28f371ba 100644
--- a/apps/carbon/app/routes/x+/resources+/departments.tsx
+++ b/apps/carbon/app/routes/x+/resources+/departments.tsx
@@ -8,7 +8,7 @@ import {
getDepartments,
} from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { getGenericQueryFilters } from "~/utils/query";
diff --git a/apps/carbon/app/routes/x+/resources+/equipment.$typeId.tsx b/apps/carbon/app/routes/x+/resources+/equipment.$typeId.tsx
index d8700eac78..ca78026023 100644
--- a/apps/carbon/app/routes/x+/resources+/equipment.$typeId.tsx
+++ b/apps/carbon/app/routes/x+/resources+/equipment.$typeId.tsx
@@ -9,7 +9,7 @@ import {
upsertEquipmentType,
} from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
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.tsx
index 1b5723c9ac..5733c90416 100644
--- a/apps/carbon/app/routes/x+/resources+/equipment.delete.$typeId.tsx
+++ b/apps/carbon/app/routes/x+/resources+/equipment.delete.$typeId.tsx
@@ -2,7 +2,7 @@ import type { LoaderFunctionArgs } from "@remix-run/node";
import { redirect } from "@remix-run/node";
import { deleteEquipmentType } from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
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.tsx
index 2bf23dcd83..eaeb1c6895 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
@@ -5,7 +5,7 @@ import { useRouteData } from "~/hooks";
import type { EquipmentType } from "~/modules/resources";
import { EquipmentForm, getEquipment } from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/resources+/equipment.list.$typeId.tsx b/apps/carbon/app/routes/x+/resources+/equipment.list.$typeId.tsx
index 307665b31a..c6e3ea5cdf 100644
--- a/apps/carbon/app/routes/x+/resources+/equipment.list.$typeId.tsx
+++ b/apps/carbon/app/routes/x+/resources+/equipment.list.$typeId.tsx
@@ -4,7 +4,7 @@ import { Outlet, useLoaderData, useNavigate } from "@remix-run/react";
import { useUrlParams } from "~/hooks";
import { EquipmentTypeDetail, getEquipmentType } from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { notFound } from "~/utils/http";
import { path } from "~/utils/path";
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.tsx
index ea111e09e6..2d27934710 100644
--- a/apps/carbon/app/routes/x+/resources+/equipment.new.tsx
+++ b/apps/carbon/app/routes/x+/resources+/equipment.new.tsx
@@ -8,7 +8,7 @@ import {
upsertEquipmentType,
} from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/resources+/equipment.tsx b/apps/carbon/app/routes/x+/resources+/equipment.tsx
index d0bd218ca0..3c3c35c61b 100644
--- a/apps/carbon/app/routes/x+/resources+/equipment.tsx
+++ b/apps/carbon/app/routes/x+/resources+/equipment.tsx
@@ -8,7 +8,7 @@ import {
getEquipmentTypes,
} from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { getGenericQueryFilters } from "~/utils/query";
diff --git a/apps/carbon/app/routes/x+/resources+/equipment.unit.$equipmentId.tsx b/apps/carbon/app/routes/x+/resources+/equipment.unit.$equipmentId.tsx
index 975716b211..1500dac768 100644
--- a/apps/carbon/app/routes/x+/resources+/equipment.unit.$equipmentId.tsx
+++ b/apps/carbon/app/routes/x+/resources+/equipment.unit.$equipmentId.tsx
@@ -3,7 +3,7 @@ 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 { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
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.tsx
index 60f8ea2256..8b78db0b39 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
@@ -4,7 +4,7 @@ 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 { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
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.tsx
index a18b43f2ce..59c8b0ec37 100644
--- a/apps/carbon/app/routes/x+/resources+/equipment.unit.new.tsx
+++ b/apps/carbon/app/routes/x+/resources+/equipment.unit.new.tsx
@@ -3,7 +3,7 @@ import { json, 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 { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/resources+/holidays.$holidayId.tsx b/apps/carbon/app/routes/x+/resources+/holidays.$holidayId.tsx
index 89131849ca..332c85ad79 100644
--- a/apps/carbon/app/routes/x+/resources+/holidays.$holidayId.tsx
+++ b/apps/carbon/app/routes/x+/resources+/holidays.$holidayId.tsx
@@ -3,13 +3,13 @@ import { json, redirect } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
import { validationError } from "remix-validated-form";
import {
- getHoliday,
HolidayForm,
+ getHoliday,
holidayValidator,
upsertHoliday,
} from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
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.tsx
index d053211649..33820ad476 100644
--- a/apps/carbon/app/routes/x+/resources+/holidays.delete.$holidayId.tsx
+++ b/apps/carbon/app/routes/x+/resources+/holidays.delete.$holidayId.tsx
@@ -4,7 +4,7 @@ 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 { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/resources+/holidays.new.tsx b/apps/carbon/app/routes/x+/resources+/holidays.new.tsx
index a1d9cce8ef..214f973350 100644
--- a/apps/carbon/app/routes/x+/resources+/holidays.new.tsx
+++ b/apps/carbon/app/routes/x+/resources+/holidays.new.tsx
@@ -7,7 +7,7 @@ import {
upsertHoliday,
} from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
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.tsx
index 66b3038f7b..9c5b898550 100644
--- a/apps/carbon/app/routes/x+/resources+/holidays.tsx
+++ b/apps/carbon/app/routes/x+/resources+/holidays.tsx
@@ -9,7 +9,7 @@ import {
getHolidays,
} from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { getGenericQueryFilters } from "~/utils/query";
diff --git a/apps/carbon/app/routes/x+/resources+/locations.$locationId.tsx b/apps/carbon/app/routes/x+/resources+/locations.$locationId.tsx
index a8b572438f..776f8d59c3 100644
--- a/apps/carbon/app/routes/x+/resources+/locations.$locationId.tsx
+++ b/apps/carbon/app/routes/x+/resources+/locations.$locationId.tsx
@@ -4,13 +4,13 @@ import { json, redirect } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
import { validationError } from "remix-validated-form";
import {
- getLocation,
LocationForm,
+ getLocation,
locationValidator,
upsertLocation,
} from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/resources+/locations.delete.$locationId.tsx b/apps/carbon/app/routes/x+/resources+/locations.delete.$locationId.tsx
index 6180377c00..4a84b627b6 100644
--- a/apps/carbon/app/routes/x+/resources+/locations.delete.$locationId.tsx
+++ b/apps/carbon/app/routes/x+/resources+/locations.delete.$locationId.tsx
@@ -4,7 +4,7 @@ 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 { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/resources+/locations.new.tsx b/apps/carbon/app/routes/x+/resources+/locations.new.tsx
index 39f6c3fb2f..04fcee6a26 100644
--- a/apps/carbon/app/routes/x+/resources+/locations.new.tsx
+++ b/apps/carbon/app/routes/x+/resources+/locations.new.tsx
@@ -8,7 +8,7 @@ import {
upsertLocation,
} from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
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.tsx
index 3984cd2e50..c7e13550e0 100644
--- a/apps/carbon/app/routes/x+/resources+/locations.tsx
+++ b/apps/carbon/app/routes/x+/resources+/locations.tsx
@@ -8,7 +8,7 @@ import {
getLocations,
} from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { getGenericQueryFilters } from "~/utils/query";
diff --git a/apps/carbon/app/routes/x+/resources+/partners.$supplierLocationId.$abilityId.tsx b/apps/carbon/app/routes/x+/resources+/partners.$supplierLocationId.$abilityId.tsx
index 72db941d41..53396a5971 100644
--- a/apps/carbon/app/routes/x+/resources+/partners.$supplierLocationId.$abilityId.tsx
+++ b/apps/carbon/app/routes/x+/resources+/partners.$supplierLocationId.$abilityId.tsx
@@ -9,7 +9,7 @@ import {
upsertPartner,
} from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/resources+/partners.delete.$supplierId.tsx b/apps/carbon/app/routes/x+/resources+/partners.delete.$supplierId.tsx
index 537fc4d7d6..afad2e9a46 100644
--- a/apps/carbon/app/routes/x+/resources+/partners.delete.$supplierId.tsx
+++ b/apps/carbon/app/routes/x+/resources+/partners.delete.$supplierId.tsx
@@ -4,7 +4,7 @@ import { useLoaderData, useNavigate } 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 { flash } from "~/services/session.server";
import { notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/resources+/partners.new.tsx b/apps/carbon/app/routes/x+/resources+/partners.new.tsx
index 47852f952e..4084731b7c 100644
--- a/apps/carbon/app/routes/x+/resources+/partners.new.tsx
+++ b/apps/carbon/app/routes/x+/resources+/partners.new.tsx
@@ -8,7 +8,7 @@ import {
upsertPartner,
} from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/resources+/partners.tsx b/apps/carbon/app/routes/x+/resources+/partners.tsx
index 9601c7a336..b6183c02d4 100644
--- a/apps/carbon/app/routes/x+/resources+/partners.tsx
+++ b/apps/carbon/app/routes/x+/resources+/partners.tsx
@@ -9,7 +9,7 @@ import {
getPartners,
} from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { getGenericQueryFilters } from "~/utils/query";
diff --git a/apps/carbon/app/routes/x+/resources+/people.tsx b/apps/carbon/app/routes/x+/resources+/people.tsx
index d6936609f6..86f88ec0ea 100644
--- a/apps/carbon/app/routes/x+/resources+/people.tsx
+++ b/apps/carbon/app/routes/x+/resources+/people.tsx
@@ -11,7 +11,7 @@ import {
} from "~/modules/resources";
import { getEmployeeTypes } from "~/modules/users";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { getGenericQueryFilters } from "~/utils/query";
diff --git a/apps/carbon/app/routes/x+/resources+/shifts.$shiftId.tsx b/apps/carbon/app/routes/x+/resources+/shifts.$shiftId.tsx
index f702f3bfa1..be3ec173c8 100644
--- a/apps/carbon/app/routes/x+/resources+/shifts.$shiftId.tsx
+++ b/apps/carbon/app/routes/x+/resources+/shifts.$shiftId.tsx
@@ -9,7 +9,7 @@ import {
upsertShift,
} from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
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.tsx
index cf082141be..21b231b646 100644
--- a/apps/carbon/app/routes/x+/resources+/shifts.delete.$shiftId.tsx
+++ b/apps/carbon/app/routes/x+/resources+/shifts.delete.$shiftId.tsx
@@ -4,7 +4,7 @@ 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 { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/resources+/shifts.new.tsx b/apps/carbon/app/routes/x+/resources+/shifts.new.tsx
index 81fc88378d..c0210364a4 100644
--- a/apps/carbon/app/routes/x+/resources+/shifts.new.tsx
+++ b/apps/carbon/app/routes/x+/resources+/shifts.new.tsx
@@ -3,7 +3,7 @@ import { redirect } from "@remix-run/node";
import { validationError } from "remix-validated-form";
import { ShiftForm, shiftValidator, upsertShift } from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/resources+/shifts.tsx b/apps/carbon/app/routes/x+/resources+/shifts.tsx
index 8aa6430254..d4a2450313 100644
--- a/apps/carbon/app/routes/x+/resources+/shifts.tsx
+++ b/apps/carbon/app/routes/x+/resources+/shifts.tsx
@@ -9,7 +9,7 @@ import {
getShifts,
} from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { getGenericQueryFilters } from "~/utils/query";
diff --git a/apps/carbon/app/routes/x+/resources+/work-cells.$typeId.tsx b/apps/carbon/app/routes/x+/resources+/work-cells.$typeId.tsx
index 33c0f0db39..ed14913436 100644
--- a/apps/carbon/app/routes/x+/resources+/work-cells.$typeId.tsx
+++ b/apps/carbon/app/routes/x+/resources+/work-cells.$typeId.tsx
@@ -3,13 +3,13 @@ import { json, redirect } from "@remix-run/node";
import { useLoaderData, useNavigate } from "@remix-run/react";
import { validationError } from "remix-validated-form";
import {
+ WorkCellTypeForm,
getWorkCellType,
upsertWorkCellType,
- WorkCellTypeForm,
workCellTypeValidator,
} from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
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.tsx
index 7831c0793c..b8ae9f01e3 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
@@ -3,7 +3,7 @@ import { redirect } from "@remix-run/node";
import { validationError } from "remix-validated-form";
import { upsertWorkCell, workCellValidator } from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
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.tsx
index eb53f279e6..035aa63013 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
@@ -4,7 +4,7 @@ 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 { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
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.tsx
index 9761dbae18..9de63d148e 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
@@ -3,7 +3,7 @@ import { json, redirect } from "@remix-run/node";
import { validationError } from "remix-validated-form";
import { upsertWorkCell, workCellValidator } from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error } 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.tsx
index b8e5e56b95..a4c8331199 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
@@ -2,7 +2,7 @@ import type { LoaderFunctionArgs } from "@remix-run/node";
import { redirect } from "@remix-run/node";
import { deleteWorkCellType } from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
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.tsx
index 2a1754044b..13697e5478 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,9 +3,9 @@ import { json, redirect } from "@remix-run/node";
import { useLoaderData, useNavigate, useParams } from "@remix-run/react";
import { useRouteData } from "~/hooks";
import type { WorkCellType } from "~/modules/resources";
-import { getWorkCell, WorkCellForm } from "~/modules/resources";
+import { WorkCellForm, getWorkCell } from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
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.tsx
index 03b491de17..1be51294e1 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,9 +2,9 @@ import type { LoaderFunctionArgs } from "@remix-run/node";
import { json, redirect } from "@remix-run/node";
import { Outlet, useLoaderData, useNavigate } from "@remix-run/react";
import { useUrlParams } from "~/hooks";
-import { getWorkCellType, WorkCellTypeDetail } from "~/modules/resources";
+import { WorkCellTypeDetail, getWorkCellType } from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { notFound } from "~/utils/http";
import { path } from "~/utils/path";
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.tsx
index f75f375660..712ae32b02 100644
--- a/apps/carbon/app/routes/x+/resources+/work-cells.new.tsx
+++ b/apps/carbon/app/routes/x+/resources+/work-cells.new.tsx
@@ -8,7 +8,7 @@ import {
workCellTypeValidator,
} from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/resources+/work-cells.tsx b/apps/carbon/app/routes/x+/resources+/work-cells.tsx
index 663b46f565..4de3063ca9 100644
--- a/apps/carbon/app/routes/x+/resources+/work-cells.tsx
+++ b/apps/carbon/app/routes/x+/resources+/work-cells.tsx
@@ -8,7 +8,7 @@ import {
getWorkCellTypes,
} from "~/modules/resources";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { getGenericQueryFilters } from "~/utils/query";
diff --git a/apps/carbon/app/routes/x+/sales+/customer-types.$customerTypeId.tsx b/apps/carbon/app/routes/x+/sales+/customer-types.$customerTypeId.tsx
index 2a8d1fcf0c..da68a18cb1 100644
--- a/apps/carbon/app/routes/x+/sales+/customer-types.$customerTypeId.tsx
+++ b/apps/carbon/app/routes/x+/sales+/customer-types.$customerTypeId.tsx
@@ -9,7 +9,7 @@ import {
upsertCustomerType,
} from "~/modules/sales";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
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.tsx
index 53f1140886..d26ec9295a 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
@@ -4,7 +4,7 @@ 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 { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/sales+/customer-types.new.tsx b/apps/carbon/app/routes/x+/sales+/customer-types.new.tsx
index c753265aa8..b1f4ce41af 100644
--- a/apps/carbon/app/routes/x+/sales+/customer-types.new.tsx
+++ b/apps/carbon/app/routes/x+/sales+/customer-types.new.tsx
@@ -7,7 +7,7 @@ import {
upsertCustomerType,
} from "~/modules/sales";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
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.tsx
index e0530bc75a..07d2e9f934 100644
--- a/apps/carbon/app/routes/x+/sales+/customers.tsx
+++ b/apps/carbon/app/routes/x+/sales+/customers.tsx
@@ -10,7 +10,7 @@ import {
getCustomers,
} from "~/modules/sales";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { getGenericQueryFilters } from "~/utils/query";
diff --git a/apps/carbon/app/routes/x+/service+/$serviceId.index.tsx b/apps/carbon/app/routes/x+/service+/$serviceId.index.tsx
index eaf3968b8c..f8a2d0d069 100644
--- a/apps/carbon/app/routes/x+/service+/$serviceId.index.tsx
+++ b/apps/carbon/app/routes/x+/service+/$serviceId.index.tsx
@@ -6,7 +6,7 @@ import { useRouteData } from "~/hooks";
import type { Service } from "~/modules/parts";
import { ServiceForm, serviceValidator, upsertService } from "~/modules/parts";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/service+/$serviceId.suppliers.new.tsx b/apps/carbon/app/routes/x+/service+/$serviceId.suppliers.new.tsx
index 4618e64a56..6da7ee7894 100644
--- a/apps/carbon/app/routes/x+/service+/$serviceId.suppliers.new.tsx
+++ b/apps/carbon/app/routes/x+/service+/$serviceId.suppliers.new.tsx
@@ -8,7 +8,7 @@ import {
upsertServiceSupplier,
} from "~/modules/parts";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/service+/$serviceId.suppliers.tsx b/apps/carbon/app/routes/x+/service+/$serviceId.suppliers.tsx
index 6bf3098141..e2dac39c6c 100644
--- a/apps/carbon/app/routes/x+/service+/$serviceId.suppliers.tsx
+++ b/apps/carbon/app/routes/x+/service+/$serviceId.suppliers.tsx
@@ -3,7 +3,7 @@ import { json, redirect } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
import { ServiceSuppliers, getServiceSuppliers } from "~/modules/parts";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/service+/$serviceId.tsx b/apps/carbon/app/routes/x+/service+/$serviceId.tsx
index ef3baf3c6b..2b948e2c93 100644
--- a/apps/carbon/app/routes/x+/service+/$serviceId.tsx
+++ b/apps/carbon/app/routes/x+/service+/$serviceId.tsx
@@ -3,7 +3,7 @@ import { json, redirect } from "@remix-run/node";
import { Outlet } from "@remix-run/react";
import { ServicePreview, ServiceSidebar, getService } from "~/modules/parts";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/service+/new.tsx b/apps/carbon/app/routes/x+/service+/new.tsx
index 6857b69dbc..b3eba2246d 100644
--- a/apps/carbon/app/routes/x+/service+/new.tsx
+++ b/apps/carbon/app/routes/x+/service+/new.tsx
@@ -3,7 +3,7 @@ import { redirect } from "@remix-run/node";
import { validationError } from "remix-validated-form";
import { ServiceForm, serviceValidator, upsertService } from "~/modules/parts";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/routes/x+/settings+/company.tsx b/apps/carbon/app/routes/x+/settings+/company.tsx
index ebe6df4ce0..de8eeda541 100644
--- a/apps/carbon/app/routes/x+/settings+/company.tsx
+++ b/apps/carbon/app/routes/x+/settings+/company.tsx
@@ -13,7 +13,7 @@ import {
updateLogo,
} from "~/modules/settings";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/routes/x+/settings+/integrations.exchange-rates-v1.tsx b/apps/carbon/app/routes/x+/settings+/integrations.exchange-rates-v1.tsx
index 49c5f949f2..366af74294 100644
--- a/apps/carbon/app/routes/x+/settings+/integrations.exchange-rates-v1.tsx
+++ b/apps/carbon/app/routes/x+/settings+/integrations.exchange-rates-v1.tsx
@@ -10,7 +10,7 @@ import {
updateIntegration,
} from "~/modules/settings";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/settings+/integrations.google-places-v2.tsx b/apps/carbon/app/routes/x+/settings+/integrations.google-places-v2.tsx
index c434679ac6..2f8cb80c80 100644
--- a/apps/carbon/app/routes/x+/settings+/integrations.google-places-v2.tsx
+++ b/apps/carbon/app/routes/x+/settings+/integrations.google-places-v2.tsx
@@ -10,7 +10,7 @@ import {
updateIntegration,
} from "~/modules/settings";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/settings+/integrations.resend.tsx b/apps/carbon/app/routes/x+/settings+/integrations.resend.tsx
index 3d3e0ced2d..5c7d7a00ea 100644
--- a/apps/carbon/app/routes/x+/settings+/integrations.resend.tsx
+++ b/apps/carbon/app/routes/x+/settings+/integrations.resend.tsx
@@ -10,7 +10,7 @@ import {
updateIntegration,
} from "~/modules/settings";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/settings+/sequences.$tableId.tsx b/apps/carbon/app/routes/x+/settings+/sequences.$tableId.tsx
index ee857b5952..a2ff9df899 100644
--- a/apps/carbon/app/routes/x+/settings+/sequences.$tableId.tsx
+++ b/apps/carbon/app/routes/x+/settings+/sequences.$tableId.tsx
@@ -3,13 +3,13 @@ import { json, redirect } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
import { validationError } from "remix-validated-form";
import {
- getSequence,
SequenceForm,
+ getSequence,
sequenceValidator,
updateSequence,
} from "~/modules/settings";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/settings+/theme.tsx b/apps/carbon/app/routes/x+/settings+/theme.tsx
index 69947459b6..9e615ecb7b 100644
--- a/apps/carbon/app/routes/x+/settings+/theme.tsx
+++ b/apps/carbon/app/routes/x+/settings+/theme.tsx
@@ -12,7 +12,7 @@ import {
updateTheme,
} from "~/modules/settings";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/routes/x+/shared+/notes.$noteId.delete.tsx b/apps/carbon/app/routes/x+/shared+/notes.$noteId.delete.tsx
index 857dc317ac..4f716656ee 100644
--- a/apps/carbon/app/routes/x+/shared+/notes.$noteId.delete.tsx
+++ b/apps/carbon/app/routes/x+/shared+/notes.$noteId.delete.tsx
@@ -2,7 +2,7 @@ import type { ActionFunctionArgs } from "@remix-run/node";
import { redirect } from "@remix-run/node";
import { deleteNote } from "~/modules/shared";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { error } from "~/utils/result";
export async function action({ request, params }: ActionFunctionArgs) {
diff --git a/apps/carbon/app/routes/x+/shared+/notes.new.tsx b/apps/carbon/app/routes/x+/shared+/notes.new.tsx
index 3e07d6d808..54aedd5e9a 100644
--- a/apps/carbon/app/routes/x+/shared+/notes.new.tsx
+++ b/apps/carbon/app/routes/x+/shared+/notes.new.tsx
@@ -3,7 +3,7 @@ import { redirect } from "@remix-run/node";
import { validationError } from "remix-validated-form";
import { insertNote, noteValidator } from "~/modules/shared";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/supplier+/$supplierId.contacts.$supplierContactId.tsx b/apps/carbon/app/routes/x+/supplier+/$supplierId.contacts.$supplierContactId.tsx
index 14df44f9cf..09bf2288c5 100644
--- a/apps/carbon/app/routes/x+/supplier+/$supplierId.contacts.$supplierContactId.tsx
+++ b/apps/carbon/app/routes/x+/supplier+/$supplierId.contacts.$supplierContactId.tsx
@@ -3,13 +3,13 @@ import { json, redirect } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
import { validationError } from "remix-validated-form";
import {
- getSupplierContact,
SupplierContactForm,
+ getSupplierContact,
supplierContactValidator,
updateSupplierContact,
} from "~/modules/purchasing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, badRequest, notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/supplier+/$supplierId.contacts.delete.$supplierContactId.tsx b/apps/carbon/app/routes/x+/supplier+/$supplierId.contacts.delete.$supplierContactId.tsx
index e30e74e7f4..02c631f6c1 100644
--- a/apps/carbon/app/routes/x+/supplier+/$supplierId.contacts.delete.$supplierContactId.tsx
+++ b/apps/carbon/app/routes/x+/supplier+/$supplierId.contacts.delete.$supplierContactId.tsx
@@ -2,7 +2,7 @@ import type { ActionFunctionArgs } from "@remix-run/node";
import { redirect } from "@remix-run/node";
import { deleteSupplierContact } from "~/modules/purchasing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/supplier+/$supplierId.contacts.new.tsx b/apps/carbon/app/routes/x+/supplier+/$supplierId.contacts.new.tsx
index 3116af22e0..b3e2916255 100644
--- a/apps/carbon/app/routes/x+/supplier+/$supplierId.contacts.new.tsx
+++ b/apps/carbon/app/routes/x+/supplier+/$supplierId.contacts.new.tsx
@@ -8,7 +8,7 @@ import {
supplierContactValidator,
} from "~/modules/purchasing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/supplier+/$supplierId.contacts.tsx b/apps/carbon/app/routes/x+/supplier+/$supplierId.contacts.tsx
index 13aa0d2c93..b8844fb402 100644
--- a/apps/carbon/app/routes/x+/supplier+/$supplierId.contacts.tsx
+++ b/apps/carbon/app/routes/x+/supplier+/$supplierId.contacts.tsx
@@ -1,9 +1,9 @@
import type { LoaderFunctionArgs } from "@remix-run/node";
import { json, redirect } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
-import { getSupplierContacts, SupplierContacts } from "~/modules/purchasing";
+import { SupplierContacts, getSupplierContacts } from "~/modules/purchasing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/supplier+/$supplierId.index.tsx b/apps/carbon/app/routes/x+/supplier+/$supplierId.index.tsx
index db30849d1c..4d8c4225fa 100644
--- a/apps/carbon/app/routes/x+/supplier+/$supplierId.index.tsx
+++ b/apps/carbon/app/routes/x+/supplier+/$supplierId.index.tsx
@@ -10,7 +10,7 @@ import {
updateSupplier,
} from "~/modules/purchasing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/supplier+/$supplierId.locations.$supplierLocationId.tsx b/apps/carbon/app/routes/x+/supplier+/$supplierId.locations.$supplierLocationId.tsx
index f7e94bdcc1..763d1f2ff9 100644
--- a/apps/carbon/app/routes/x+/supplier+/$supplierId.locations.$supplierLocationId.tsx
+++ b/apps/carbon/app/routes/x+/supplier+/$supplierId.locations.$supplierLocationId.tsx
@@ -3,13 +3,13 @@ import { json, redirect } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
import { validationError } from "remix-validated-form";
import {
- getSupplierLocation,
SupplierLocationForm,
+ getSupplierLocation,
supplierLocationValidator,
updateSupplierLocation,
} from "~/modules/purchasing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, badRequest, notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/supplier+/$supplierId.locations.delete.$supplierLocationId.tsx b/apps/carbon/app/routes/x+/supplier+/$supplierId.locations.delete.$supplierLocationId.tsx
index d16863e68e..ae1eb1fc0d 100644
--- a/apps/carbon/app/routes/x+/supplier+/$supplierId.locations.delete.$supplierLocationId.tsx
+++ b/apps/carbon/app/routes/x+/supplier+/$supplierId.locations.delete.$supplierLocationId.tsx
@@ -2,7 +2,7 @@ import type { ActionFunctionArgs } from "@remix-run/node";
import { redirect } from "@remix-run/node";
import { deleteSupplierLocation } from "~/modules/purchasing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/supplier+/$supplierId.locations.new.tsx b/apps/carbon/app/routes/x+/supplier+/$supplierId.locations.new.tsx
index 78ff4b74ae..81f2c028c6 100644
--- a/apps/carbon/app/routes/x+/supplier+/$supplierId.locations.new.tsx
+++ b/apps/carbon/app/routes/x+/supplier+/$supplierId.locations.new.tsx
@@ -7,7 +7,7 @@ import {
supplierLocationValidator,
} from "~/modules/purchasing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/supplier+/$supplierId.locations.tsx b/apps/carbon/app/routes/x+/supplier+/$supplierId.locations.tsx
index b8e821868f..23405cb9f9 100644
--- a/apps/carbon/app/routes/x+/supplier+/$supplierId.locations.tsx
+++ b/apps/carbon/app/routes/x+/supplier+/$supplierId.locations.tsx
@@ -1,9 +1,9 @@
import type { LoaderFunctionArgs } from "@remix-run/node";
import { json, redirect } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
-import { getSupplierLocations, SupplierLocations } from "~/modules/purchasing";
+import { SupplierLocations, getSupplierLocations } from "~/modules/purchasing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/supplier+/$supplierId.payments.tsx b/apps/carbon/app/routes/x+/supplier+/$supplierId.payments.tsx
index 36a7598968..c1ed09adfc 100644
--- a/apps/carbon/app/routes/x+/supplier+/$supplierId.payments.tsx
+++ b/apps/carbon/app/routes/x+/supplier+/$supplierId.payments.tsx
@@ -9,7 +9,7 @@ import {
updateSupplierPayment,
} from "~/modules/purchasing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/supplier+/$supplierId.shipping.tsx b/apps/carbon/app/routes/x+/supplier+/$supplierId.shipping.tsx
index 4ee7d6541d..a513c0b9dd 100644
--- a/apps/carbon/app/routes/x+/supplier+/$supplierId.shipping.tsx
+++ b/apps/carbon/app/routes/x+/supplier+/$supplierId.shipping.tsx
@@ -9,7 +9,7 @@ import {
updateSupplierShipping,
} from "~/modules/purchasing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/supplier+/$supplierId.tsx b/apps/carbon/app/routes/x+/supplier+/$supplierId.tsx
index 93d2c8136b..c69c7b6289 100644
--- a/apps/carbon/app/routes/x+/supplier+/$supplierId.tsx
+++ b/apps/carbon/app/routes/x+/supplier+/$supplierId.tsx
@@ -9,7 +9,7 @@ import {
getSupplierLocations,
} from "~/modules/purchasing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/supplier+/new.tsx b/apps/carbon/app/routes/x+/supplier+/new.tsx
index 303b97a0c8..93ad80fbf3 100644
--- a/apps/carbon/app/routes/x+/supplier+/new.tsx
+++ b/apps/carbon/app/routes/x+/supplier+/new.tsx
@@ -7,7 +7,7 @@ import {
supplierValidator,
} from "~/modules/purchasing";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/users+/bulk-edit-permissions.tsx b/apps/carbon/app/routes/x+/users+/bulk-edit-permissions.tsx
index bceee0dd6a..a86765e39c 100644
--- a/apps/carbon/app/routes/x+/users+/bulk-edit-permissions.tsx
+++ b/apps/carbon/app/routes/x+/users+/bulk-edit-permissions.tsx
@@ -9,7 +9,7 @@ import {
import type { UserPermissionsQueueData } from "~/queues";
import { userPermissionsQueue } from "~/queues";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
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.tsx
index ec5dcdb8b3..f0054cc918 100644
--- a/apps/carbon/app/routes/x+/users+/customers.new.tsx
+++ b/apps/carbon/app/routes/x+/users+/customers.new.tsx
@@ -7,7 +7,7 @@ import {
} from "~/modules/users";
import { createCustomerAccount } from "~/modules/users/users.server";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/routes/x+/users+/customers.tsx b/apps/carbon/app/routes/x+/users+/customers.tsx
index 5307a89510..3c3eab03e3 100644
--- a/apps/carbon/app/routes/x+/users+/customers.tsx
+++ b/apps/carbon/app/routes/x+/users+/customers.tsx
@@ -10,7 +10,7 @@ import {
getCustomers,
} from "~/modules/users";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { getGenericQueryFilters } from "~/utils/query";
diff --git a/apps/carbon/app/routes/x+/users+/deactivate.tsx b/apps/carbon/app/routes/x+/users+/deactivate.tsx
index ea44fe6361..a80d09651e 100644
--- a/apps/carbon/app/routes/x+/users+/deactivate.tsx
+++ b/apps/carbon/app/routes/x+/users+/deactivate.tsx
@@ -6,7 +6,7 @@ import { deactivateUser } from "~/modules/users/users.server";
import type { UserAdminQueueData } from "~/queues";
import { userAdminQueue, UserAdminQueueType } from "~/queues";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
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.tsx
index dae0300ce5..dd5932feda 100644
--- a/apps/carbon/app/routes/x+/users+/employee-types.$employeeTypeId.tsx
+++ b/apps/carbon/app/routes/x+/users+/employee-types.$employeeTypeId.tsx
@@ -13,7 +13,7 @@ import {
} from "~/modules/users";
import { makePermissionsFromEmployeeType } from "~/modules/users/users.server";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
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.tsx
index 99ce049e96..e81b297a37 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
@@ -4,7 +4,7 @@ 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 { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/users+/employee-types.new.tsx b/apps/carbon/app/routes/x+/users+/employee-types.new.tsx
index 268ad8f70e..cf778a19b5 100644
--- a/apps/carbon/app/routes/x+/users+/employee-types.new.tsx
+++ b/apps/carbon/app/routes/x+/users+/employee-types.new.tsx
@@ -12,7 +12,7 @@ import {
} from "~/modules/users";
import { makeEmptyPermissionsFromFeatures } from "~/modules/users/users.server";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/users+/employees.$employeeId.tsx b/apps/carbon/app/routes/x+/users+/employees.$employeeId.tsx
index 66a7181988..942022dddf 100644
--- a/apps/carbon/app/routes/x+/users+/employees.$employeeId.tsx
+++ b/apps/carbon/app/routes/x+/users+/employees.$employeeId.tsx
@@ -16,7 +16,7 @@ import {
updateEmployee,
} from "~/modules/users/users.server";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/users+/employees.new.tsx b/apps/carbon/app/routes/x+/users+/employees.new.tsx
index 19a2883acf..d33eb345e0 100644
--- a/apps/carbon/app/routes/x+/users+/employees.new.tsx
+++ b/apps/carbon/app/routes/x+/users+/employees.new.tsx
@@ -4,7 +4,7 @@ import { validationError } from "remix-validated-form";
import { CreateEmployeeModal, createEmployeeValidator } from "~/modules/users";
import { createEmployeeAccount } from "~/modules/users/users.server";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/routes/x+/users+/employees.tsx b/apps/carbon/app/routes/x+/users+/employees.tsx
index 4e5378ed1b..df64d0c243 100644
--- a/apps/carbon/app/routes/x+/users+/employees.tsx
+++ b/apps/carbon/app/routes/x+/users+/employees.tsx
@@ -10,7 +10,7 @@ import {
getEmployees,
} from "~/modules/users";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { getGenericQueryFilters } from "~/utils/query";
diff --git a/apps/carbon/app/routes/x+/users+/groups.$groupId.tsx b/apps/carbon/app/routes/x+/users+/groups.$groupId.tsx
index 146ae3b77f..8f33896c6b 100644
--- a/apps/carbon/app/routes/x+/users+/groups.$groupId.tsx
+++ b/apps/carbon/app/routes/x+/users+/groups.$groupId.tsx
@@ -3,14 +3,14 @@ import { json, redirect } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
import { validationError } from "remix-validated-form";
import {
- getGroupMembers,
GroupForm,
+ getGroupMembers,
groupValidator,
upsertGroup,
upsertGroupMembers,
} from "~/modules/users";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost, notFound } from "~/utils/http";
import { path } from "~/utils/path";
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.tsx
index 64d7356feb..873ec8647a 100644
--- a/apps/carbon/app/routes/x+/users+/groups.delete.$groupId.tsx
+++ b/apps/carbon/app/routes/x+/users+/groups.delete.$groupId.tsx
@@ -4,7 +4,7 @@ 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 { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { notFound } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/users+/groups.new.tsx b/apps/carbon/app/routes/x+/users+/groups.new.tsx
index 07054da8df..49ecad1f76 100644
--- a/apps/carbon/app/routes/x+/users+/groups.new.tsx
+++ b/apps/carbon/app/routes/x+/users+/groups.new.tsx
@@ -9,7 +9,7 @@ import {
upsertGroupMembers,
} from "~/modules/users";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
import { error, success } from "~/utils/result";
diff --git a/apps/carbon/app/routes/x+/users+/groups.tsx b/apps/carbon/app/routes/x+/users+/groups.tsx
index 5ecee633d1..7bb5a76e61 100644
--- a/apps/carbon/app/routes/x+/users+/groups.tsx
+++ b/apps/carbon/app/routes/x+/users+/groups.tsx
@@ -6,7 +6,7 @@ import { arrayToTree } from "performant-array-to-tree";
import type { Group } from "~/modules/users";
import { GroupsTable, GroupsTableFilters, getGroups } from "~/modules/users";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { getGenericQueryFilters } from "~/utils/query";
diff --git a/apps/carbon/app/routes/x+/users+/resend-invite.tsx b/apps/carbon/app/routes/x+/users+/resend-invite.tsx
index b6d2588d22..ebd5e7d190 100644
--- a/apps/carbon/app/routes/x+/users+/resend-invite.tsx
+++ b/apps/carbon/app/routes/x+/users+/resend-invite.tsx
@@ -6,7 +6,7 @@ import { resendInvite } from "~/modules/users/users.server";
import type { UserAdminQueueData } from "~/queues";
import { userAdminQueue, UserAdminQueueType } from "~/queues";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { error, success } from "~/utils/result";
export async function action({ request }: ActionFunctionArgs) {
diff --git a/apps/carbon/app/routes/x+/users+/suppliers.new.tsx b/apps/carbon/app/routes/x+/users+/suppliers.new.tsx
index 0c0bb1c334..254b367e23 100644
--- a/apps/carbon/app/routes/x+/users+/suppliers.new.tsx
+++ b/apps/carbon/app/routes/x+/users+/suppliers.new.tsx
@@ -7,7 +7,7 @@ import {
} from "~/modules/users";
import { createSupplierAccount } from "~/modules/users/users.server";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import { assertIsPost } from "~/utils/http";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/routes/x+/users+/suppliers.tsx b/apps/carbon/app/routes/x+/users+/suppliers.tsx
index cb95d85050..44d66d3ecc 100644
--- a/apps/carbon/app/routes/x+/users+/suppliers.tsx
+++ b/apps/carbon/app/routes/x+/users+/suppliers.tsx
@@ -10,7 +10,7 @@ import {
getSuppliers,
} from "~/modules/users";
import { requirePermissions } from "~/services/auth";
-import { flash } from "~/services/session";
+import { flash } from "~/services/session.server";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { getGenericQueryFilters } from "~/utils/query";
diff --git a/apps/carbon/app/services/auth/auth.form.ts b/apps/carbon/app/services/auth/auth.models.ts
similarity index 100%
rename from apps/carbon/app/services/auth/auth.form.ts
rename to apps/carbon/app/services/auth/auth.models.ts
diff --git a/apps/carbon/app/services/auth/auth.server.ts b/apps/carbon/app/services/auth/auth.server.ts
index b87f879d76..9b42e3ef5b 100644
--- a/apps/carbon/app/services/auth/auth.server.ts
+++ b/apps/carbon/app/services/auth/auth.server.ts
@@ -7,7 +7,7 @@ import type {
import { REFRESH_ACCESS_TOKEN_THRESHOLD, VERCEL_URL } from "~/config/env";
import { getSupabase, getSupabaseServiceRole } from "~/lib/supabase";
import { getUserClaims } from "~/modules/users/users.server";
-import { flash, requireAuthSession } from "~/services/session";
+import { flash, requireAuthSession } from "~/services/session.server";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
import type { AuthSession } from "./types";
diff --git a/apps/carbon/app/services/auth/index.ts b/apps/carbon/app/services/auth/index.ts
index 46af068c2d..7fe5d8504d 100644
--- a/apps/carbon/app/services/auth/index.ts
+++ b/apps/carbon/app/services/auth/index.ts
@@ -1,3 +1,3 @@
+export * from "./auth.models";
export * from "./auth.server";
-export * from "./auth.form";
export * from "./types";
diff --git a/apps/carbon/app/services/mode.server.ts b/apps/carbon/app/services/mode.server.ts
new file mode 100644
index 0000000000..f2b7cf26cd
--- /dev/null
+++ b/apps/carbon/app/services/mode.server.ts
@@ -0,0 +1,21 @@
+import * as cookie from "cookie";
+import type { Mode } from "~/types/validators";
+
+const cookieName = "mode";
+
+export function getMode(request: Request): Mode | null {
+ const cookieHeader = request.headers.get("cookie");
+ const parsed = cookieHeader
+ ? cookie.parse(cookieHeader)[cookieName]
+ : "light";
+ if (parsed === "light" || parsed === "dark") return parsed;
+ return null;
+}
+
+export function setMode(Mode: Mode | "system") {
+ if (Mode === "system") {
+ return cookie.serialize(cookieName, "", { path: "/", maxAge: -1 });
+ } else {
+ return cookie.serialize(cookieName, Mode, { path: "/", maxAge: 31536000 });
+ }
+}
diff --git a/apps/carbon/app/services/session/session.server.ts b/apps/carbon/app/services/session.server.ts
similarity index 97%
rename from apps/carbon/app/services/session/session.server.ts
rename to apps/carbon/app/services/session.server.ts
index a902dff5e3..c73e0a31d5 100644
--- a/apps/carbon/app/services/session/session.server.ts
+++ b/apps/carbon/app/services/session.server.ts
@@ -19,8 +19,8 @@ import {
import type { Result } from "~/types";
import { path } from "~/utils/path";
-import { refreshAccessToken, verifyAuthSession } from "../auth/auth.server";
-import type { AuthSession } from "../auth/types";
+import { refreshAccessToken, verifyAuthSession } from "./auth/auth.server";
+import type { AuthSession } from "./auth/types";
async function assertAuthSession(
request: Request,
diff --git a/apps/carbon/app/services/session/index.ts b/apps/carbon/app/services/session/index.ts
deleted file mode 100644
index 9a2ab4452c..0000000000
--- a/apps/carbon/app/services/session/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from "./session.server";
diff --git a/apps/carbon/app/types/validators.ts b/apps/carbon/app/types/validators.ts
index 86d9e86c12..7efa8a7a7e 100644
--- a/apps/carbon/app/types/validators.ts
+++ b/apps/carbon/app/types/validators.ts
@@ -8,6 +8,12 @@ export type TypeOfValidator<U extends Validator<any>> = U extends Validator<
? T
: unknown;
+export type Mode = "light" | "dark";
+
+export const modeValidator = z.object({
+ mode: z.enum(["light", "dark", "system"]),
+});
+
export const address = {
addressId: zfd.text(z.string().optional()),
addressLine1: zfd.text(z.string().optional()),
diff --git a/apps/carbon/package.json b/apps/carbon/package.json
index 437283425f..6899437032 100644
--- a/apps/carbon/package.json
+++ b/apps/carbon/package.json
@@ -55,6 +55,7 @@
"axios": "^1.6.5",
"bullmq": "^4.6.2",
"clsx": "^2.0.0",
+ "cookie": "^0.6.0",
"d3-array": "^3.2.4",
"framer-motion": "^10.13.1",
"isbot": "3.6.13",
diff --git a/package-lock.json b/package-lock.json
index 042d111ff5..b75bc49ae1 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -71,6 +71,7 @@
"axios": "^1.6.5",
"bullmq": "^4.6.2",
"clsx": "^2.0.0",
+ "cookie": "^0.6.0",
"d3-array": "^3.2.4",
"framer-motion": "^10.13.1",
"isbot": "3.6.13",
diff --git a/packages/utils/src/themes.ts b/packages/utils/src/themes.ts
index 3065a442b1..a2d270aa4f 100644
--- a/packages/utils/src/themes.ts
+++ b/packages/utils/src/themes.ts
@@ -3,7 +3,7 @@ import template from "lodash.template";
export const themes = [
{
name: "zinc",
- label: "Zinc",
+ label: "Carbon",
activeColor: {
light: "240 5.9% 10%",
dark: "240 5.2% 33.9%",