feat(bookings): implement ticket receipts and seat sharing system

Add receipt tokens and booking_seats table to track individual tickets
Create receipt and seat view pages with QR code generation
This commit is contained in:
2026-04-12 22:48:26 +08:00
parent 7f582b530c
commit 6194c96ead
15 changed files with 1663 additions and 61 deletions

View File

@@ -63,6 +63,29 @@ export function buildBookingMessage(booking: PublicBooking, confirmationUrl: str
].join('\n')
}
export function parseSeatShareInput(body: {
shared?: boolean
recipientName?: string | null
recipientPhone?: string | null
}) {
const shared = body.shared
const recipientName = normalizeFullName(body.recipientName || '')
const recipientPhone = normalizePhoneNumber(body.recipientPhone || '')
assertBadRequest(typeof shared === 'boolean', 'Shared flag is required')
if (shared) {
assertBadRequest(!recipientName || hasValidFullName(recipientName), 'Recipient name must be at least 2 characters')
assertBadRequest(!recipientPhone || isValidPhoneNumber(recipientPhone), 'Recipient phone number must contain 8 to 15 digits')
}
return {
shared,
recipientName: recipientName || null,
recipientPhone: recipientPhone || null
}
}
export function parseBookingCapacityInput(body: {
totalTables?: number | string | null
}): Pick<BookingCapacitySettings, 'totalTables'> {