feat: add sidecar service for Sessionize sync

- Introduced a new Node HTTP service (sidecar) to sync event agendas from Sessionize into Convivo.
- Implemented two import paths: API sync and Excel import for session and speaker data.
- Added necessary database migrations for sessionize integration, including new columns and audit tables.
- Created functions for handling speaker and session imports, ensuring proper error handling and logging.
- Established row-level security and grants for new functions to restrict access to service-role only.

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 20:47:29 +02:00
1 parent a0bcf866dc
commit 5f8ded56f6
31 files changed
+2729 -390

No files matched your search

+32 -4
View File
@@ -77,6 +77,8 @@ queries everything for the active event and handles "no active event" gracefully
| `num_speakers` | `integer` | maintained aggregate |
| `num_registrations` | `integer` | maintained aggregate |
| `num_checked_in_registrations` | `integer` | maintained aggregate |
| `sessionize_endpoint` | `text` | nullable — the Sessionize API URL for this event (see [sidecar.md](./sidecar.md)) |
| `last_synced_at` | `timestamptz` | nullable — when the Sessionize sync last ran |
| `created_at` | `timestamptz` | |
**Constraint:** `unique index events_one_active on (is_active) where is_active`
@@ -132,13 +134,20 @@ Unpaid sponsors are hidden from non-admins (RLS).
| Column | Type | Notes |
|---|---|---|
| `id` | `integer` PK | 1–6 |
| `id` | `integer` PK | `nextval('slots_id_seq')` default — the UI/sidecar can create a slot **without** supplying an id (the seed inserts explicit ids and re-syncs the sequence) |
| `event_id` | `uuid` FK → `events` | `on delete cascade` |
| `type` | `text` | `session` \| `lunch_break` \| `coffee_break` \| `keynote` \| `close_up` (default `session`) |
| `name` | `text` | e.g. "Slot 1" |
| `slot_date` | `date` | `2026-10-23` |
| `type` | `slot_type` (enum) | **`session` \| `service_session`** (default `session`) — a true optionset, not freetext. `service_session` = breaks / lunch / closing (Sessionize's `isServiceSession`) |
| `name` | `text` | e.g. "Slot 09:00–09:45" / "Service Session" |
| `slot_date` | `date` | |
| `start_time` / `end_time` | `time` | |
> **`type` is a Postgres ENUM** (`public.slot_type`, added by
> [`20260832000000_slots_enum_excel_import.sql`](../../supabase/migrations/20260832000000_slots_enum_excel_import.sql)).
> The old freetext values (`keynote` / `lunch_break` / `coffee_break` /
> `close_up`) were all folded into `service_session` — they are all non-talk
> agenda items. The admin Schedule view shows the two values as **Session** /
> **Service Session**.
## `sessions` — one per (slot, room)
| Column | Type | Notes |
@@ -272,6 +281,25 @@ Powers the per-category points breakdown on the Profile screen (per event).
Index: `points_log_event_id_idx (event_id)`.
## `sync_runs` — Sessionize sync audit trail
Event-scoped record of every sidecar sync run (the data behind the admin
Interfaces view's "recent runs").
| Column | Type | Notes |
|---|---|---|
| `id` | `uuid` PK | `gen_random_uuid()` |
| `event_id` | `uuid` FK → `events` | `on delete cascade` |
| `source` | `text` | `sessionize` (API sync) \| `sessionize_excel` (Excel import) |
| `started_at` / `finished_at` | `timestamptz` | `finished_at` nullable |
| `created` / `updated` / `skipped` | `integer` | counts from the run |
| `error` | `text` | nullable — error text if the run failed |
| `triggered_by` | `text` | default `service_role` |
**RLS:** enabled; `SELECT` for `authenticated` restricted to admins
(`sync_runs_select_admin`). Written only by the `sync_sessionize_event` /
`sync_sessionize_excel` RPCs.
## Other indexes
- `slots_event_id_idx (event_id)`, `registrations_event_id_idx (event_id)`,