CampgroundTickets/backend/src
Hank 3a3119e324 Admin hub in /crush33: sidebar, donor lookup, danger-zone actions
Rebuilt the password-gated /crush33 (in-app /comp) screen into an admin
hub with a left sidebar and three sections:

- Comp tickets — the existing entry-only comp creator.
- Donor lookup — admin-only free-text search across the donor master
  list + online/offline transaction tables by name / email / phone /
  address / bear name (columns discovered per table, deduped by email).
- Actions (danger zone) — heavy warnings, red buttons, and an
  "are you sure" modal that spells out exactly what will happen:
    • Wipe slate — delete ALL ticket + audit records in the active
      event table (donor data untouched, irreversible).
    • Switch event table — repoint the app at a different NocoDB
      tickets/audit table to start a new event while keeping the old
      one intact.

Backend:
- New /api/admin/{status,wipe,switch-table,donor-search}, all gated by
  PORTAL_PASSWORD (POST-only so it never lands in a URL/log).
- NocoDBClient + AuditLogger: runtime-switchable tableId, count(),
  deleteAll(), probeTable() (reachable + Id-PK check before switching).
- DonorService.search() with adaptive column discovery.
- Table switch persists across redeploys via a small state file on a
  new /data volume (Dockerfile creates it owned by node so it's
  writable); applied at startup in buildContext.

Also shipped equivalent CLI scripts: scripts/wipe-slate.sh and
scripts/switch-event.sh. Drawer: "Comp tickets" -> "Admin (crush33)".

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 01:29:10 +00:00
..
routes Admin hub in /crush33: sidebar, donor lookup, danger-zone actions 2026-07-23 01:29:10 +00:00
services Admin hub in /crush33: sidebar, donor lookup, danger-zone actions 2026-07-23 01:29:10 +00:00
test Fix ice bag count + default ice check-in to 1 bag 2026-07-20 07:40:05 +00:00
config.ts Admin hub in /crush33: sidebar, donor lookup, danger-zone actions 2026-07-23 01:29:10 +00:00
context.ts Admin hub in /crush33: sidebar, donor lookup, danger-zone actions 2026-07-23 01:29:10 +00:00
fields.ts Vendor webhooks, free kids through 12, multi-origin lookup CORS 2026-07-16 05:13:07 +00:00
fluentforms.ts Fix ice bag count + default ice check-in to 1 bag 2026-07-20 07:40:05 +00:00
server.ts Admin hub in /crush33: sidebar, donor lookup, danger-zone actions 2026-07-23 01:29:10 +00:00
ticketService.ts Add event report dashboard, slide-out drawer, in-app comp portal + creator tracking 2026-07-13 17:30:18 +00:00