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];
+33 -1
View File
@@ -35,6 +35,8 @@ export interface Event {
is_active: boolean;
/** When true, the app uses the real system clock for slot status (Live/Next/Done). */
use_realtime_clock: boolean;
/** Bonus points each party earns for a connection when they shared a checked-in talk (0 = off). */
talk_networking_bonus: number;
avg_feedback: number | null;
num_sessions: number;
num_speakers: number;
@@ -68,6 +70,10 @@ export interface Session {
material_path: string | null;
/** Comma-separated speaker names (from the get_agenda RPC). */
speakers: string | null;
/** Free-text level classification (e.g. 100/200/300 or Beginner/Intermediate). */
level: string | null;
/** Free-text area/topic classification (e.g. Power Apps, Power Automate). */
area: string | null;
created_at: string;
}
@@ -88,6 +94,18 @@ export interface AgendaRow {
ai_generated_feedback: string | null;
material_path: string | null;
speakers: string | null;
level: string | null;
area: string | null;
}
/** Event-level feedback (distinct from the per-session `feedback` table). */
export interface EventFeedback {
id: string;
event_id: string;
contact_email: string;
rating: number;
comment: string | null;
created_at: string;
}
export interface Preference {
@@ -141,7 +159,7 @@ export interface PointsLogRow {
event_id: string;
contact_email: string;
delta: number;
category: 'checkin' | 'connection' | 'feedback' | 'admin';
category: 'checkin' | 'connection' | 'feedback' | 'admin' | 'talk_networking';
created_at: string;
}
@@ -169,6 +187,20 @@ export interface WelcomeCheckinResult {
already: boolean;
}
/** Result of accepting a connection (the connection row + the shared-talk flag). */
export interface AcceptConnectionResult extends Connection {
/** True when both parties were checked into the same session (talk). */
shared_talk: boolean;
}
/** A person checked into the same talk (from get_talk_cohort). */
export interface TalkCohortMember {
email: string;
full_name: string;
registration_type: RegistrationType | null;
qr_token: string | null;
}
export interface FeedbackResult {
feedback_id: string;
points: number;