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).
This commit is contained in:
1 parent
1cbbd1b529
commit
a54ce69c4d
27 files changed
+147
-1150
No files matched your search
+7
-28
@@ -4,11 +4,10 @@ All tables live in the `public` schema. Source of truth:
|
||||
[`supabase/migrations/20260824000000_redesign.sql`](../../supabase/migrations/20260824000000_redesign.sql)
|
||||
(the Redesign migration, which **replaces** the old `profiles`-based schema).
|
||||
|
||||
There are **14 tables**: people (`contacts`), the event (`events`), participation
|
||||
There are **13 tables**: people (`contacts`), the event (`events`), participation
|
||||
(`registrations`, `sponsors`), the schedule (`slots`, `sessions`,
|
||||
`session_speakers`), the event's activity (`preferences`, `connections`,
|
||||
`checkins`, `feedback`, `leaderboard`, `points_log`), and the interface audit
|
||||
(`sync_runs`).
|
||||
`session_speakers`), and the event's activity (`preferences`, `connections`,
|
||||
`checkins`, `feedback`, `leaderboard`, `points_log`).
|
||||
|
||||
The old `profiles` table is **dropped**. People are now `contacts` (keyed by
|
||||
email), and every activity table is scoped to an **event** + a **contact email**
|
||||
@@ -45,8 +44,7 @@ erDiagram
|
||||
|
||||
One row per person. **`email` is the primary key** (a natural key that matches
|
||||
`auth.users.email`). Contacts carry **no QR token** — the token lives on the
|
||||
registration (it is generated per event by Pretix and doubles as the Auth
|
||||
password).
|
||||
registration (it is generated per event and doubles as the Auth password).
|
||||
|
||||
| Column | Type | Notes |
|
||||
|---|---|---|
|
||||
@@ -57,7 +55,7 @@ password).
|
||||
| `show_linkedin` | `boolean` | default `false` — visibility toggle |
|
||||
| `is_admin` | `boolean` | default `false` — **staff = admin (merged)**; grants check-in + APPE Admin access |
|
||||
| `password` | `text` | nullable — the **login password** (event-independent) for admin/staff. Setting it (e.g. in the Supabase Table Editor) **auto-syncs** the bcrypt hash into `auth.users.encrypted_password` via the `trg_contact_password_sync` trigger, so it works with `signInWithPassword` immediately |
|
||||
| `external_id` | `text` | nullable — the Pretix order code (set by the sync) |
|
||||
| `external_id` | `text` | nullable — reserved for an external system's id (currently unused) |
|
||||
| `created_at` | `timestamptz` | |
|
||||
|
||||
Partial unique index: `contacts_external_id_uniq (external_id) WHERE external_id IS NOT NULL`.
|
||||
@@ -98,7 +96,7 @@ Points are scoped **per event** here (one row per contact per event).
|
||||
| `checked_in` | `boolean` | default `false` |
|
||||
| `points` | `integer` | `>= 0`, default 0 |
|
||||
| `qr_token` | `text` | nullable — the lanyard token; **doubles as the Auth password** (generated per event) |
|
||||
| `external_id` | `text` | nullable — the Pretix order code (set by the sync) |
|
||||
| `external_id` | `text` | nullable — reserved for an external system's id (currently unused) |
|
||||
| `created_at` | `timestamptz` | |
|
||||
|
||||
**Constraint:** `unique (event_id, contact_email)` — one registration per contact
|
||||
@@ -155,7 +153,7 @@ Unpaid sponsors are hidden from non-admins (RLS).
|
||||
| `average_feedback` | `numeric` | maintained by `submit_feedback` |
|
||||
| `ai_generated_feedback` | `text` | AI-feedback state (stub) |
|
||||
| `material_path` | `text` | nullable — storage object path for session material |
|
||||
| `external_id` | `text` | nullable — the Sessionize session id (set by the sync) |
|
||||
| `external_id` | `text` | nullable — reserved for an external system's id (currently unused) |
|
||||
| `created_at` | `timestamptz` | |
|
||||
|
||||
> **Speakers are no longer a `text` column** — they live in the `session_speakers`
|
||||
@@ -274,25 +272,6 @@ Powers the per-category points breakdown on the Profile screen (per event).
|
||||
|
||||
Index: `points_log_event_id_idx (event_id)`.
|
||||
|
||||
## `sync_runs` — interface sync audit
|
||||
|
||||
One row per Pretix/Sessionize sync run, written by the service-role-only sync
|
||||
RPCs (see [interfaces.md](./interfaces.md)).
|
||||
|
||||
| Column | Type | Notes |
|
||||
|---|---|---|
|
||||
| `id` | `uuid` PK | `gen_random_uuid()` |
|
||||
| `source` | `text` | `pretix` \| `sessionize` |
|
||||
| `started_at` | `timestamptz` | |
|
||||
| `finished_at` | `timestamptz` | nullable |
|
||||
| `created` | `integer` | rows created |
|
||||
| `updated` | `integer` | rows updated |
|
||||
| `skipped` | `integer` | rows skipped |
|
||||
| `error` | `text` | nullable — top-level error, if any |
|
||||
| `triggered_by` | `text` | default `service_role` |
|
||||
|
||||
Index: `sync_runs_source_idx (source)`. RLS: admin-only `select`.
|
||||
|
||||
## Other indexes
|
||||
|
||||
- `slots_event_id_idx (event_id)`, `registrations_event_id_idx (event_id)`,
|
||||
|
||||
Reference in new issue
Block a user