WFDASH-WIKI/wiki/concepts/driver-coordination.md
David 0c6b660b75 Initial wiki snapshot — Bosch power-tools catalogue (65 products) + WFDASH reconciliation docs
- 4 brand folders scaffolded (bosch, metabo, makita, dewalt, milwaukee, drill-bits, grinding-cutting-discs, paint)
- 65 Bosch product pages created across 20 categories
- 5 products researched with full Bosch specs + SA retail prices
- 1 duplicate resolved (0 601 9N9 000 → GWS 18V-8)
- Source-of-truth hierarchy: manufacturer > distributor > operator
- SCHEMA.md updated with power-tools domain + tag taxonomy
2026-08-09 16:52:31 +00:00

1.8 KiB

title created updated type tags sources confidence
Driver Coordination 2026-08-07 2026-08-07 concept
driver-coordination
partial
collected
raw/articles/wfdash-giellie-supplier-invoice-runbook-2026-08-07.md
high

Driver Coordination

Marking lines collected before physical delivery. The finer-grained state machine alternative to stock-booking.

The state machine

collection_pool → assigned_to_driver → collected

Transitions via:

  • stock_purchase_items.assign_driver(id=line_id, drv_id=driver_id) — null → assigned_to_driver or collection_pool → assigned_to_driver
  • stock_purchase_items.mark_collected(id=line_id) — assigned_to_driver → collected, bumps quantity_received (does NOT book stock)

Why use this flow instead of receive

The operator signals per-line control when they say "we mark items collected not the whole order" (see david-els). This is the safer pattern because:

  • mark_collected only flips status and bumps quantity_received
  • Stock booking happens via stock_purchases.receive separately
  • You can call mark_collected on individual lines as they get delivered, then receive once at the end to close the PO

Header auto-promotion

When every line on the parent PO reaches quantity_received >= quantity, the header auto-flips to received — automatically, no separate call needed.

mark_collected returns header_status_after and header_flipped so the caller can detect the auto-promotion.

MCP param note

stock_purchase_items.mark_collected.quantity_collected defaults to quantity - quantity_received (remaining qty). Explicit value must be ≥ 0 and ≤ remaining.