Post-event reporting + talk networking incentives
- Talk networking: per-event talk_networking_bonus awarded when two people who shared a checked-in talk accept a connection (accept_connection re-created, shared_talk flag, get_talk_cohort RPC, points_log category check widened); Convivo Networking sub-tab inside the Connect screen (Home quick action deep-links in; Connect button reflects existing connection state and is disabled for sent/connected/declined); admin Events view bonus input (0-10). - Reports: sidecar POST /export (CSV / multi-sheet XLSX / PDF report via new pdfkit dep); APPE Admin Reports view (any event: on-screen summary, session feedback summary, top-5, CSV/Excel/PDF downloads); Activity session-feedback per-session aggregate header. - Also carried: @appe.at admin trigger + default password, bulk contact delete, session level/area + event-level feedback, agenda level/area filters, admin password self-service, schedule level/area fields. - 18/18 RPC tests; both apps build; exports verified end-to-end.
This commit is contained in:
1 parent
08ab41898b
commit
3adc0fd58f
35 files changed
+3973
-54
No files matched your search
+16
-1
@@ -27,6 +27,7 @@ Source of truth:
|
||||
|---|---|---|
|
||||
| Checked into a session (by staff) | **+10** | the attendee |
|
||||
| Connection accepted | **+5 each** | both people |
|
||||
| Connection accepted **with a shared talk** | **+`talk_networking_bonus` each** (per event, default 2, `0` = off) | both people (category `talk_networking`) |
|
||||
| Feedback — rating only | **+5** | the attendee |
|
||||
| Feedback — rating + comment | **+10** | the attendee |
|
||||
| Admin adjustment | any | the target (audited as `admin`) |
|
||||
@@ -62,6 +63,7 @@ triggers and the feedback RPC.
|
||||
| `get_public_contacts()` | `email, full_name, linkedin_url`, `show_email`, `registration_type` (active-event registrants) | Connections name/type lookups |
|
||||
| `get_agenda()` | flat rows: slot fields + session fields + `speakers` (string_agg) | Agenda + Home |
|
||||
| `get_active_event()` | the active `events` row (or none) | event name/dates/location |
|
||||
| `get_talk_cohort(p_session_id)` | `email, full_name, registration_type, qr_token` of the **other** attendees checked into that session (staff excluded, self excluded) | the Networking screen's "also attended" list |
|
||||
|
||||
All are `security definer` and expose **only public columns** (email is included
|
||||
because `contacts` is keyed by email and is the identity; `qr_token` is never
|
||||
@@ -84,12 +86,25 @@ Creates a **pending** connection to the contact whose QR was scanned.
|
||||
- **Idempotent:** if the pair already has a connection (either direction) for the
|
||||
active event, returns the existing one instead of creating a duplicate.
|
||||
|
||||
### `accept_connection(p_connection_id)` → `connections`
|
||||
### `accept_connection(p_connection_id)` → `(event_id, from_email, to_email, status, created_at, resolved_at, shared_talk)`
|
||||
Accepts an **incoming** request.
|
||||
- Locks the row (`for update`), verifies the caller is the recipient
|
||||
(`to_email = current_email()`) and the status is still `pending`.
|
||||
- Sets `status = 'accepted'`, `resolved_at = now()`.
|
||||
- **Awards +5 to both** `from_email` and `to_email` (category `connection`).
|
||||
- **Talk networking bonus:** computes whether the two parties share a
|
||||
checked-in session (talk) — i.e. there is a session both were checked into
|
||||
(`checkins` intersection). If they do **and** the event's
|
||||
`talk_networking_bonus > 0`, it awards that bonus to **each** party
|
||||
(category `talk_networking`). Returns `shared_talk = true` in that case so
|
||||
the app can show a "met at {talk}" note.
|
||||
- **Idempotency:** the function is one-shot (row locked, status must be
|
||||
`pending`), so the bonus can never double-award.
|
||||
- **Documented limitation:** check-ins that happen **after** acceptance do
|
||||
not retro-award the bonus — it reflects shared attendance at acceptance
|
||||
time.
|
||||
- The bonus flows through `_award_points`, so the leaderboard sync + staff
|
||||
exclusion are inherited automatically.
|
||||
|
||||
### `reject_connection(p_connection_id)` → `connections`
|
||||
Same guards as accept, but sets `status = 'rejected'`. No points.
|
||||
|
||||
Reference in new issue
Block a user