feat: implement public booking cancellation feature
- Added cancelPublicBooking handler to manage booking cancellations. - Updated public booking service to include cancellation logic. - Created cancelPublicBooking schema for input validation. - Modified public booking confirmation page to allow users to cancel their bookings. - Enhanced email service to send cancellation confirmation emails. - Made customerEmail field required in booking schemas and updated related components. - Updated API client to support cancellation requests. - Added migration to enforce non-nullable customer_email fields in the database.
This commit is contained in:
@@ -7,6 +7,7 @@ import { sendMail } from '@/lib/mailer';
|
||||
|
||||
type BookingEmailInput = {
|
||||
bookingCode: string;
|
||||
complexSlug?: string;
|
||||
complexName: string;
|
||||
date: string;
|
||||
startTime: string;
|
||||
@@ -14,7 +15,7 @@ type BookingEmailInput = {
|
||||
courtName: string;
|
||||
sportName: string;
|
||||
customerName: string;
|
||||
customerEmail?: string;
|
||||
customerEmail: string;
|
||||
price?: number;
|
||||
};
|
||||
|
||||
@@ -23,6 +24,7 @@ export async function sendBookingConfirmation(data: BookingEmailInput) {
|
||||
|
||||
const html = bookingConfirmationHtml({
|
||||
bookingCode: data.bookingCode,
|
||||
complexSlug: data.complexSlug,
|
||||
complexName: data.complexName,
|
||||
date: data.date,
|
||||
startTime: data.startTime,
|
||||
|
||||
Reference in New Issue
Block a user