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

+43
View File
@@ -88,6 +88,49 @@ authorization separately. See [screen contract](../frontend/screens.md#speaker-p
[API client](../frontend/api-client.md#speaker-portal), [RLS](./rls.md#speaker-portal-authorization)
and [RPCs](./rpcs.md#speaker-portal-rpcs).
## Sessionize Date Guard
[sessionize_date_guard_tests.sql](../../supabase/tests/sessionize_date_guard_tests.sql)
is an independent fail-fast rollback-only suite for the Sessionize API and Excel
RPC date guard. It creates generated event/contact/auth fixtures, precreates
explicit negative slot IDs so successful imports do not allocate sequence values,
and ends with `ROLLBACK`.
To verify the migration and suite together on the local database without
persisting either change:
```bash
{ printf 'BEGIN;\n'; cat supabase/migrations/20261009225632_guard_sessionize_dates.sql supabase/tests/sessionize_date_guard_tests.sql; printf '\nROLLBACK;\n'; } | docker exec -i supabase_db_Convivo psql -U postgres -d postgres -v ON_ERROR_STOP=1
```
The nested `BEGIN` warning from the suite is harmless in this rollback-only
check. This command is local validation only; it does not write CLI migration
history and is not a production deployment. Historical rows outside the newly
configured event range are retained by successful imports and need a separately
approved reconciliation if they should be removed or changed.
## Delete Event Schedule
[delete_event_schedule_tests.sql](../../supabase/tests/delete_event_schedule_tests.sql)
is an independent fail-fast rollback-only suite for the admin schedule-clear RPC.
It creates generated contacts/events/auth fixtures, uses explicit negative slot
IDs so fixture setup does not advance `slots_id_seq`, and ends with `ROLLBACK`.
To verify the migration and suite together on the local database without
persisting either change:
```bash
{ printf 'BEGIN;\n'; cat supabase/migrations/20261009231817_delete_event_schedule.sql supabase/tests/delete_event_schedule_tests.sql; printf '\nROLLBACK;\n'; } | docker exec -i supabase_db_Convivo psql -U postgres -d postgres -v ON_ERROR_STOP=1
```
The suite checks authenticated admin execution, non-admin rejection, anon
execute denial, missing-event rejection, exact delete counts, unchanged event
selection, registrations, contacts, auth users, sponsors, connections, points,
event feedback, leaderboard and other-event schedule rows. It also proves
cross-event slot/dependent mismatches fail atomically instead of cascading
foreign-event rows. This is local validation only; it does not write migration
history or deploy anything.
## Files
- [`supabase/tests/rpc_tests.sql`](../../supabase/tests/rpc_tests.sql) — the test