← All tests

Loyalty Spin & Reward engine (prod)

Phase 2 of the NIX Loyalty Platform (Narong’s priority) — the gamified Spin feature, exclusive to Get Coffee via a per-tenant flag. A paid POS order earns spin chances; spinning runs a server-side crypto-secure %-weighted draw over the merchant’s reward pool and grants points (straight to the ledger) or a coupon.

Gate 2 4/4 passed (demo, spin-enabled test tenant) + 23/23 regression subset. nix-cafe cb971c1, loyalty backend 41f14ce (redeployed to Fly, migration 0002).

Backend engine: POST /spin/spin — a crypto-secure weighted draw with a never-zero guarantee (the leftover % below 100 falls to a consolation reward; if none is set, the lowest reward — a spin is never empty), excluding locked/inactive entries. Points rewards post to the ledger immediately; coupon rewards mint a coupon for POS fulfilment. /pos/earn is now config-driven (Chance Conversion Mode + per-product 1-or-none).

Admin (this ship): the two placeholder tabs are now live — Orders & Spins (conversion mode + per-product eligibility + spin-chances list with admin void) and Reward Settings (reward types + the %-weighted reward pool with active/locked/consolation flags and a live “leftover → consolation” readout). Both are gated to spin-enabled tenants.

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

✓ SSO-login demo owner (spin-enabled tenant)
✓ Spin tabs present (not “coming soon”)
✓ Orders & Spins renders + conversion-mode save round-trips to the backend
✓ Reward Settings renders the seeded reward type + pool

Screens

Orders & Spins
Orders & Spins — conversion mode + per-product eligibility + chances
Reward Settings
Reward Settings — reward types + %-weighted pool with consolation