Season passes (1.47.3)

A pass sells a ticket at each of several events in a series for one
price. Supervisors set passes up on the Event series page (events and
ticket per event; fixed once sold). Buying on the series page registers
the buyer at every event at once with one checkout (free passes give
tickets straight away; Pay now if online payment isn't possible). The
price is split over the events in proportion to their normal prices:
each registration line is priced at its share and the webhook records
one Payment per event, so cashups stay per event. Pass registrations
aren't repriced, take no coupons and can't be edited. Migration
20261028150000_season_pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-28 11:19:58 +02:00
co-authored by Claude Opus 5.5
parent 96d1e67b85
commit a7c8148588
34 changed files with 1396 additions and 26 deletions
+22
View File
@@ -203,6 +203,28 @@ export type EventSeries = EventSeriesRef & {
events: { id: string; title: string; startDate: string; endDate: string; isActive: boolean; isHidden: boolean; campus?: Event["campus"] }[];
};
/** A season pass (1.47.3): one price for a ticket at each of several events in a series. */
export type SeasonPassItemView = {
id: string; eventId: string; eventOptionId: string; variantId: string | null;
eventTitle: string; startDate: string; endDate: string; ticket: string;
// The ticket's normal price, and this event's share of the pass price.
normalPrice: number; share: number;
};
export type SeasonPassView = {
id: string; seriesId: string; name: string; description: string | null; price: number;
isActive: boolean; saleEndsAt: string | null; normalValue: number; saving: number;
// Why it can't be bought right now, or null.
unavailable: string | null;
items: SeasonPassItemView[];
// Supervisor list only: passes paid for and still unpaid.
sold?: number; unpaid?: number;
};
export type SeasonPassPurchase = {
id: string; quantity: number; total: number; status: "pending" | "paid" | "cancelled"; createdAt: string;
pass: { id: string; name: string; series: { name: string; slug: string } };
registrations: { id: string; status: string; event: { id: string; title: string; startDate: string } }[];
};
/** GET /api/series/:id/compare — one row per event in the series, oldest first. */
export type SeriesComparisonRow = {
eventId: string; title: string; startDate: string; endDate: string; campus?: Event["campus"]; isActive: boolean;