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:
Lago committed 2026-09-21 22:34:25 +02:00
1 parent 08ab41898b
commit 3adc0fd58f
35 files changed
+3973 -54

No files matched your search

+24 -2
View File
@@ -5,6 +5,7 @@ import type {
Connection,
Contact,
Event,
EventFeedback,
Feedback,
FeedbackResult,
LeaderboardRow,
@@ -15,6 +16,8 @@ import type {
Session,
Slot,
WelcomeCheckinResult,
AcceptConnectionResult,
TalkCohortMember,
} from './types';
export class ApiError extends Error {}
@@ -74,6 +77,8 @@ export function groupAgenda(rows: AgendaRow[]): { slot: Slot; sessions: Session[
ai_generated_feedback: r.ai_generated_feedback,
material_path: r.material_path,
speakers: r.speakers,
level: r.level,
area: r.area,
created_at: '',
});
}
@@ -81,6 +86,17 @@ export function groupAgenda(rows: AgendaRow[]): { slot: Slot; sessions: Session[
return [...map.values()].sort((a, b) => a.slot.id - b.slot.id);
}
/** Submit (or update) the current user's event-level feedback. */
export async function submitEventFeedback(rating: number, comment: string): Promise<void> {
await rpc('submit_event_feedback', { p_rating: rating, p_comment: comment });
}
/** Read the current user's own event-level feedback (null if not yet submitted). */
export async function getMyEventFeedback(): Promise<EventFeedback | null> {
const rows = await rpc<EventFeedback[]>('get_my_event_feedback', {});
return rows[0] ?? null;
}
/** The signed-in contact's own row (filter by email — admins can see all rows). */
export async function getMyContact(email: string): Promise<Contact | null> {
const { data, error } = await supabase.from('contacts').select('*').eq('email', email).maybeSingle();
@@ -139,8 +155,9 @@ export async function createConnectionRequest(targetQr: string): Promise<Connect
return rpc<Connection>('create_connection_request', { p_target_qr: targetQr });
}
export async function acceptConnection(id: string): Promise<Connection> {
return rpc<Connection>('accept_connection', { p_connection_id: id });
export async function acceptConnection(id: string): Promise<AcceptConnectionResult> {
// accept_connection returns a single composite row (a JSON object).
return rpc<AcceptConnectionResult>('accept_connection', { p_connection_id: id });
}
export async function rejectConnection(id: string): Promise<Connection> {
@@ -154,6 +171,11 @@ export async function getMyCheckins(email: string): Promise<string[]> {
return (data as { session_id: string }[]).map((c) => c.session_id);
}
/** Other attendees (staff excluded, self excluded) checked into the same talk. */
export async function getTalkCohort(sessionId: string): Promise<TalkCohortMember[]> {
return rpc<TalkCohortMember[]>('get_talk_cohort', { p_session_id: sessionId });
}
export async function checkinAttendee(sessionId: string, attendeeQr: string): Promise<CheckinResult> {
const rows = await rpc<CheckinResult[]>('checkin_attendee', { p_session_id: sessionId, p_attendee_qr: attendeeQr });
return rows[0];