Add waitlist for sold-out tickets

Events can take a waitlist for sold-out lines. When places free up
(cancellation, smaller booking, higher stock limit) the next person is
offered them with a claim link and the places are held for a set time;
unclaimed offers expire and move on, with optional partial offers. Stock
is now counted in one place (utils/stock.js), including held places,
and manual registrations and booking edits are now stock-checked. Adds a
supervisor waitlist page, My Events waitlists, and the daily summary count.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-19 13:43:10 +02:00
co-authored by Claude Opus 5.5
parent 123fb288b1
commit 736d17caff
31 changed files with 1465 additions and 59 deletions
@@ -23,7 +23,7 @@ export const eventDetailHelpContent: HelpContent = {
If a discounted price is shown with the original struck through, an early-bird window is active — the price rises automatically once it ends. Got a discount code? Enter it on the registration page under &quot;Have a code?&quot; (you need to be logged in).
</GuideItem>
<GuideItem icon={Ticket} title="Availability badges" tone="brand">
&quot;N remaining&quot; appears once stock runs low, and &quot;Sold out&quot; once an option is fully booked.
&quot;N remaining&quot; appears once stock runs low, and &quot;Sold out&quot; once an option is fully booked. Some events have a waitlist: tap &quot;Join waitlist&quot; and you&apos;ll be emailed or WhatsApped a link to claim a place if one opens up (it&apos;s held for you for a limited time).
</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. 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.
@@ -23,6 +23,7 @@ import { supervisorPaymentsHelpContent } from "./supervisor-payments";
import { supervisorFormsHelpContent } from "./supervisor-forms";
import { supervisorCouponsHelpContent } from "./supervisor-coupons";
import { supervisorConsentHelpContent } from "./supervisor-consent";
import { supervisorWaitlistHelpContent } from "./supervisor-waitlist";
import { supervisorEmailAttendeesHelpContent } from "./supervisor-email-attendees";
import { supervisorWhatsappAttendeesHelpContent } from "./supervisor-whatsapp-attendees";
import { staffEventTicketsHelpContent } from "./staff-event-tickets";
@@ -149,6 +150,11 @@ const REGISTRY: HelpRegistryEntry[] = [
matches: pathname => pathname === "/dashboard/supervisor/payments",
content: supervisorPaymentsHelpContent,
},
{
slug: "supervisor-waitlist",
matches: pathname => pathname === "/dashboard/supervisor/waitlist",
content: supervisorWaitlistHelpContent,
},
{
slug: "supervisor-consent",
matches: pathname => pathname === "/dashboard/supervisor/consent",
@@ -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), make it a youth event that needs parental consent for under-18s, 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, turn on a waitlist for sold-out tickets, 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.
@@ -0,0 +1,56 @@
import React from "react";
import { ListChecks, Send, Clock, ArrowUpDown, UserMinus, Settings } from "lucide-react";
import { GuideItem } from "@/components/shared/GuideItem";
import type { HelpContent } from "./types";
/** Help content for /dashboard/supervisor/waitlist. */
export const supervisorWaitlistHelpContent: HelpContent = {
title: "Waitlist",
subtitle: "People waiting for sold-out tickets.",
tabs: [
{
key: "how",
label: "How it works",
icon: ListChecks,
content: (
<div className="space-y-4">
<div className="space-y-4">
<GuideItem icon={Settings} title="Turning it on" tone="brand">
In the event wizard&apos;s Visibility step, tick &quot;Waitlist for sold-out tickets&quot;, set how long offered places are held (24 hours by default), and whether someone can be offered fewer places than they asked for.
</GuideItem>
<GuideItem icon={ListChecks} title="Joining" tone="green">
When a ticket is sold out, the event and registration pages show &quot;Join waitlist&quot;. People pick the ticket and how many, and can leave again from My Events.
</GuideItem>
<GuideItem icon={Send} title="Offers" tone="violet">
When places free up — a cancellation, a smaller booking, or a higher stock limit — the next person in line is emailed or WhatsApped a claim link. The places are held for them, so nobody else can buy them in the meantime.
</GuideItem>
<GuideItem icon={Clock} title="Expiry" tone="amber">
If the offer isn&apos;t claimed in time, it expires and the places go to the next person. Claiming goes through normal registration and payment, with early-bird and coupon rules as usual.
</GuideItem>
</div>
</div>
),
},
{
key: "tools",
label: "This page",
icon: ArrowUpDown,
content: (
<div className="space-y-4">
<div className="space-y-4">
<GuideItem icon={Send} title="Offer place" tone="brand">
Send someone an offer straight away, even if no place has freed up (this can take the event over its stock limit).
</GuideItem>
<GuideItem icon={ArrowUpDown} title="Reorder" tone="green">
Move someone up or down the queue.
</GuideItem>
<GuideItem icon={UserMinus} title="Remove" tone="rose">
Take someone off the waitlist. If they were holding an offer, it goes to the next person.
</GuideItem>
</div>
<p className="text-xs text-gray-500">The daily summary email shows how many people are on each event&apos;s waitlist.</p>
</div>
),
},
],
};