Add parental consent for youth events

Youth events need a name and date of birth for every attendee, and a
parent/guardian's details for under-18s. Parents get an email and
WhatsApp link to a consent page that records the signed name, time, IP,
device and exact consent text; medical and emergency details are stored
encrypted. Tickets are issued but check-in is blocked until consent is
given (supervisor override audited). A daily job sends reminders and
purges medical details after the retention period. Adds a supervisor
consent tracker, consent status and medical list reports, and clears
consent data when an account is anonymised.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-19 13:24:44 +02:00
co-authored by Claude Opus 5.5
parent 03b79972e6
commit f55353ecc6
41 changed files with 1988 additions and 88 deletions
@@ -26,7 +26,7 @@ export const eventDetailHelpContent: HelpContent = {
&quot;N remaining&quot; appears once stock runs low, and &quot;Sold out&quot; once an option is fully booked.
</GuideItem>
<GuideItem icon={Users} title="Registering for other people?" tone="violet">
Some events let you name each person you&apos;re booking for. Each named person gets their own ticket and their own attendee form, and you can choose to have every ticket sent to you or each person their own.
Some events let you name each person you&apos;re booking for. Each named person gets their own ticket and their own attendee form, and you can choose to have every ticket sent to you or each person their own. On youth events, you&apos;ll give each person&apos;s date of birth; for anyone under 18, their parent or guardian is asked to give consent by email and WhatsApp before they can be checked in.
</GuideItem>
</div>
</div>
@@ -22,6 +22,7 @@ import { supervisorAtTheDoorHelpContent } from "./supervisor-at-the-door";
import { supervisorPaymentsHelpContent } from "./supervisor-payments";
import { supervisorFormsHelpContent } from "./supervisor-forms";
import { supervisorCouponsHelpContent } from "./supervisor-coupons";
import { supervisorConsentHelpContent } from "./supervisor-consent";
import { supervisorEmailAttendeesHelpContent } from "./supervisor-email-attendees";
import { supervisorWhatsappAttendeesHelpContent } from "./supervisor-whatsapp-attendees";
import { staffEventTicketsHelpContent } from "./staff-event-tickets";
@@ -148,6 +149,11 @@ const REGISTRY: HelpRegistryEntry[] = [
matches: pathname => pathname === "/dashboard/supervisor/payments",
content: supervisorPaymentsHelpContent,
},
{
slug: "supervisor-consent",
matches: pathname => pathname === "/dashboard/supervisor/consent",
content: supervisorConsentHelpContent,
},
{
slug: "supervisor-coupons",
matches: pathname => pathname === "/dashboard/supervisor/coupons",
@@ -1,5 +1,5 @@
import React from "react";
import { QrCode, Filter, CheckCircle2 } from "lucide-react";
import { QrCode, Filter, CheckCircle2, ShieldAlert } from "lucide-react";
import { GuideItem } from "@/components/shared/GuideItem";
import type { HelpContent } from "./types";
@@ -19,6 +19,9 @@ export const staffTicketScanningHelpContent: HelpContent = {
<GuideItem icon={CheckCircle2} title="Outcomes" tone="green">
You&apos;ll see Success (with redeemed/remaining counts), Already Used, or an Error if something&apos;s wrong with the ticket.
</GuideItem>
<GuideItem icon={ShieldAlert} title="Parental consent" tone="rose">
On youth events, the confirm screen warns when a parent hasn&apos;t given consent yet (or declined). That person can&apos;t be checked in; a supervisor can override, and the override is recorded in the audit log.
</GuideItem>
</div>
</div>
),
@@ -0,0 +1,58 @@
import React from "react";
import { ShieldCheck, Send, RefreshCw, HeartPulse, Ban, Clock, QrCode } from "lucide-react";
import { GuideItem } from "@/components/shared/GuideItem";
import type { HelpContent } from "./types";
/** Help content for /dashboard/supervisor/consent. */
export const supervisorConsentHelpContent: HelpContent = {
title: "Parental consent",
subtitle: "Youth events: who still needs a parent's consent before check-in.",
tabs: [
{
key: "how",
label: "How it works",
icon: ShieldCheck,
content: (
<div className="space-y-4">
<div className="space-y-4">
<GuideItem icon={ShieldCheck} title="Turning it on" tone="brand">
In the event wizard&apos;s Visibility step, tick &quot;Requires parental consent&quot;, write the consent text, and choose whether to ask for medical info, an emergency contact and photo consent.
</GuideItem>
<GuideItem icon={Send} title="Requests" tone="green">
Everyone registering gives a date of birth for each attendee. For anyone under 18 on the event&apos;s start date, the parent or guardian is sent a consent link by email and WhatsApp. They read the text, fill in any medical details, type their name to sign, and give or decline consent.
</GuideItem>
<GuideItem icon={Clock} title="Reminders" tone="amber">
Unanswered requests are reminded automatically 2 days later, then every 3 days until the event. Links stop working when the event ends.
</GuideItem>
<GuideItem icon={QrCode} title="At check-in" tone="rose">
Tickets are sent as normal, but the scanner won&apos;t check someone in until consent is given. Supervisors can override, which is recorded in the audit log.
</GuideItem>
<GuideItem icon={Ban} title="Declined" tone="gray">
The registrant and the event&apos;s notification recipients are told. The registration stays, but can&apos;t be checked in — handle any refund from Payments.
</GuideItem>
</div>
</div>
),
},
{
key: "tools",
label: "This page",
icon: RefreshCw,
content: (
<div className="space-y-4">
<div className="space-y-4">
<GuideItem icon={Send} title="Resend" tone="brand">
Resend one request, or every pending one at once. Each resend issues a new link; old links stop working.
</GuideItem>
<GuideItem icon={RefreshCw} title="Re-request consent" tone="violet">
If you change the consent text, parents who already agreed keep their record of the old version. &quot;Re-request consent&quot; asks them again on the new text, and also sends requests to under-18s who never got one (for example, names added later).
</GuideItem>
<GuideItem icon={HeartPulse} title="Medical & emergency list" tone="rose">
A printable, confidential list for camp leaders, for attendees whose consent has been given. Every time it&apos;s opened is recorded in the audit log. Medical details are deleted a set number of days after the event (Site Settings → Legal).
</GuideItem>
</div>
</div>
),
},
],
};
@@ -44,7 +44,7 @@ export const supervisorEventsHelpContent: HelpContent = {
Build a custom registration form — text, number, date, yes/no, statement, and heading fields, reorderable, optionally required before tickets are generated.
</GuideItem>
<GuideItem icon={Eye} title="Visibility" tone="gray">
Hide the event, allow guest (no-account) registration, turn on named attendees (group tickets — each named person gets their own ticket and form), or toggle it active.
Hide the event, allow guest (no-account) registration, turn on named attendees (group tickets — each named person gets their own ticket and form), make it a youth event that needs parental consent for under-18s, or toggle it active.
</GuideItem>
<GuideItem icon={Bell} title="Notifications" tone="blue">
Choose which staff get registration, payment, and daily-summary emails for this event.