WFDASHDRIVER-APP/lib
Dave 22bf5dab81 feat(pocketbase): merge stock_purchase_items into Assigned list
Stock pickups live in stock_purchase_items (status="assigned_to_driver"),
not order_items. Previously getMyAssignedItems() only queried order_items,
so a driver with a stock pickup assigned to them saw nothing in the
Assigned tab or Map.

- getMyAssignedStockItems() fetches stock_purchase_items with the
  matching drv_id/status filter and expands purchase.supplier +
  stock_item. A toOrderItemFromStock() reshaper puts each row onto
  the OrderItem shape so the existing card/modal/map components
  render stock pickups unchanged; a kind:'pickup' discriminator
  tags them for the write side.
- handleCollect / handleProblem / handleBulkCollect / handleBulkProblem
  branch on item.kind to PATCH stock_purchase_items instead of
  order_items (status="collected" + quantity_received on collect,
  problem_flag + problem_type + problem_notes on problem; mirrors
  the order_items quantity-mismatch auto-notes).
- Same merge on app/map/page.tsx so the stock stop lands on the map.
- scripts/check-pb-schema.mjs now covers the stock filter so a future
  PB rename is caught at prebuild.
2026-08-17 22:33:10 +02:00
..
hooks.ts feat: popover stays above footer, partial collections must be justified 2026-08-02 22:58:08 +02:00
itemsCache.ts feat: add pickup proof photos, improve performance and UX 2026-07-07 20:43:17 +02:00
pocketbase.ts feat(pocketbase): merge stock_purchase_items into Assigned list 2026-08-17 22:33:10 +02:00
pwa.ts Add PWA support and UI redesign 2026-05-27 00:34:50 +02:00
theme.ts feat: add complete dark mode support with settings toggle 2026-07-07 18:28:19 +02:00
types.ts feat(pocketbase): merge stock_purchase_items into Assigned list 2026-08-17 22:33:10 +02:00
utils.ts feat(grouping): add area grouping, refine UI and cleanup 2026-07-10 02:01:57 +02:00