From 43d5452a286c7449d963d3771db7769ae9c8523b Mon Sep 17 00:00:00 2001 From: mihir Date: Sat, 14 Nov 2026 00:47:56 +0530 Subject: [PATCH] feat: add B2B account onboarding and verification --- docs/PHASES.md | 6 + src/App.tsx | 6 + src/components/WorkspaceShell.tsx | 1 + src/lib/business.ts | 49 +++++++ src/pages/BusinessAccountsPage.tsx | 228 +++++++++++++++++++++++++++++ test/business.test.ts | 28 ++++ test/workflows.ui.test.tsx | 66 +++++++++ 7 files changed, 384 insertions(+) create mode 100644 src/lib/business.ts create mode 100644 src/pages/BusinessAccountsPage.tsx create mode 100644 test/business.test.ts diff --git a/docs/PHASES.md b/docs/PHASES.md index fef9e85..9605900 100644 --- a/docs/PHASES.md +++ b/docs/PHASES.md @@ -45,3 +45,9 @@ Customer and administration screens are implemented, with recovery, pricing, sto - BOM UAT should activate a second revision and confirm the previous revision becomes superseded. Repeat for the other BOM type and verify its active revision is independent. Check that inactive materials and stale drafts are rejected. - Costing UAT should revise a material rate and verify that future BOM estimates use the new revision while an existing batch snapshot retains its original amounts and rates. Test missing rates, missing usage, and fully rejected output. - Warehouse movement UAT should verify both ledgers and unchanged combined stock after a transfer, rejection of insufficient stock, and one ledger entry for a retried adjustment. + +## Phase 4 implementation status + +- Staff can create, edit, submit and review B2B business accounts. Verification uses submitted profile snapshots, separate permissions for submission and review, and an immutable event history. +- B2B UAT should use distinct submitting and reviewing accounts. Verify self-review is blocked, rejection allows correction and resubmission, and a verified profile is read-only. +- Price lists, minimum order quantities, quotes, credit policies, samples, artwork, partner orders and payments, custom requests and reporting remain open. diff --git a/src/App.tsx b/src/App.tsx index 22610d7..434714d 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -29,6 +29,7 @@ const AuditPage = lazy(() => const CatalogAdminPage = lazy(() => import("@/pages/CatalogAdminPage")); const InventoryPage = lazy(() => import("@/pages/InventoryPage")); const MaterialStockPage = lazy(() => import("@/pages/MaterialStockPage")); +const BusinessAccountsPage = lazy(() => import("@/pages/BusinessAccountsPage")); const MaterialCostRatesPage = lazy(() => import("@/pages/MaterialCostRatesPage")); const ProcurementPage = lazy(() => import("@/pages/ProcurementPage")); const BomPage = lazy(() => import("@/pages/BomPage")); @@ -67,6 +68,11 @@ function Router() { + {() => } + {() => } + + {(params) => } + {() => } {(params) => } diff --git a/src/components/WorkspaceShell.tsx b/src/components/WorkspaceShell.tsx index e7fc74d..a9efe24 100644 --- a/src/components/WorkspaceShell.tsx +++ b/src/components/WorkspaceShell.tsx @@ -70,6 +70,7 @@ export function WorkspaceNavigation() { { label: "Pricing", path: "/admin/pricing", permission: "pricing.manage" }, { label: "All orders", path: "/admin/orders", permission: "orders.read" }, { label: "Audit", path: "/admin/audit", permission: "audit.read" }, + { label: "Business accounts", path: "/admin/business-accounts", permission: "b2b.read" }, ]; return (