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.

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-09-21 22:34:25 +02:00
1 parent f74db9dc26
commit 0b6d1f2b6f
35 files changed
+3973 -54

No files matched your search

+103 -14
View File
@@ -229,23 +229,25 @@ end;
$$;
-- =============================================================================
-- 7. accept_connection: +5 to both parties
-- 7. accept_connection: +5 to both parties (+ talk networking bonus, since
-- lena and felix were both checked into the slot-2 session above)
-- =============================================================================
do $$
declare
v_conn uuid;
v_from integer;
v_to integer;
v_ok boolean;
v_msg text;
v_conn_id uuid;
v_from integer;
v_to integer;
v_shared boolean;
v_ok boolean;
v_msg text;
begin
-- lena -> felix (both fresh attendees).
-- lena -> felix (both were checked into the slot-2 session).
perform set_user('[email protected]');
select id into v_conn from public.create_connection_request('CVV-ATT-1001');
select id into v_conn_id from public.create_connection_request('CVV-ATT-1001');
-- felix accepts.
perform set_user('[email protected]');
perform public.accept_connection(v_conn);
select shared_talk into v_shared from public.accept_connection(v_conn_id);
select points into v_from from public.registrations
where contact_email = '[email protected]'
@@ -253,16 +255,103 @@ begin
select points into v_to from public.registrations
where contact_email = '[email protected]'
and event_id = (select id from public.events where is_active limit 1);
-- lena had 10 from the check-in test; +5 connection = 15.
-- felix had 15 (check-in + feedback); +5 connection = 20.
v_ok := (v_from = 15 and v_to = 20);
v_msg := 'expected lena=15/felix=20, got lena=' || v_from || ' felix=' || v_to;
insert into test_results values ('connection accepted +5 each', v_ok, case when v_ok then null else v_msg end);
-- lena had 10 from the check-in test; +5 connection + 2 talk bonus = 17.
-- felix had 15 (check-in + feedback); +5 connection + 2 talk bonus = 22.
v_ok := (v_from = 17 and v_to = 22);
v_msg := 'expected lena=17/felix=22, got lena=' || v_from || ' felix=' || v_to;
insert into test_results values ('connection accepted +5 each (+ talk bonus)', v_ok, case when v_ok then null else v_msg end);
v_ok := v_shared;
v_msg := 'expected shared_talk=true (both checked into slot 2)';
insert into test_results values ('accept_connection shared_talk flag', v_ok, case when v_ok then null else v_msg end);
exception when others then
insert into test_results values ('connection (7)', false, 'error: ' || sqlerrm);
end;
$$;
-- =============================================================================
-- 7b. accept_connection: NO talk bonus when the parties share no check-in
-- =============================================================================
do $$
declare
v_conn_id uuid;
v_from integer;
v_to integer;
v_shared boolean;
v_ok boolean;
v_msg text;
begin
-- Two attendees who were never checked in: no shared talk.
-- [email protected] (1003) -> [email protected] (1004).
perform set_user('[email protected]');
select id into v_conn_id from public.create_connection_request('CVV-ATT-1004');
-- emma accepts.
perform set_user('[email protected]');
select shared_talk into v_shared from public.accept_connection(v_conn_id);
select points into v_from from public.registrations
where contact_email = '[email protected]'
and event_id = (select id from public.events where is_active limit 1);
select points into v_to from public.registrations
where contact_email = '[email protected]'
and event_id = (select id from public.events where is_active limit 1);
-- +5 connection each, NO talk bonus (no shared check-in).
v_ok := (v_from = 5 and v_to = 5);
v_msg := 'expected jonas=5/emma=5 (no bonus), got jonas=' || v_from || ' emma=' || v_to;
insert into test_results values ('no talk bonus without shared check-in', v_ok, case when v_ok then null else v_msg end);
v_ok := (v_shared = false);
v_msg := 'expected shared_talk=false';
insert into test_results values ('shared_talk=false without shared check-in', v_ok, case when v_ok then null else v_msg end);
exception when others then
insert into test_results values ('connection (7b)', false, 'error: ' || sqlerrm);
end;
$$;
-- =============================================================================
-- 7c. accept_connection: talk bonus disabled when talk_networking_bonus = 0
-- =============================================================================
do $$
declare
v_session uuid;
v_conn_id uuid;
v_from integer;
v_to integer;
v_ok boolean;
v_msg text;
begin
-- Disable the bonus for the active event.
update public.events set talk_networking_bonus = 0
where id = (select id from public.events where is_active limit 1);
-- [email protected] (1002) and [email protected] (1005): check both
-- into the slot-2 session so they share a check-in, then connect.
select id into v_session from public.sessions where slot_id = 2 limit 1;
perform set_user('[email protected]');
perform public.checkin_attendee(v_session, 'CVV-ATT-1002');
perform public.checkin_attendee(v_session, 'CVV-ATT-1005');
perform set_user('[email protected]');
select id into v_conn_id from public.create_connection_request('CVV-ATT-1005');
perform set_user('[email protected]');
perform public.accept_connection(v_conn_id);
select points into v_from from public.registrations
where contact_email = '[email protected]'
and event_id = (select id from public.events where is_active limit 1);
select points into v_to from public.registrations
where contact_email = '[email protected]'
and event_id = (select id from public.events where is_active limit 1);
-- +10 check-in + 5 connection each, NO bonus (disabled).
v_ok := (v_from = 15 and v_to = 15);
v_msg := 'expected mia=15/paul=15 (bonus disabled), got mia=' || v_from || ' paul=' || v_to;
insert into test_results values ('talk bonus disabled when bonus=0', v_ok, case when v_ok then null else v_msg end);
exception when others then
insert into test_results values ('connection (7c)', false, 'error: ' || sqlerrm);
end;
$$;
-- =============================================================================
-- 8. adjust_points: admin only
-- =============================================================================