Delivery
Delivery integration spans dining-options configuration, DoorDash provider hookup, status tracking via webhooks, and customer push notifications. Documentation lives in yum/docs/DELIVERY_ADMIN_GUIDE.md (restaurant config) and yum/docs/DELIVERY_CONSUMER_GUIDE.md (customer flow).
Current State
| Capability | Status | Notes |
|---|---|---|
diningOptions.delivery flag |
Built | Per-location (moved from restaurant 2026-04) |
| Restaurant address + lat/lng | Built | On restaurants table |
| Delivery status webhooks → push notifications | Built | DoorDash driver_assigned / picked_up / enroute / delivered |
| DoorDash credentials | Provisioned | Env vars set, no API client code yet |
| DoorDash delivery creation | Not built | Outbound API client + JWT signing pending |
| Delivery zone / radius config | Not built | No tables or logic |
| Delivery fee configuration | Not built | No fields on order/cart yet |
| Delivery address collection at checkout | Built (mobile) | See Mobile Checkout |
Order Flow
- Customer enables delivery during checkout if the location supports it (
location.diningOptions.delivery === true). - Customer provides a delivery address (mobile uses
useAddresses()hook +AddAddressSheet). - Order is created with
orderType: "delivery". - Staff updates order through normal lifecycle (
Received→Processing→Ready). - (Planned) On
Ready, yum calls DoorDash to create a delivery and stores the external delivery ID on the order. - DoorDash sends webhook events as the dasher progresses; the
routes/webhook.tshandler updates the order and triggers push notifications (driver_assigned,driver_pickup,driver_en_route,delivery_completed).
Configuration
diningOptions and deliveryProvider moved from restaurants to locations in the 2026-04 location-scoped settings migration. Update them via:
PUT /restaurants/:restaurantId/locations/:locationId
{
"diningOptions": { "dineIn": true, "pickup": true, "delivery": true },
"deliveryProvider": "doordash"
}
Allowed providers: doordash, uber_eats, grubhub, postmates, self. The canonical diningOptions shape is { dineIn?, pickup?, delivery? }. The legacy takeAway alias was dropped.
Required Environment
DEVELOPER_ID_DOOR_DASH=
KEY_ID=
SIGNING_SECRET=
DOORDASH_WEBHOOK_TOKEN=
Credentials are provisioned in dev/staging/prod but the outbound API client (api/services/doordash.ts) is still pending — webhook ingestion works end-to-end already.
Key Files
| Path | Purpose |
|---|---|
yum/api/routes/webhook.ts |
DoorDash status webhook handler |
yum/api/services/order.ts |
isDeliveryOnlyUpdate branch + delivery notification dispatch |
yum/api/services/notifications.ts |
Driver/delivery push payloads |
yum/docs/DELIVERY_ADMIN_GUIDE.md |
Restaurant-side configuration walkthrough |
yum/docs/DELIVERY_CONSUMER_GUIDE.md |
Customer flow walkthrough |
SMACKZ-MOBILE/src/features/checkout/components/DeliveryAddressSection.tsx |
Address selection during checkout |
SMACKZ-MOBILE/src/features/addresses/ |
Customer address CRUD |