WFDASH-WEBAPP/src/lib
SJCoetz 811493bedb feat(collection-pool): add page and service function
Restores the /collection-pool feature in this codebase.

- src/lib/server/orders-service.ts
  - Re-adds `listCollectionPool({ status, page, perPage })` which
    queries the `collection_pool` PB collection via the admin
    client (filter on pool_status, sort -created, expand
    order_item/order/supplier/drv_id). MCP route.ts already
    imported this — without it, the MCP route failed to
    compile.

- src/app/(app)/collection-pool/{page,components,view-model}*.tsx
  - Re-creates the page directory (5 files, 2 315 lines) carrying
    the supplier-group + per-stop checkbox UI, the
    `CollectionPoolRowSource = "customer" | "stock"` union, the
    assignment-state badge helpers (buildProximityMarkerMap,
    buildSupplierGroups, buildVisibleRows), and the
    MarkReadyDialog / AssignDriverDialog wiring.

- src/app/api/mcp/route.test.ts
  - Adds `const listCollectionPool = vi.fn()` and exposes it in
    the vi.mock factory so the existing collection_pool.list test
    cases (and the bulk_update_quote_items ones that call
    `.mockReset()` on every fixture) stop crashing with
    'ReferenceError: listCollectionPool is not defined'.

Not in this commit (kept narrow per request):
- The /api/v1/collection-pool route handler and its test
- The 'Collection Pool' entry in the sidebar nav
- The migration script that creates the live `collection_pool`
  PB collection (it doesn't exist on the cloud PB instance
  yet; the page render relies on it being created separately
  or via `npm run pb:migrate:orders-v2`)
2026-07-27 15:04:30 +02:00
..
pdf chore: add logos, opencode config and build assets 2026-07-27 08:21:20 +02:00
server feat(collection-pool): add page and service function 2026-07-27 15:04:30 +02:00
dev-identity.test.ts feat(sprint): add new sprint pricing workflow and supporting code 2026-07-03 07:29:43 +02:00
dev-identity.ts feat(sprint): add new sprint pricing workflow and supporting code 2026-07-03 07:29:43 +02:00
geo.test.ts polish(geo): clamp driverLabelFor at '9' instead of wrapping to '0' 2026-07-11 23:40:04 +02:00
geo.ts polish(geo): clamp driverLabelFor at '9' instead of wrapping to '0' 2026-07-11 23:40:04 +02:00
item-status-ui.ts chore: add logos, opencode config and build assets 2026-07-27 08:21:20 +02:00
letterhead.ts feat(invoicing): add complete delivery note workflow 2026-07-14 17:35:36 +02:00
order-color.test.ts test(order-color): pin colorForOrder behaviour 2026-07-10 02:04:38 +02:00
order-color.ts feat(order-color): add FNV-1a hash helper for per-order color stripes 2026-07-10 02:05:45 +02:00
pb-helpers-duplicate.test.ts chore: add logos, opencode config and build assets 2026-07-27 08:21:20 +02:00
pb-helpers.ts fix(api,layout): sprint 500 chunk + add 9 missing top-level agent routes + metadataBase; drop unused collection_pool feature; quote counter fix migration 2026-07-26 22:18:49 +02:00
pin-model.test.ts feat(pin-model): add aggregateDriverStatus helper (TDD) 2026-07-12 12:12:41 +02:00
pocketbase.ts chore: standardize line endings and add full test + config scaffolding 2026-06-11 20:30:02 +02:00
price-list-search.ts feat: implement sku-based catalogue pricing matching workflow 2026-06-30 21:20:53 +02:00
quote-status.test.ts chore: add logos, opencode config and build assets 2026-07-27 08:21:20 +02:00
quote-status.ts chore: add logos, opencode config and build assets 2026-07-27 08:21:20 +02:00
stock-fulfillment.test.ts feat(stock): implement stock management workflow 2026-07-15 21:53:20 +02:00
stock-fulfillment.ts feat(stock): implement stock management workflow 2026-07-15 21:53:20 +02:00
stock-low-stock.ts feat(stock): implement stock management workflow 2026-07-15 21:53:20 +02:00
stock-match.ts feat(stock): implement stock management workflow 2026-07-15 21:53:20 +02:00
stock-status.test.ts feat(stock): implement stock management workflow 2026-07-15 21:53:20 +02:00
stock-status.ts feat(stock): implement stock management workflow 2026-07-15 21:53:20 +02:00
theme-types.ts refactor: switch hardcoded UI colors to semantic theme tokens 2026-07-07 17:22:03 +02:00
themes.ts chore: add logos, opencode config and build assets 2026-07-27 08:21:20 +02:00
types.ts chore: add logos, opencode config and build assets 2026-07-27 08:21:20 +02:00
use-theme-id.ts refactor: switch hardcoded UI colors to semantic theme tokens 2026-07-07 17:22:03 +02:00
user-color.ts feat: add quote email tracking, user color coding, and improved attachments 2026-06-22 15:15:00 +02:00
utils.test.ts chore: standardize line endings and add full test + config scaffolding 2026-06-11 20:30:02 +02:00
utils.ts chore: standardize line endings and add full test + config scaffolding 2026-06-11 20:30:02 +02:00
working-days.ts feat: add AI quote item rewriter and supporting UI/UX changes 2026-06-22 18:29:59 +02:00