feat: add magic-link admin login and speaker materials portal

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-10-07 18:27:56 +02:00
1 parent 0b6d1f2b6f
commit 68fecc2ad1
28 files changed
+1623 -232

No files matched your search

+35 -6
View File
@@ -18,8 +18,9 @@ Source of truth:
re-sync the leaderboard* in **one transaction**. Either all happen or none do.
- **Idempotent where it matters** → re-check-in and re-feedback are detected and
never double-award.
- **Event-scoped** → every RPC resolves the **active event** first and scopes all
reads/writes to it.
- **Event-scoped** → points RPCs resolve the **active event** first. Speaker
portal material RPCs instead authorize against the session's own event,
including inactive events.
## Points rules
@@ -201,10 +202,38 @@ placeholder string ("AI evaluation stub: N comment(s) received. (LLM integration
pending.)"). Real LLM integration is a later phase.
### `set_session_material(p_session_id, p_material_path)` → `sessions`
Sets a session's `material_path`. Allowed for **admins and for any speaker of the
session** (the `sessions` table is admin-write only, so speakers need this
security-definer RPC to attach their uploaded material). The attendee app calls
this after uploading a file to the `materials` bucket.
Sets only a session's `material_path`, with a row lock. Requires authentication
and either admin access or an own assignment plus `speaker` or `staff` registration for the
session's event and a non-service slot. For non-admins, non-null paths must be an
existing uploaded `materials` object under `sessions/<this session UUID>/<filename>`.
`NULL` detaches material. Ownership/path failures use SQLSTATE `42501`.
There is no active-event, date, check-in or points condition. Shared by Agenda and
the [speaker portal](../frontend/screens.md#speaker-portal).
## Speaker Portal RPCs
Source: [20261006175631_speaker_portal.sql](../../supabase/migrations/20261006175631_speaker_portal.sql),
with [staff overlap](../../supabase/migrations/20261007153957_speaker_portal_staff_overlap.sql).
- `get_my_speaker_sessions()` returns own registered non-service talks across
all events, ordered by slot date/time, event name, title and session ID. Rows
contain `session_id`, `title`, `description`, `room`, `material_path`,
`event_id`, `event_name`, `event_start_date`, `event_end_date`, `is_active`,
`slot_date`, `start_time`, `end_time`. Ineligible authenticated users get `[]`.
- `owns_speaker_session(uuid)` requires an explicit own talk assignment and a
same-event `speaker` or `staff` registration, including registered Admin staff.
Registration category remains unchanged; staff points/check-in exclusions remain intact.
- `can_write_session_material(text)` validates session object paths for Storage
INSERT/UPDATE/DELETE; admins retain their existing management access.
- `set_session_material(uuid, text)` follows the mutation contract above and
does not mark physical attendance or award points.
All four functions revoke PUBLIC/anon execution and grant authenticated/service_role
execution. See [RLS details](./rls.md#speaker-portal-authorization),
[client lifecycle](../frontend/api-client.md#speaker-portal) and
[regression tests](./tests.md#speaker-portal).
## Other RPCs
### `update_my_profile(p_linkedin_url, p_show_email, p_show_linkedin)` → `contacts`
**Self-service (any authenticated attendee).** Lets a contact edit their own