Registration optionset + speaker auto-promote + welcome check-in

- registrations.type is now a Postgres ENUM (registration_type)
- session_speakers trigger auto-promotes attendee -> speaker (never overrides staff/sponsor)
- new welcome_checkin RPC: staff marks an attendee present at the event
- admin Registrations: QR token is final (no reset); failed sponsor change opens in-place sponsor lookup
- Convivo Home: Now/Next cards always render; red pending-material pill + popup for speakers
- Convivo Agenda: speakers can delete their material to re-upload
- Convivo Scan: staff Session/Welcome check-in toggle (uiverse switch)
- seed: staff (Bruno/Rita) get a password so staff QR login works after reset

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 21:33:44 +02:00
1 parent adcbb507e9
commit ffb270c140
16 files changed
+730 -142

No files matched your search

+36 -21
View File
@@ -42,31 +42,43 @@ Source of truth: [`supabase/seed.sql`](../../supabase/seed.sql). The seed runs o
## Demo accounts
**Attendees & staff** log in with **QR code** (typed or scanned) + **email** —
the QR token is the Auth password. The **APPE Admin** (and any staff member you
give one) can also log in with **email + password** (event-independent, so it
works for any event). The password lives in `contacts.password`; a trigger
(`trg_contact_password_sync`) **auto-syncs** it as the bcrypt hash in
`auth.users.encrypted_password`, so just set `contacts.password` in Supabase and
it works with `signInWithPassword` immediately.
**Attendees** log in with **QR code** (typed or scanned) + **email** — the QR
token is the Auth password. **Staff** log in with **QR code + their staff
password** (the Convivo app shows a password field when a staff QR is detected;
the email comes from the resolved contact). The **APPE Admin** (and any staff
member you give one) can also log in with **email + password** in the admin app
(event-independent, so it works for any event). The password lives in
`contacts.password`; a trigger (`trg_contact_password_sync`) **auto-syncs** it as
the bcrypt hash in `auth.users.encrypted_password`, so just set
`contacts.password` in Supabase and it works with `signInWithPassword`
immediately.
| Person | Type | Login | Email | Start pts |
|---|---|---|---|---|
| **Ana Silva** | attendee | QR `CVV-ANA-4821` | ana.silva@nubank.com | 40 |
| **Bruno Costa** | staff (admin) | QR `CVV-BRU-1177` | bruno.costa@acme.com | 140 |
| **Rita Lopes** | staff (admin) | QR `CVV-RIT-9034` | rita.lopes@globant.com | 95 |
| **Ana Silva** | speaker | QR `CVV-ANA-4821` | ana.silva@nubank.com | 40 |
| **Bruno Costa** | staff (admin) | QR `CVV-BRU-1177` + **password** `appe-admin-2026` | bruno.costa@acme.com | 140 |
| **Rita Lopes** | staff (admin) | QR `CVV-RIT-9034` + **password** `appe-admin-2026` | rita.lopes@globant.com | 95 |
| **APPE Admin** | staff (admin) | **password** `appe-admin-2026` | admin@appe.at | 0 |
| Tomás Ribeiro | attendee | `CVV-TOM-5566` | tomas.ribeiro@dataprev.com | 88 |
| Sofia Almeida | attendee | `CVV-SOF-2299` | sofia.almeida@loop.com | 76 |
| Marco Chen | attendee | `CVV-MRC-7712` | marco.chen@deepmind.com | 70 |
| Julia Santos | attendee | `CVV-JUL-3345` | julia.santos@ifood.com | 64 |
| Pedro Nunes | attendee | `CVV-PED-8801` | pedro.nunes@microsoft.com | 58 |
| Carla Mendes | attendee | `CVV-CAR-6623` | carla.mendes@quintoessencial.com | 52 |
| Diego Ferreira | attendee | `CVV-DIE-4458` | diego.ferreira@stone.com | 35 |
| Marina Costa | attendee | `CVV-MNA-2210` | marina.costa@olx.com | 28 |
| Lucas Oliveira | attendee | `CVV-LUC-9987` | lucas.oliveira@usp.br | 15 |
| Tomás Ribeiro | speaker | `CVV-TOM-5566` | tomas.ribeiro@dataprev.com | 88 |
| Sofia Almeida | speaker | `CVV-SOF-2299` | sofia.almeida@loop.com | 76 |
| Marco Chen | speaker | `CVV-MRC-7712` | marco.chen@deepmind.com | 70 |
| Julia Santos | speaker | `CVV-JUL-3345` | julia.santos@ifood.com | 64 |
| Pedro Nunes | speaker | `CVV-PED-8801` | pedro.nunes@microsoft.com | 58 |
| Carla Mendes | speaker | `CVV-CAR-6623` | carla.mendes@quintoessencial.com | 52 |
| Diego Ferreira | speaker | `CVV-DIE-4458` | diego.ferreira@stone.com | 35 |
| Marina Costa | speaker | `CVV-MNA-2210` | marina.costa@olx.com | 28 |
| Lucas Oliveira | speaker | `CVV-LUC-9987` | lucas.oliveira@usp.br | 15 |
| Dr. Elena Vasquez | (external speaker) | — | elena.vasquez@keynote.com | — |
> **Speaker auto-promote:** every seeded attendee who speaks in a session is
> typed `speaker` (the `session_speakers_speaker_promote` trigger promotes
> `attendee` → `speaker` on insert, so the seed states the final type). Only
> Bruno, Rita, and the APPE Admin are `staff` (the trigger never overrides an
> explicit staff/sponsor ticket).
>
> **Staff passwords:** Bruno and Rita have `contacts.password = 'appe-admin-2026'`
> so the Convivo **staff QR login** (QR + staff password) works out of the box.
> **Dr. Elena Vasquez** is an external keynote speaker: she has a `contacts` row
> (and speaks in `session_speakers`) but **no registration, no QR token, and no
> auth user**, so she can't log in — she only appears as a speaker on the agenda.
@@ -101,8 +113,11 @@ Ana (`[email protected]`) is seeded with a coherent 40-point history:
1. Log in as **Ana** (attendee) → Home, Agenda, Leaderboard all populated.
2. Scan **Marco** (`CVV-MRC-7712`) → send a connection request.
3. Log in as **Bruno** (staff) → the Scan tab becomes **Check-in** → pick a
session → scan **Carla** (`CVV-CAR-6623`) → she gets +10.
3. Log in as **Bruno** (staff) → QR `CVV-BRU-1177` + staff password
`appe-admin-2026` → the Scan tab becomes **Check-in** → pick a session → scan
**Carla** (`CVV-CAR-6623`) → she gets +10. Flip the **check-in type toggle**
to **Welcome check-in** and scan **Tomás** (`CVV-TOM-5566`) → he's marked
present at the event (no points).
4. Watch the **Leaderboard** update live (Realtime).
5. Log in as **APPE Admin** (`[email protected]` / password `appe-admin-2026`) in the
admin app → Dashboard, Contacts, Registrations, Sponsors, Schedule, Activity,