From 0d821ce1f86f7e9aca256df7001c93ce5959c469 Mon Sep 17 00:00:00 2001 From: Stefan Lazic Date: Mon, 14 Sep 2026 12:25:45 +0100 Subject: [PATCH] add client adds a button to add a new client from the barber menu --- src/app/(staff)/staff/clients/add/page.tsx | 22 +++++ src/app/(staff)/staff/clients/page.tsx | 11 ++- src/features/staff/actions/clients.ts | 56 ++++++++++++ .../staff/components/add-client-form.tsx | 85 +++++++++++++++++++ .../customer.service.integration.test.ts | 52 +++++++++++- src/services/customer/customer.service.ts | 63 ++++++++++++++ 6 files changed, 287 insertions(+), 2 deletions(-) create mode 100644 src/app/(staff)/staff/clients/add/page.tsx create mode 100644 src/features/staff/actions/clients.ts create mode 100644 src/features/staff/components/add-client-form.tsx diff --git a/src/app/(staff)/staff/clients/add/page.tsx b/src/app/(staff)/staff/clients/add/page.tsx new file mode 100644 index 0000000..4e6e59d --- /dev/null +++ b/src/app/(staff)/staff/clients/add/page.tsx @@ -0,0 +1,22 @@ +import type { Metadata } from "next"; +import { redirect } from "next/navigation"; +import { TopNav } from "@/components/navigation/top-nav"; +import { getActingBusinessContext } from "@/lib/business/get-acting-business-context"; +import { AddClientForm } from "@/features/staff/components/add-client-form"; + +export const metadata: Metadata = { title: "Add Client" }; +export const dynamic = "force-dynamic"; + +export default async function AddClientPage() { + const context = await getActingBusinessContext(); + if (!context) redirect("/home"); + + return ( +
+ +
+ +
+
+ ); +} diff --git a/src/app/(staff)/staff/clients/page.tsx b/src/app/(staff)/staff/clients/page.tsx index 8a2005d..11a214c 100644 --- a/src/app/(staff)/staff/clients/page.tsx +++ b/src/app/(staff)/staff/clients/page.tsx @@ -1,5 +1,5 @@ import type { Metadata } from "next"; -import { Search, Users } from "lucide-react"; +import { Plus, Search, Users } from "lucide-react"; import Link from "next/link"; import { redirect } from "next/navigation"; import { EmptyState } from "@/components/feedback/empty-state"; @@ -78,6 +78,15 @@ export default async function StaffClientsPage({ sticky className="bg-stone" leftAction={} + action={ + +