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

+20 -2
View File
@@ -18,7 +18,7 @@ It runs on **port 3001** (Vite dev) or as the `convivo-admin` Docker container
| **Contacts** | Table of all contacts (email, name, LinkedIn, visibility toggles, `is_admin`). Edit, toggle `is_admin`, set visibility, adjust points. (No QR token here — it lives on the registration.) |
| **Registrations** | Per active event: list (contact, type, **QR token**, checked_in, points). Change type (enforces the sponsor rule — a failed sponsor change opens an **in-place sponsor lookup** popup), mark checked-in, **view the QR token** (final — no reset). |
| **Sponsors** | List (paid only visible to attendees; admin sees all). Add/edit (type, name, email, phone, paid, amount, **contact search-and-pick**). |
| **Schedule** | Slots (with a **type optionset** — `Session` / `Service Session`) + sessions (with speakers 1:N via a **multi-select search dropdown**, material upload with a **submitted / not submitted** state, `average_feedback`, `ai_generated_feedback` + an **Evaluate** stub button). |
| **Schedule** | Slots (with a **type optionset** — `Session` / `Service Session`) + sessions (with speakers 1:N via a **multi-select search dropdown**, material upload with a **submitted / not submitted** state, `average_feedback`, `ai_generated_feedback` + an **Evaluate** stub button), plus an admin-only **Delete current schedule** action for the active event. |
| **Activity** | Tables of check-ins, connections, and feedback (per active event). |
| **Events** | Create event, toggle active/inactive (a switch; only one can be active at a time — activating one deactivates the rest), edit dates/location + the **Sessionize endpoint** + the **Real-time clock** toggle (on = the attendee app uses the real system clock for Live/Next/Done; off = the simulated mid-event clock, the default). Each row has a **Sync** button that runs a (blocking) Sessionize sync and shows a result modal. |
| **Interfaces** | Manages the Sessionize sync **sidecar**: status (online / running / last run), a **Run sync** control (event picker + blocking run + result modal), an **Import Excel** control (upload the Sessionize "Sessions and speakers (advanced)" `.xlsx` + a "How to get this file" tooltip), and a **Recent runs** table from `sync_runs`. See [../backend/sidecar.md](../backend/sidecar.md). |
@@ -128,7 +128,8 @@ key. Everything it can do is allowed by RLS:
(admin-only policies).
- **RPCs** — `adjust_points` (manual, audited as `admin`), `upsert_contact`,
`create_registration`, `set_registration_type`, `evaluate_session_feedback`
(AI stub), and `set_session_material` (attach uploaded material). The
(AI stub), `set_session_material` (attach uploaded material), and
`delete_event_schedule` (clear the active event's slots/sessions). The
`reset_registration_qr_token` RPC still exists but the admin UI no longer
exposes a token reset. See
[../backend/rpcs.md](../backend/rpcs.md).
@@ -164,6 +165,23 @@ The Schedule view uploads a session's material to the `materials` bucket and set
`sessions.material_path` (admins can write `sessions` directly). The **Evaluate**
button calls `evaluate_session_feedback` (the AI stub) to set
`ai_generated_feedback`.
### Delete current schedule
The Schedule view keeps the existing active-event selection pattern: it loads
`getActiveEvent()`, then reads slots/sessions for that event. **Delete current
schedule** captures the active event ID/name when the confirmation modal opens
and calls `delete_event_schedule(p_event_id)`. Success refreshes only that same
event view and reports deleted slot/session counts; if the admin navigates away
or changes the active event while the RPC is pending, the stale completion does
not clear the newly selected event's UI.
The confirmation spells out the irreversible data loss: slots, sessions,
speaker links, preferences, check-ins and feedback are deleted; registrations
are preserved; material paths are removed with session rows, but Storage objects
are not physically purged. The UI disables schedule mutation controls while the
delete is pending. A later or concurrent Sessionize/Pretix sync can recreate
schedule rows because the admin delete does not lock the import sidecar.
### Reports (post-event summary + export)
The **Reports** view is the post-event reporting surface. It works for **any**