Add bundle deals

Sell a set of tickets together for one price (e.g. 5 Adult + 3 Child for R500).
Bundles apply automatically, as many times as a registration's tickets allow, and
only when cheaper than the prices actually charged. Coupons come off afterwards.

- EventBundle/EventBundleItem/RegistrationBundle models and Registration.bundleDiscount
- Supervisor "Bundle deals" page, quote endpoint, bundle lines on invoices,
  receipts, emails, WhatsApp and Yoco checkout, Discounts report rows
- Register form shows started bundles with "Complete bundle" and "+" buttons
- Demo: Family Fun Day sells a Family deal bundle instead of the Family pass ticket

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-21 15:14:53 +02:00
co-authored by Claude Opus 5.5
parent 2a8e8c7c11
commit 268781d610
35 changed files with 1766 additions and 149 deletions
@@ -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 { supervisorBundlesHelpContent } from "./supervisor-bundles";
import { supervisorConsentHelpContent } from "./supervisor-consent";
import { supervisorWaitlistHelpContent } from "./supervisor-waitlist";
import { supervisorOfflineScansHelpContent } from "./supervisor-offline-scans";
@@ -182,6 +183,11 @@ const REGISTRY: HelpRegistryEntry[] = [
matches: pathname => pathname === "/dashboard/supervisor/coupons",
content: supervisorCouponsHelpContent,
},
{
slug: "supervisor-bundles",
matches: pathname => pathname === "/dashboard/supervisor/bundles",
content: supervisorBundlesHelpContent,
},
{
slug: "supervisor-forms",
matches: pathname => pathname === "/dashboard/supervisor/forms" || pathname === "/dashboard/admin/forms",
@@ -0,0 +1,66 @@
import React from "react";
import { Gift, Plus, Layers, BadgePercent, CalendarClock, TicketPercent, Repeat, BarChart2, Lock } from "lucide-react";
import { GuideItem } from "@/components/shared/GuideItem";
import type { HelpContent } from "./types";
/** Help content for /dashboard/supervisor/bundles. */
export const supervisorBundlesHelpContent: HelpContent = {
title: "Bundle deals",
subtitle: "Sell a set of tickets together for one price.",
tabs: [
{
key: "create",
label: "Creating bundles",
icon: Plus,
content: (
<div className="space-y-4">
<div className="space-y-4">
<GuideItem icon={Gift} title="What's in it" tone="brand">
Pick the event, then add each ticket type and how many, e.g. 5 × Adult + 3 × Child, and the price for the lot. For options with variants (sizes, room types) choose one variant or &quot;Any variant&quot;.
</GuideItem>
<GuideItem icon={BadgePercent} title="The saving" tone="green">
The form shows what the tickets cost separately at the standard price and how much the bundle saves. Buyers see the deal on the event page and when they register.
</GuideItem>
<GuideItem icon={CalendarClock} title="Dates" tone="amber">
Optional &quot;Available from&quot; and &quot;Available until&quot; dates, e.g. for a launch-week deal. &quot;Turn off&quot; stops it straight away.
</GuideItem>
</div>
</div>
),
},
{
key: "how",
label: "How bundles work",
icon: Layers,
content: (
<div className="space-y-4">
<div className="space-y-4">
<GuideItem icon={Repeat} title="Automatic, as many times as fits" tone="brand">
No code needed. 10 adults + 6 children gets the 5 + 3 deal twice; anything left over is charged as usual. This works the same online, for manual registrations, at the door and on the kiosk.
</GuideItem>
<GuideItem icon={BadgePercent} title="Best price wins" tone="green">
A bundle only applies when it&apos;s cheaper than the tickets at the prices actually charged, early-bird and staff prices included, so it never makes anything dearer. If an event has several bundles, the one that saves the most is used first.
</GuideItem>
<GuideItem icon={TicketPercent} title="Coupon codes" tone="violet">
A code still works with a bundle: the bundle comes off first, then the code is worked out on what&apos;s left.
</GuideItem>
<GuideItem icon={Lock} title="Changes later" tone="amber">
Registrations that already have a bundle keep it, even after it&apos;s turned off or its dates pass. It&apos;s worked out again only when the registration&apos;s own tickets change. A bundle that has been used can&apos;t be deleted; deleting it turns it off instead.
</GuideItem>
</div>
</div>
),
},
{
key: "tracking",
label: "Tracking",
icon: BarChart2,
content: (
<div className="space-y-4">
<p>Each bundle shows how many times it&apos;s been used, on how many registrations, and the total saving given. The saving shows as its own line on invoices, receipts, emails and the payment page.</p>
<p>The <strong>Discounts</strong> report (Reports → Financial) lists bundles next to coupon codes, and the Finance report shows sales after discounts.</p>
</div>
),
},
],
};