Existing-sponsor link + remove Interfaces (Pretix/Sessionize)

- Sponsor lookup popup can now link an existing sponsor (dropdown + pre-fill)
  or create a new one; save upserts the sponsor linked to the contact and sets
  the registration type to sponsor.
- Remove the Interfaces feature end-to-end: admin nav button + Sync view, sync
  API helpers + SyncRun type, sync-trigger Edge Function, mock-api + its
  docker-compose service, and a migration dropping the sync RPCs, helpers, and
  sync_runs table.
- Update docs (architecture, backend, frontend, README, roadmap, next-steps).

Co-authored-by: Stephan Charles <[email protected]>
Co-authored-by: Amelia Hernandez <[email protected]>
Co-authored-by: Markus Franz <[email protected]>
Co-authored-by: Sabrina Hota <[email protected]>
Co-authored-by: Nilüfer Doğan <[email protected]>
This commit is contained in:
committed 2026-08-24 09:11:25 +02:00
1 parent ffb270c140
commit 24909cf8ab
27 files changed
+147 -1150

No files matched your search

+10 -29
View File
@@ -20,7 +20,6 @@ It runs on **port 3001** (Vite dev) or as the `convivo-admin` Docker container
| **Schedule** | Slots (with type) + sessions (with speakers 1:N via a **multi-select search dropdown**, material upload with a **submitted / not submitted** state, `average_feedback`, `ai_generated_feedback` + an **Evaluate** stub button). |
| **Activity** | Tables of check-ins, connections, and feedback (per active event). |
| **Events** | Create event, set active (only one), edit dates/location. |
| **Interfaces** | Trigger **Pretix** and **Sessionize** syncs (per-source or "Sync all"), show the result counts, list recent sync runs, and **export the QR CSV** (name/email/type/qr_token for the active event). |
## Auth guard
@@ -63,8 +62,7 @@ apps/admin/src/
├─ Sponsors.tsx # sponsor CRUD
├─ Schedule.tsx # slots + sessions + speakers + material + AI-evaluate
├─ Activity.tsx # check-ins / connections / feedback tables
├─ Events.tsx # event management
└─ Sync.tsx # Interfaces: Pretix/Sessionize sync + QR CSV export
└─ Events.tsx # event management
```
## Data access
@@ -82,25 +80,27 @@ key. Everything it can do is allowed by RLS:
- **RPCs** — `adjust_points` (manual, audited as `admin`), `upsert_contact`,
`create_registration`, `set_registration_type`, `evaluate_session_feedback`
(AI stub), and `set_session_material` (attach uploaded material). The
`reset_registration_qr_token` RPC still exists (used by the sync path) but the
admin UI no longer exposes a token reset. See
`reset_registration_qr_token` RPC still exists but the admin UI no longer
exposes a token reset. See
[../backend/rpcs.md](../backend/rpcs.md).
### Viewing a QR token
The QR token lives on the **registration** (per event), not the contact. The
**Registrations** view shows each registration's token and a **QR** button that
opens a modal with the scannable code. The token is **final** — it is generated by
Pretix and can't be reset from the UI (the `reset_registration_qr_token` RPC still
exists for the sync path, but the admin UI no longer exposes a reset action).
opens a modal with the scannable code. The token is **final** — it is generated
per event and can't be reset from the UI (the `reset_registration_qr_token` RPC
still exists, but the admin UI no longer exposes a reset action).
### Sponsor lookup (in-place)
Setting a registration's type to **Sponsor** requires a sponsor lookup. If none
exists for that contact, the change fails with `a sponsor registration requires a
sponsor lookup` and the UI opens an **in-place sponsor popup** (instead of just
erroring). The popup lets the admin create the sponsor (type, name, email, phone,
amount, paid) linked to that contact, then sets the registration type to
erroring). The popup lets the admin either **link an existing sponsor** (a
dropdown lists the event's sponsors; picking one pre-fills the form) or **create
a new one** (type, name, email, phone, amount, paid). On save it upserts the
sponsor linked to that contact's email, then sets the registration type to
`sponsor` in one step.
### Adjusting points
@@ -116,25 +116,6 @@ The Schedule view uploads a session's material to the `materials` bucket and set
button calls `evaluate_session_feedback` (the AI stub) to set
`ai_generated_feedback`.
### Interfaces (Pretix + Sessionize sync)
The **Interfaces** view is the admin's control panel for the data interfaces
(Phases 7–8). It does **not** call the sync RPCs directly — those are
`service_role`-only. Instead it POSTs to the **`sync-trigger` Edge Function**
(`/functions/v1/sync-trigger`) with the admin's session JWT; the function verifies
the caller is an admin (via the `is_admin()` RPC), fetches from the configured
Pretix/Sessionize base URLs (the local **mock API** by default), and calls the
service-role RPCs `sync_pretix_attendees` / `sync_sessionize_sessions`.
- **Sync now / Sync all** — trigger one source or both; the response shows
`created` / `updated` / `skipped` counts (and any per-item errors).
- **Recent sync runs** — the last 8 rows of `sync_runs` (admin-only read).
- **Export QR CSV** — builds a CSV of the active event's registrations
(name, email, type, qr_token) and triggers a browser download, so organizers can
print lanyards without touching the database.
Full details: [../backend/interfaces.md](../backend/interfaces.md).
## Styling
The admin app reuses the attendee app's **design tokens** (colors, Poppins font,