feat: add event-scoped schedule deletion and import date guard

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-10 01:44:40 +02:00
1 parent 15789ab04d
commit 22de4a8645
12 files changed
+2034 -14

No files matched your search

+19
View File
@@ -210,6 +210,25 @@ existing uploaded `materials` object under `sessions/<this session UUID>/<filena
There is no active-event, date, check-in or points condition. Shared by Agenda and
the [speaker portal](../frontend/screens.md#speaker-portal).
### `delete_event_schedule(p_event_id)` → `jsonb`
**Admin-only.** Deletes the slots and sessions for exactly one event in a single
transaction. It locks the event plus that event's schedule rows, validates that
sessions and dependent `preferences` / `checkins` / `feedback` rows do not cross
event boundaries, then deletes `sessions` and `slots` for `p_event_id`.
FK cascades remove `session_speakers`, `preferences`, `checkins` and
`feedback`. The event row, contacts, registrations, sponsors, connections,
points, leaderboard rows and other events are preserved. Session
`material_path` values disappear with the deleted session rows, but Storage
objects in the `materials` bucket are not physically purged.
The function is `security definer` with an empty `search_path`, requires both
`auth.uid()` and `public.is_admin()`, revokes execution from `PUBLIC` / `anon` /
`authenticated`, then grants execution back only to `authenticated`. It returns
counts for deleted slots, sessions and dependent rows plus the number of
material paths left unpurged. It does not coordinate with Sessionize/Pretix
sync; a concurrent or later import can repopulate the event schedule.
## Speaker Portal RPCs
Source: [20261006175631_speaker_portal.sql](../../supabase/migrations/20261006175631_speaker_portal.sql),