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:
@@ -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'> {
|
||||
|
||||
Reference in New Issue
Block a user