← All tests

Loyalty Food Delivery Apps POS — register STAGING

Phase 5 of the NIX Loyalty Platform — delivery integration. Orders from delivery platforms (Foodpanda / WOW NOW / E-GETS / Grab / Nham) are captured into a virtual “Food Delivery Apps POS” register; each becomes a customer-claimable spin chance. This ship is the merchant-facing register view inside nix-cafe (“Loyalty Mobile App Settings” → Food Delivery): list delivery orders with a status filter and void an order (which cancels its unspun chances). It is an API client of the separate loyalty backend (GET /admin/delivery-orders, POST /admin/delivery-orders/:id/void).

End-to-end pipeline (all shipped this session)

Ingestvirtual-printer daemon (TCP 9100 → ESC/POS parse) or structured/OCR → /pos/delivery/ingest
Claimcustomer enters delivery order # in the app → /delivery/claim (1h anti-fraud window)
Registerthis admin view — list + status filter + void
Spinclaimed chances become spinnable after the window elapses
Gate 2 (staging) — 10/10 passed on demo.staging.nixtech.app, wired to the staging loyalty backend (Fly) on Neon loyalty_staging (migration 0004 rehearsed there first). A delivery order was ingested on staging demo, rendered in the register, filtered by status, and voided through the UI (server action → loyalty backend → the order flips to voided).

Bug caught & fixed by this Gate 2: bodyless service POSTs (void / cancel) sent Content-Type: application/json with an empty body, which Fastify 400’d — so Void (and the existing cancel spin chance) silently failed. Fixed backend-side with an empty-body-tolerant JSON parser (1255c89), redeployed to staging, re-verified green.

Parked on staging awaiting the scheduled prod promote; the full narongix regression sweep runs at that promote. Prod still needs migration 0004 + a backend Fly deploy.

Gate 2 evidence (demo, logged-in browser on staging):

SSO login demo.staging
Loyalty settings page loads (authed)
No load error — staging loyalty backend reachable
Food Delivery register renders
Seeded delivery order STG-5001 row renders (Foodpanda · 3 spins)
Status filter works (a voided filter hides an ingested order)
Void round-trips (server action → POST /admin/delivery-orders/:id/void) — order now voided
No 5xx during the flow  ·  staging SSO smoke still 5/5 (no regression from the redeploy)

Screens

Food Delivery register
Food Delivery Apps POS register — ingested delivery order with status filter + Void
Order voided
After Void — the order round-trips to voided in the loyalty backend

nix-cafe ece1508 (dev + staging) · loyalty backend 602f95d1255c89 (dev; migration 0004, ESC/POS parser, ingest/claim/OCR, virtual-printer daemon) · no nix-db migration.