Waves
Delivery waves of a station (aggregate DeliveryWave).
Schedule a delivery wave (ScheduleWave)
Creates an OPEN wave and publishes DeliveryWaveScheduled. Enforces inductCutoffAt < windowStart < windowEnd (ErrInvalidWaveTimes, 422 invalid-wave-times) and that stationNodeId is a DELIVERY_STATION known from node-topology (ErrUnknownStation, 422 unknown-station). Packages that arrived while no wave was eligible are inducted into the new wave in arrival order (policy InductDeferredOnSchedule).
List the waves of a station for a service date
Returns the waves of the station on the service date ordered by inductCutoffAt then waveId, one keyset page at a time. A station or date with no wave is an empty list.
List the stops of a wave (packages grouped by stopKey)
Returns the packages inducted into the wave grouped into stops by the opaque stopKey (Gap Register G11), ordered by the first induction of each stop. A package with no label data is its own stop. The planner builds PlanRoute from this list. No address is ever returned.
Close induction of a wave (CloseInduction)
OPEN to INDUCTION_CLOSED. No event is published.
Dispatch a wave (DispatchWave)
INDUCTION_CLOSED to DISPATCHED. No event is published for the wave itself. Packages inducted in the wave that no route holds are re-inducted onto the next wave (Gap Register G17 mechanism). A wave with no route left to run completes at once (policy CompleteWaveOnLastRoute), so the response may show COMPLETED.
Cancel a wave (CancelWave)
OPEN to CANCELLED, publishes DeliveryWaveCancelled (an integration event, Gap Register G5). Every package inducted in the wave is re-inducted onto the next eligible wave in the same transaction (Gap Register G17); a package with no eligible wave is deferred (PackageInductionDeferred).
Declare the stop cost of a wave (DeclareCost)
Records the planner's declared marginal cost of ONE delivery stop on the wave (driver time plus mileage share), integer cents, single-currency study (roadmap feature F7, provider B; ADR 0011), and publishes WaveCostDeclared for order-sourcing's money-denominated AssignmentCost. The cost is per stop (the G11 stopKey grouping), never per package. 0 is a legal declared zero marginal cost; a wave with no declaration reports 0 and leaves a consumer's estimate incomplete. Allowed while the wave still runs (OPEN, INDUCTION_CLOSED or DISPATCHED, illegal-transition once CANCELLED or COMPLETED); a later declaration overwrites the earlier one and publishes again.
Declare the stop emission of a wave (DeclareEmission)
Records the planner's declared marginal greenhouse emission of ONE delivery stop on the wave (the stop's share of the route's driving), in grams of CO2 equivalent (roadmap feature C9; ADR 0016), and publishes WaveEmissionDeclared for order-sourcing's estimatedCo2eGrams. The emission is per stop (the G11 stopKey grouping), never per package. 0 is a legal declared zero marginal emission; a wave with no declaration reports 0 and leaves a consumer's estimate incomplete. Allowed while the wave still runs (OPEN, INDUCTION_CLOSED or DISPATCHED, illegal-transition once CANCELLED or COMPLETED); a later declaration overwrites the earlier one and publishes again. Ranking is untouched by this fact: carbon is recorded, not optimised, in this slice.