Service sessions + Home redesign + feedback loop

Service sessions (new slot semantics):
- Sidecar maps isServiceSession OR isPlenumSession -> service_session
  (Excel path also matches 'plenum' in Session Format).
- checkin_attendee rejects service sessions; Scan check-in dropdown
  excludes them.
- New _assign_service_session_speakers helper links every registered
  staff member as a speaker of a service session; both sync RPCs call
  it (and the API sync now actually types slots from is_service_session).
- No material requirement + no mic emoji for service sessions.

Home redesign:
- Now/Next cards show all concurrent sessions as sub-sections when
  there's no pick (1/2/3 sessions -> 1/2/3 sub-sections), with a
  "Nothing scheduled" fallback for empty slots.
- My picks today lists every pick (slot order) + empty state.
- Demo clock EVENT_DATE fixed to 2026-02-20 (matches seed) so a slot
  is live at 10:20.

Feedback loop:
- Attendee pending-feedback pill on Home (checked into an over session,
  not its speaker, no feedback yet); clears on submit.
- Speaker sees rating + AI summary for their own session in the Agenda
  sheet only after it's over.

Migration 20260833000000_service_sessions_feedback.sql. Docs updated.

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-25 08:58:16 +02:00
1 parent fad978e9f4
commit bd67debeef
15 files changed
+878 -105

No files matched your search

