pending and carries no rider. What happens next depends on which of the
two fulfilment paths it is on.
Courier assignment
When the quote came from a courier company, that courier owns the shipment. Its staff assign one of their own riders, and the shipment moves toassigned. A rider from a different company cannot
be assigned to it — the check is on the courier company that owns the shipment, not on who is
asking.
The on-demand offer round
On-demand shipments have no assigned courier. Instead, nearby independent drivers are offered the job and the first to accept it takes it. Candidates are narrowed by proximity — the hex-grid search described in Geography & Distance — then ranked by true distance, and the closest few receive a time-limited offer. Each offer names the fare and the distance, so a driver accepts a known job rather than a blind one. Acceptance is first-come, and settled under a row lock so a tie cannot produce two winners:1
The offer is locked and checked
An offer that has already been answered, or whose window has passed, is refused.
2
The shipment is re-checked
If it has picked up a rider in the meantime, the offer is marked expired rather than honoured.
This is the case that makes a race safe: the second driver is told the job is gone, not given
a shipment somebody else is already carrying.
3
The winner is recorded
The offer is accepted, every other outstanding offer on that shipment is expired in the same
transaction, and the shipment moves to
assigned with the driver attached.The status ladder
Both paths converge on one sequence. A shipment moves forward through it, and each transition writes a timestamped event that appears in tracking.in_delivery once the parcel is
on its way and to delivered when it arrives, without a separate call.

