feat(bookings): add transaction document uploads for bank payments

Add payment method selection (Cash/Bank) to booking details
Support uploading, downloading, and deleting transaction documents
Update database schema and API endpoints to handle file storage
This commit is contained in:
2026-05-09 12:56:32 +08:00
parent 3710216346
commit b64a2b4c1c
14 changed files with 888 additions and 31 deletions

View File

@@ -3,6 +3,7 @@ import type { AppLocale } from './i18n'
export type BookingMode = string
export type TicketType = string
export type BookingStatus = 'pending' | 'confirmed'
export type PaymentMethod = 'cash' | 'bank'
export interface DinnerEvent {
id: string
@@ -58,6 +59,8 @@ export interface PublicBooking {
personInChargeId: string
personInChargeName: string
personInChargePhoneNumber: string
paymentMethod: PaymentMethod
transactionDocument: BookingTransactionDocument | null
remark: string | null
status: BookingStatus
statusLabel: string
@@ -65,6 +68,14 @@ export interface PublicBooking {
confirmedAt: string | null
}
export interface BookingTransactionDocument {
originalName: string
mimeType: string
size: number
uploadedAt: string
url: string
}
export interface ReceiptBooking {
id: string
receiptToken: string
@@ -170,6 +181,10 @@ export function isBookingStatus(value: string | null | undefined): value is Book
return value === 'pending' || value === 'confirmed'
}
export function isPaymentMethod(value: string | null | undefined): value is PaymentMethod {
return value === 'cash' || value === 'bank'
}
export function getBookingStatusLabel(value: BookingStatus | string, label?: string | null, locale: AppLocale = 'en') {
if (label && locale !== 'zh') {
return label