Routes
DSP van routes and delivery attempts (aggregate Route).
Plan a DSP van route in a wave (PlanRoute)
Creates a PLANNED route and publishes RoutePlanned (analytics stream only). The wave must be INDUCTION_CLOSED (illegal-transition), the partner ACTIVE, of the wave's station and the stops at most the partner's van capacity (ErrRouteOverCapacity, 409 route-over-capacity). Every package must be inducted in the wave and not on another route, and the packages of one stop must share one stopKey (G34).
Get a route with its stops and attempts
Returns the route, its stops (with derived outcomes) and every recorded attempt.
Start a route (StartRoute)
PLANNED to OUT_FOR_DELIVERY; the route's wave must be DISPATCHED (illegal-transition otherwise). Publishes one PackageOutForDelivery per tracking number on the route.
Record a delivery attempt (RecordAttempt)
Records DELIVERED, FAILED or COLLECTED for one package on an OUT_FOR_DELIVERY route and publishes DeliveryAttempted. COLLECTED is valid only for a package inducted into the wave as a PICKUP (ADR 0017, activation-gated; every induction is DELIVERY until then). Errors: ErrRouteNotStarted (409 route-not-started), ErrAlreadyDelivered (409 already-delivered). A FAILED attempt counts in the package's attempt history and re-inducts the package onto the next wave (policy RetryNextWave); the third failure publishes PackageReturnInitiated instead. The attempt that records the last outstanding package completes the route, and the last completed route completes the wave.