← back to index

U12 — Cpanel "Unlink Odoo" cleanupLOCAL

Architecture cleanup. Removes the legacy DELETE /admin/tenants/:id/cafe-config endpoint that hard-deleted the row (Starter-safe, NOT Pro-safe) and the dead Vue function that referenced it. Slice P (2026-05-19) had already shipped POST /unlink-pause as the Pro-safe alternative and the Cpanel UI was already calling it; the DELETE endpoint was a foot-gun for any external caller.

Summary

Status
7/7 local · typecheck clean · awaiting Gate 1 approval
Repos
nix-outdoor-sales-backend + nix-outdoor-sales-admin (Cpanel Vue)
Files
2 modified · ~30 LOC net deletion
Architecture principle
"One obvious way to do X." Two endpoints for "unlink Odoo" with different semantics was technical debt; the Pro-unsafe DELETE was a foot-gun whose only purpose was to confuse future devs / scripts / Claude.

What ships

Surviving Pro-safe path unchanged: POST /admin/tenants/:id/cafe-config/unlink-pause clears Odoo creds + flips masters→cafe + sets bypassOdooPos=true + KEEPS row. Audit event cafe_config.unlinked_paused.

7/7 local checks

Backend: router.delete('/') block removed; router.post('/unlink-pause') still present
Backend: header docblock no longer lists the DELETE route; contains U12 removal note + /unlink-pause reference
Backend: 'cafe_config.deleted' audit event string gone; 'cafe_config.unlinked_paused' retained
Backend: /unlink-pause still clears all 4 Odoo creds + flips all 3 masters to 'cafe' + sets bypass_odoo_pos: true
Vue: deleteCafeConfig function removed; no leftover apiClient.delete(...cafe-config) call
Vue: "Unlink Odoo" button still wired to pauseCafeConfig; function POSTs to /unlink-pause
Vue: pauseCafeConfig docblock mentions U12 cleanup ("removed the legacy deleteCafeConfig companion that hard-deleted the row")

Backend typecheck: npx tsc --noEmit → 0 errors. Vue project has no vue-tsc in devDeps; relied on the Vue template grep that confirms the only remaining reference is the active pauseCafeConfig handler.

Behaviour notes

Gate 2 plan

  1. Commit nix-outdoor-sales-backend + nix-outdoor-sales-admin (separate commits).
  2. Push both → Render auto-redeploys the backend; CF Pages auto-redeploys Cpanel.
  3. test-u12-prod.mjs: anonymous probe of DELETE /admin/tenants/:id/cafe-config returns 404 (endpoint gone); POST /unlink-pause still returns 401 (auth gate intact) for an unauthenticated probe.
  4. Regression sweep 51/51 (phase2-cafe-multishop solo).
  5. Publish prod gallery.