+23 -5
View File
@@ -99,6 +99,9 @@ Staff checks an attendee into a session.
- **Role check:** `is_staff_or_admin()` (i.e. `is_admin()`) or it raises
`staff or admin only`.
- Resolves the attendee by `qr_token`.
- **Service-session guard:** if the session's slot is a `service_session`, it
raises `service sessions cannot be checked in` (there's nothing to check into —
everyone is in the room).
- `insert into checkins ... on conflict (event_id, contact_email, session_id) do
nothing returning id` — if no row was inserted, the attendee was **already
checked in**: sets `already = true` and awards **no points**.
@@ -208,13 +211,20 @@ Imports an event's Sessionize data in order: (1) speakers → contacts (matched
email), (2) sessions (upserted by `external_id`), (3) the agenda (slots
find-or-created by date/start/end + `session_speakers` links). `p_payload` is
`{ speakers: [{email, full_name, external_id?}], sessions: [{external_id, title,
description?, room?, date, start_time, end_time, speakers: [email,...]}] }`.
description?, room?, date, start_time, end_time, is_service_session?, speakers:
[email,...]}] }`.
- Guarded to the `service_role` caller (JWT role claim); granted to `service_role`
only — the apps cannot call it.
- **Slots are typed from `is_service_session`** (`service_session` for
breaks/lunch/closing/plenums, else `session`) with a matching name
("Service Session" vs "Slot HH:MM–HH:MM").
- **Idempotent:** re-running updates in place (contacts by email, sessions by
`external_id`, slots by date/start/end). Speaker links are **diffed** (insert the
new set, then delete only removed) so the `session_needs_speaker` trigger never
blocks a removal.
- **Service sessions:** every registered **staff** member is linked as a speaker
(via `_assign_service_session_speakers`) — a service session has no individual
speaker, so the whole staff team "owns" it.
- Linking a speaker fires `session_speakers_speaker_promote`, which promotes an
existing registration to `speaker`. **No registrations are created** — the ticket
sync does that (checking `session_speakers` by email).
@@ -233,8 +243,10 @@ extra step:
1. **Speakers → contacts** (matched by email; also sets `linkedin_url`).
2. **Sessions + agenda** — slots are typed from `is_service_session`
(`service_session` for breaks/lunch/closing, else `session`), sessions
upserted by `external_id`, speaker links diffed.
(`service_session` for breaks/lunch/closing/plenums, else `session`), sessions
upserted by `external_id`, speaker links diffed. **Service sessions** also get
every registered **staff** member linked as a speaker (via
`_assign_service_session_speakers`).
3. **Speaker registrations** — for every speaker, creates a `speaker`
registration or updates an existing `attendee` one to `speaker`
(`on conflict (event_id, contact_email)`). **Never overrides `staff` /
@@ -262,10 +274,16 @@ extra step:
All are `security definer` so they can read `contacts` / `registrations` /
`session_speakers` inside RLS checks and RPC guards.
## Internal helpers
| Function | Returns | Meaning |
|---|---|---|
| `_assign_service_session_speakers(p_session_id, p_event_id)` | `integer` | Links **every registered staff member** of the event as a speaker of the given session (`on conflict do nothing`). Returns the number of rows affected. Called by both Sessionize sync RPCs for `service_session` sessions — a service session has no individual speaker, so the whole staff team "owns" it. |
## Error handling
RPCs raise Postgres exceptions with human-readable messages (e.g. `you cannot
connect with yourself`, `staff or admin only`, `you must be checked in to this
session to give feedback`, `not a speaker of this session`). The frontend
surfaces these via toasts — see
session to give feedback`, `not a speaker of this session`, `service sessions
cannot be checked in`). The frontend surfaces these via toasts — see
[../frontend/api-client.md](../frontend/api-client.md).
+1 -1
View File
@@ -136,7 +136,7 @@ Unpaid sponsors are hidden from non-admins (RLS).
|---|---|---|
| `id` | `integer` PK | `nextval('slots_id_seq')` default — the UI/sidecar can create a slot **without** supplying an id (the seed inserts explicit ids and re-syncs the sequence) |
| `event_id` | `uuid` FK → `events` | `on delete cascade` |
| `type` | `slot_type` (enum) | **`session` \| `service_session`** (default `session`) — a true optionset, not freetext. `service_session` = breaks / lunch / closing (Sessionize's `isServiceSession`) |
| `type` | `slot_type` (enum) | **`session` \| `service_session`** (default `session`) — a true optionset, not freetext. `service_session` = breaks / lunch / closing / plenums (Sessionize's `isServiceSession` **or** `isPlenumSession`) |
| `name` | `text` | e.g. "Slot 09:00–09:45" / "Service Session" |
| `slot_date` | `date` | |
| `start_time` / `end_time` | `time` | |
+10 -2
View File
@@ -26,14 +26,22 @@ date/start/end + `session_speakers` links). The public `/view/` payload has no
speaker emails, so this path imports sessions + agenda but **skips speakers**
(unless an authenticated `/api/` endpoint + key is configured).
> **Service sessions.** A session is flagged `is_service_session` when
> Sessionize marks it `isServiceSession` **or** `isPlenumSession` (a plenum is a
> full-hall item — breaks, lunch, closing, or a plenary — with no individual
> speaker). The RPC then types its slot `service_session` and links every
> registered **staff** member as a speaker.
**B. Excel import** (`POST /import-excel`) — the admin uploads the Sessionize
**"Sessions and speakers (advanced)"** `.xlsx` export (generated on the fly by
any organizer with admin access to the event). The sidecar parses it (two sheets:
*Accepted sessions* + *Accepted speakers*) and calls the
`sync_sessionize_excel` RPC, which imports, in order: (1) speakers as contacts
(matched by **email** — the Excel carries emails, so this is reliable), (2)
sessions + agenda (slots typed `session` / `service_session` from
`isServiceSession` + `session_speakers` links), and (3) **a `speaker`
sessions + agenda (slots typed `session` / `service_session` from the
**Session Format** column — `service`/`break`/`lunch`/`closing`/`plenum` →
`service_session` — + `session_speakers` links, with every registered **staff**
member linked as a speaker of service sessions), and (3) **a `speaker`
registration for every speaker** (create, or update `attendee`→`speaker`; never
overrides `staff`/`sponsor`). This is the path that creates the missing speaker
contacts + registrations.