Archived
Pick sessions (frontend), roadmap and handover docs
Event wizard: how people book (whole course / pick sessions), capacity per session and per-option session mode. Session picker on the public registration page, Manual registration and the kiosk; at the door points to Manual registration. Register, tickets and My Events handle picked sessions. Adds docs/ROADMAP-v2.md and docs/HANDOVER.md so work can carry on from another machine, and a pick-sessions e2e test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import Link from "next/link";
|
||||
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
||||
import { useAuth } from "@/hooks/useAuth";
|
||||
import { useRouter } from "next/navigation";
|
||||
@@ -15,7 +16,7 @@ import { DoorOpen, UserPlus, CreditCard, CheckSquare, Ticket, RotateCcw, type Lu
|
||||
import { errorMessage } from "@/lib/utils";
|
||||
import { optionUnitNow, variantUnitNow } from "@/lib/pricing";
|
||||
import { printTicketCards, ticketTypeLabel as ticketLabel } from "@/lib/ticketPrint";
|
||||
import { todaysSession } from "@/lib/sessions";
|
||||
import { isPickOption, todaysSession } from "@/lib/sessions";
|
||||
import type { Event, EventOption, PublicBundle, Registration, Ticket as TicketRecord, UserSummary } from "@/types";
|
||||
|
||||
type NewAttendee = { name: string; email: string | null; phone: string | null; notifPref: "email" | "whatsapp" | "both" };
|
||||
@@ -96,6 +97,7 @@ export default function AtTheDoorPage() {
|
||||
const [eventId, setEventId] = useState("");
|
||||
|
||||
const [eventOptions, setEventOptions] = useState<EventOption[]>([]);
|
||||
const [doorHasPickOptions, setDoorHasPickOptions] = useState(false);
|
||||
const [showOptionsModal, setShowOptionsModal] = useState(false);
|
||||
const [pendingUser, setPendingUser] = useState<NewAttendee | null>(null);
|
||||
const [doorCoupon, setDoorCoupon] = useState<AppliedCoupon | null>(null);
|
||||
@@ -158,7 +160,11 @@ export default function AtTheDoorPage() {
|
||||
authToken: token
|
||||
});
|
||||
|
||||
setEventOptions(ev.options || ev.eventOptions || []);
|
||||
// Per-session tickets ("pick sessions") are booked from Manual registration,
|
||||
// which has the session picker.
|
||||
const all = ev.options || ev.eventOptions || [];
|
||||
setEventOptions(all.filter(o => !isPickOption(ev, o)));
|
||||
setDoorHasPickOptions(all.some(o => isPickOption(ev, o)));
|
||||
setDoorAllowsNames(!!ev.allowNamedAttendees || !!ev.requiresParentalConsent);
|
||||
setDoorYouthStart(ev.requiresParentalConsent ? ev.startDate : null);
|
||||
setDoorCollectGender(!!ev.collectGender);
|
||||
@@ -493,6 +499,11 @@ export default function AtTheDoorPage() {
|
||||
{mode === "refund" && (
|
||||
<DoorRefundPanel token={token} eventId={eventId} setInfo={setInfo} />
|
||||
)}
|
||||
{doorHasPickOptions && (
|
||||
<div className="mt-4 p-3 border rounded bg-amber-50 border-amber-200 text-amber-900 text-sm">
|
||||
This event has per-session tickets. Book those from <Link className="underline font-medium" href="/dashboard/supervisor/manual">Manual registration</Link>, which lets you choose the sessions.
|
||||
</div>
|
||||
)}
|
||||
<OptionsModal
|
||||
open={showOptionsModal}
|
||||
onClose={() => { setShowOptionsModal(false); setPendingEditReg(null); }}
|
||||
|
||||
Reference in New Issue
Block a user