Phase 7+8: Pretix + Sessionize interfaces

- Migration 20260825000000_interfaces.sql: external_id on contacts/
  registrations/sessions (+ partial unique indexes), slots_id_seq, sync_runs
  audit table, and service-role-only sync_pretix_attendees /
  sync_sessionize_sessions RPCs (idempotent upserts).
- sync-trigger Edge Function: admin-JWT or CRON_SECRET auth, pulls from
  Pretix/Sessionize base URLs, normalizes, calls the service-role RPCs.
- interfaces/mock-api: dependency-free Node server (:54330) + fixtures so the
  full pipeline is testable without real tokens.
- APPE Admin 'Interfaces' view: per-source + 'Sync all' triggers, result
  counts, recent sync runs, and QR CSV export; /functions proxy added.
- Docs: new docs/backend/interfaces.md; updated README, roadmap, next-steps,
  schema, rls, rpcs, architecture, admin-app, and docs index.

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-23 03:34:30 +02:00
1 parent 7605c9bbf4
commit 74c41c8c1d
26 files changed
+1529 -80

No files matched your search

+35 -13
View File
@@ -3,11 +3,10 @@
Living roadmap. The top section is the **current focus**; completed phases are
summarized below. For *how* each piece works, see [`docs/`](./docs/README.md).
> **Status:** Phases 0–6 are complete and verified. The **Redesign** (Phases
> 3–6) is done: the new multi-event data model is live, the admin app is
> rebranded to **APPE Admin**, the Convivo App has all the new behaviors, and
> both apps carry the APPE branding. Next up: the Pretix + Sessionize
> interfaces (Phases 7–8).
> **Status:** Phases 0–8 are complete and verified. The **Redesign** (Phases
> 3–6) is done, and the **Pretix + Sessionize interfaces** (Phases 7–8) are
> built and browser-verified end-to-end (against the local mock API). Remaining
> work is cross-cutting (real event clock, deployment, automated testing).
---
@@ -39,12 +38,30 @@ Convivo App gains several behaviors. Details live in
---
## Later (post-redesign)
## The Interfaces (Phases 7–8) ✅ DONE
Pull **real** data from the systems that run a conference. Full detail in
[`docs/backend/interfaces.md`](./docs/backend/interfaces.md).
| Phase | Scope | Status |
|---|---|---|
| **7** | **Pretix interface** — sync tickets → contacts + registrations (QR tokens, types). Replaces the hand-written seed with real ticket data. | ⬜ |
| **8** | **Sessionize interface** — sync the real agenda (slots, sessions, speakers, rooms). | ⬜ |
| **7** | **Pretix interface** — `sync-trigger` Edge Function pulls tickets → `contacts` + `registrations` (+ auth users, generated QR tokens, type mapping, idempotent by `external_id`); QR CSV export in APPE Admin | ✅ |
| **8** | **Sessionize interface** — same Edge Function pulls the agenda → `slots` + `sessions` + `session_speakers` (idempotent by `external_id`) | ✅ |
### Interface decisions (locked)
- **Runtime** — a Supabase **Edge Function** (`sync-trigger`), not a separate
container. It's the only component that talks to the external APIs and holds
the service-role key.
- **Style** — **pull** (on-demand from the APPE Admin **Interfaces** view +
cron-ready via `CRON_SECRET`). Webhooks are a later add-on.
- **Service-role-only RPCs** — `sync_pretix_attendees` / `sync_sessionize_sessions`
are guarded to the service-role caller (JWT `role` claim); the apps cannot
call them.
- **Idempotency** — `external_id` columns (partial unique indexes) on
contacts / registrations / sessions; re-runs update in place.
- **Audit** — a `sync_runs` table (admin-only read) records every run.
- **Local testing** — a `mock-api` Docker service serves the real API shapes
from fixtures, so the pipeline is testable without credentials.
---
@@ -76,8 +93,13 @@ Convivo App gains several behaviors. Details live in
## Open questions
1. **Pretix mapping** — which ticket fields map to registration type and contact?
2. **Sync style** — webhook (push) vs scheduled (pull) for Pretix/Sessionize?
3. **Sync runtime** — Supabase Edge Functions vs separate containers?
4. **AI provider** — which LLM/API for `ai_generated_feedback` (Phase 4+)?
5. **Deployment target** — stay on localhost, or plan for the `appe.at` subdomains now?
**Resolved in Phases 7–8:** sync runtime (Edge Function), sync style (pull +
cron-ready), credentials (env-configured + local mock API).
1. **Pretix mapping** — confirm the ticket-type → registration-type mapping
(the substring matcher is a reasonable default).
2. **Sync cadence** — how often to pull (pre-event vs during the event)?
3. **AI provider** — which LLM/API for `ai_generated_feedback` (the admin
"Evaluate" button is still a stub).
4. **Deployment target** — stay on localhost, or plan for the `appe.at`
subdomains now?