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:
1 parent
ffb270c140
commit
24909cf8ab
27 files changed
+147
-1150
No files matched your search
@@ -202,23 +202,6 @@ profile from the Convivo app: the LinkedIn URL and the two visibility toggles
|
||||
touch `is_admin`, `password`, `external_id`, etc.
|
||||
- Returns the updated contact row.
|
||||
|
||||
## Interface sync RPCs (service-role-only)
|
||||
|
||||
Two additional `security definer` RPCs import external data. They are **not**
|
||||
called by the apps — they are called by the `sync-trigger` Edge Function using the
|
||||
**service-role key**, and each guards with
|
||||
`if coalesce(auth.jwt() ->> 'role', '') <> 'service_role' then raise exception`.
|
||||
Full details (payloads, mapping, the Edge Function, the mock API) live in
|
||||
[interfaces.md](./interfaces.md).
|
||||
|
||||
| Function | Input | Effect |
|
||||
|---|---|---|
|
||||
| `sync_pretix_attendees(p_attendees jsonb)` | array of `{email, full_name, ticket_type, qr_token?, linkedin_url?, external_id?}` | Upserts `contacts` (by email) + `registrations` (by event+contact); creates the `auth.users` row if missing; auto-creates a `sponsors` row for `sponsor` ticket types; records a `sync_runs` row. Returns `{created, updated, skipped, errors[]}`. |
|
||||
| `sync_sessionize_sessions(p_sessions jsonb)` | array of `{external_id, title, description?, room?, capacity?, date, start_time, end_time, speakers[]}` | Find-or-creates a `slots` row per time window, upserts `sessions` by `external_id`, upserts speaker `contacts` + `session_speakers`; records a `sync_runs` row. Returns `{slots_created, sessions_created, sessions_updated, speakers_linked, errors[]}`. |
|
||||
|
||||
Both are **idempotent** — re-running a sync updates existing rows instead of
|
||||
duplicating them (keyed on email / `external_id`).
|
||||
|
||||
## Role helper functions
|
||||
|
||||
| Function | Returns | Meaning |
|
||||
|
||||
Reference in new issue
Block a user