ReviewOS

stacks/smakelo

B2.5: Delivery dispatch and live tracking

#8
Closed chris opened this 8 days ago ·
8 days ago

Part of #1. Builds on the upstream courier tracking surface (stacksjs/stacks#2384).

  • Courier shifts (CourierProfile.shiftState toggle), merchant self-delivery mode
  • Dispatch: on order ready-for-courier, create DeliveryOffer to the nearest on-shift courier (haversine), accept/decline, timeout cascade to the next courier (queue jobs + backoff)
  • Route creation with pickup + dropoff stops (DeliveryStop.type), ping ingest -> order.{id} / delivery-route.{id} realtime channels, ETA recompute, nearby/arrived notifications
  • Backfill endpoint for natively-recorded GPS tracks (batch of pings with recordedAt; client tracks last-sent timestamp)
  • Courier earnings LedgerEntry on completed delivery (delivery fee share + 100% of tip)
  • Tests: cascade ordering, offer expiry, pickup-then-dropoff status flow, backfill dedup

Sign in to comment on this issue.