From 1443d74cd320d38f0acd0ff1f037e46370975947 Mon Sep 17 00:00:00 2001 From: mihir Date: Sun, 15 Nov 2026 13:13:54 +0530 Subject: [PATCH] feat: manage B2B price lists and minimum quantities --- docs/PHASES.md | 4 +- src/App.tsx | 8 ++ src/components/WorkspaceShell.tsx | 1 + src/lib/price-lists.ts | 39 ++++++ src/pages/BusinessAccountsPage.tsx | 2 + src/pages/PriceListCheck.tsx | 52 ++++++++ src/pages/PriceListsPage.tsx | 184 +++++++++++++++++++++++++++++ test/price-lists.test.ts | 28 +++++ test/workflows.ui.test.tsx | 59 +++++++++ 9 files changed, 376 insertions(+), 1 deletion(-) create mode 100644 src/lib/price-lists.ts create mode 100644 src/pages/PriceListCheck.tsx create mode 100644 src/pages/PriceListsPage.tsx create mode 100644 test/price-lists.test.ts diff --git a/docs/PHASES.md b/docs/PHASES.md index 9605900..dbdfcf4 100644 --- a/docs/PHASES.md +++ b/docs/PHASES.md @@ -50,4 +50,6 @@ Customer and administration screens are implemented, with recovery, pricing, sto - 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. +- B2B price lists support draft variant prices and minimum quantities, activation, archiving, and active-list merchandise previews. +- Price-list UAT should verify that unverified accounts and competing active lists cannot activate a draft, archived terms stay read-only, and price checks reject quantities below the variant minimum. +- 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 434714d..b95fd96 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -30,6 +30,7 @@ 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 PriceListsPage = lazy(() => import("@/pages/PriceListsPage")); const MaterialCostRatesPage = lazy(() => import("@/pages/MaterialCostRatesPage")); const ProcurementPage = lazy(() => import("@/pages/ProcurementPage")); const BomPage = lazy(() => import("@/pages/BomPage")); @@ -73,6 +74,13 @@ function Router() { {(params) => } + {() => } + + {(params) => } + + + {(params) => } + {() => } {(params) => } diff --git a/src/components/WorkspaceShell.tsx b/src/components/WorkspaceShell.tsx index a9efe24..b8fc0bd 100644 --- a/src/components/WorkspaceShell.tsx +++ b/src/components/WorkspaceShell.tsx @@ -71,6 +71,7 @@ export function WorkspaceNavigation() { { 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" }, + { label: "B2B price lists", path: "/admin/b2b-price-lists", permission: "b2b.price.read" }, ]; return (