Type payments and user dashboard pages

Moves the duplicated registration-option pricing helper into
src/lib/pricing.ts and drops an unused users list from payments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-21 11:10:01 +02:00
co-authored by Claude Opus 5.5
parent 0a8788afff
commit f6581eb441
4 changed files with 216 additions and 227 deletions
+15 -1
View File
@@ -46,6 +46,8 @@ export type OptionVariant = {
staffPrice?: number | null;
stockLimit?: number;
order?: number;
// Public event endpoints add how many are left when a stock limit is set.
availableCount?: number;
};
export type EarlyBirdTier = {
@@ -65,6 +67,7 @@ export type EventOption = {
price: number;
isMainTicket?: boolean;
stockLimit?: number;
availableCount?: number;
staffPrice?: number | null;
variants?: OptionVariant[];
earlyBirdTiers?: EarlyBirdTier[];
@@ -300,6 +303,8 @@ export type Registration = {
payments?: Payment[];
formResponses?: FormResponse[];
attendees?: Attendee[];
// The discount code currently applied (released redemptions are left out).
couponRedemptions?: { id: string; discountAmount: number; createdAt?: string; coupon?: { id: string; code: string; type?: string; value?: number; description?: string | null } | null }[];
// Tranche-aware total the backend attaches to registration responses.
totalDueComputed?: number | null;
};
@@ -318,7 +323,13 @@ export type Ticket = {
createdAt: string;
updatedAt?: string;
user?: UserSummary;
attendee?: { id: string; name: string; email?: string | null; phone?: string | null } | null;
attendee?: {
id: string; name: string; email?: string | null; phone?: string | null;
// Room/group allocations shown on the ticket (only sets marked "show on ticket").
allocations?: { set: { name: string; order?: number }; group: { name: string } }[];
} | null;
// An open offer to transfer this ticket to someone else, awaiting their acceptance.
transferRequests?: { id: string; toName: string; toEmail?: string | null; toPhone?: string | null; createdAt?: string }[];
event?: Event;
registrationOption?: RegistrationOption;
usages?: { id: string; scannedAt: string; quantityRedeemed?: number }[];
@@ -334,6 +345,9 @@ export type Payment = {
eventId?: string | null;
isDonation?: boolean;
isSponsorship?: boolean;
sponsorName?: string | null;
sponsorMessage?: string | null;
sponsorAnonymous?: boolean;
status?: string | null;
externalId?: string | null;
originalPaymentId?: string | null;