First slice of NIX-OS-89 Cafe-as-master. Per Narong's 2026-05-07 architectural confirmation, the Cafe (NIX) Postgres becomes master record and Odoo becomes optional ERP-light receiving endpoint. The R5.7 Odoo→Cafe reverse sync (shipped 2026-05-04) is now wrong-direction and removed in full: cron disabled, route + DAO deleted, watermark column dropped. The close-shift Telegram message — the only remaining caller of the deleted fetchSessionOrders — was swapped to read from cafe.orders directly.
test-phase4-prod.mjs already exercises the close-shift flow (10/10 green) which is the only behavior change. 38/38 across full regression sweep. ~500 LOC removed, 1 column dropped, 1 cron disabled. Forward sync (R5.5) untouched and still drains every minute.
cafe.tenant_config.odoo_reverse_sync_watermark dropped via node migrate.js. Verified with information_schema.columns SELECT — empty result confirms column gone.wrangler deploy -c cron-trigger/wrangler.jsonc. New schedule list: * * * * *, 0 15 * * *, 30 18 * * *. The */15 * * * * reverse-sync trigger is gone — confirmed in deploy output.listOrdersForSession reading from cafe.orders. Side-benefit fix: the old Odoo path counted refunds twice (refund counter-orders had negative amount_total AND were re-subtracted via Math.abs). The cafe-side version uses explicit state='refunded' rows so the math is honest. fetchPosConfigs call kept for the register-name lookup since pos.configs migration is R6.5's scope.fetchSessionOrders as "zero callers in app/" which was technically true but missed the one call site in lib/actions/register.ts's close-shift Telegram block. Lesson: when scoping a delete, grep the WHOLE tree, not just app/.test-r6-1-local.mjs9c6266d (migration .ts + migrate.js entry)f4790b6 (8 files, 38+/896− — net deletion)cafe.tenant_config.odoo_reverse_sync_watermark dropped*/15 schedule removed| Suite | Score | Status | Notes |
|---|---|---|---|
| test-phase4-prod | 10/10 | PASS | De-facto R6.1 prod test — exercises close-shift flow (the rewritten Telegram block path). |
| test-receipt-fixes-prod | 6/6 | PASS | Required 1 retry (transient flake at SSO step on first run, clean on retry — matches the now-twice-observed pattern). |
| test-nix-os-87-prod | 11/11 | PASS | Settings master-detail still mounted across navigations. |
| test-phase1-prod | 11/11 | PASS | Core SSO + tenant routing baseline. |
| Total | 38/38 | PASS |
nix-outdoor-sales-backend (commit 9c6266d): migrations/20260507100000_drop_cafe_tenant_config_reverse_sync_watermark.ts NEW migrate.js + registry entry nix-cafe (commit f4790b6) — net 858 LOC removed: app/api/cafe/cron/odoo-reverse-sync/route.ts DELETED (~270 LOC) app/api/cafe/cron/odoo-reverse-sync/ dir removed lib/db/odoo_reverse_sync.ts DELETED (~140 LOC) scripts/test-r5-7-prod.ts DELETED cron-trigger/worker.ts dropped */15 case + fireOdooReverseSync cron-trigger/wrangler.jsonc dropped */15 from crons array lib/db/schema.ts dropped odooReverseSyncWatermark column lib/odoo/queries.ts dropped fetchSessionOrders lib/actions/register.ts Telegram block: fetchSessionOrders → listOrdersForSession
NIX-OS-89 arc continues with 6 more sub-phases: R6.2a cafe.products schema (odoo_product_id) + dark backfill from Odoo R6.2b per-tenant products_master flag flips Pro reads to listProductsForPos R6.3 cafe.customers end-to-end (schema + backfill + read + push) R6.4 product Cafe→Odoo push (blocked on Narong stock+photos clarification) R6.5 payment methods + POS configs as cafe-master R6.6 landing summary cards (fetchSessionSummariesForConfigs → cafe aggregation) Scoping memo: see project_session_2026_05_07_r6_1.md when written.