← All tests

R4.1 — Multi-shop activation E2E PROD

2026-04-29 on get-coffee. First sub-phase of R4 (Cpanel finish). Cpanel shop CRUD has shipped since 04-20 but had never been exercised end-to-end against a multi-shop tenant. R4.1's job: drive the full activation path on prod (admin login → create 2nd shop → cashier-side picker switch → Cpanel disable → picker collapse) and surface any blockers. Two real findings landed.

What R4.1 turned up

9/9 R4.1 prod checks passed.

All R4.1 prod checks (9)

ShopPicker dropdown visible on /cafe/posOwner with two active shops sees the dropdown form (register-shop-picker testid) instead of the single-shop label.
Switched to "Get Coffee Annex"Click annex option → setActiveShop server action persists → picker text flips to the new shop's name.
After Cpanel soft-disable: picker collapses to labelAnnex set to is_active=false via Cpanel API; tenant has 1 active shop again so the dropdown disappears.
90/90 total prod tests green — no regressions from this push.
test-r4-1-prod.mjs (NEW)9/9
test-phase1-prod.mjs11/11
test-receipt-preview-prod.mjs6/6
test-r2-followups3-prod.mjs7/7
test-r2-followups2-prod.mjs11/11
test-r2-followups-prod.mjs19/19
test-nix-os-r2-4b-prod.mjs12/12
test-nix-os-70-2-prod.mjs10/10
test-cafe-followups-prod.mjs5/5

What's new — code surface (prod commit b553925)

nix-cafe @ b553925 (cumulative across fa6b288 + b553925):
  lib/db/shops.ts                                 — listAccessibleShops now filters
                                                    is_active=true AND is wrapped in
                                                    db.transaction() to bypass Hyperdrive
                                                    cache. Soft-disabled shops disappear
                                                    from picker / commerce selector /
                                                    daily-report scope filter immediately
                                                    after Cpanel disable.

prod data fix (no commit, one-shot script):
  admin_operators(id=1, email='admin@nixoutdoor.com', role='super_admin')
    — restored after Supabase migration left table empty.

tests:
  test-r4-1-prod.mjs                              — NEW (9 checks). Drives admin API +
                                                    Cafe UI end-to-end for multi-shop
                                                    activation + soft-disable propagation.

R4 sub-phase status

R4.1 ─ Multi-shop activation E2E         ✓ shipped (2026-04-29)
R4.2 ─ Impersonation                       pending
R4.3 ─ Per-product usage endpoint          pending
R4.4 ─ Drop legacy tenant_limits/plan_code pending (last)

Open follow-ups discovered by R4.1:
  - admin seed in migrate.js (so future fresh DBs don't repeat the lockout)
  - audit other shop reads (kitchen, cashiers, pin_identities) for is_active filter