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:
Jose Selesan
2026-06-05 11:24:02 -03:00
parent 1210854c22
commit 260d79fc99
24 changed files with 488 additions and 105 deletions

View File

@@ -62,7 +62,7 @@ const bookingFormSchema = z.object({
.trim()
.min(6, 'Ingresá un teléfono válido.')
.max(30, 'El teléfono no puede superar los 30 caracteres.'),
customerEmail: z.string().email('Ingresá un email válido.').optional().or(z.literal('')),
customerEmail: z.string().email('Ingresá un email válido.'),
});
type BookingFormValues = z.infer<typeof bookingFormSchema>;
@@ -1297,7 +1297,7 @@ function SelectedSlotCard(props: BookingShellProps & { compact?: boolean }) {
<Field data-invalid={Boolean(errors.customerEmail)}>
<FieldLabel htmlFor="customerEmail" className="text-white/76">
Email <span className="text-white/40 font-normal">(opcional)</span>
Email
</FieldLabel>
<Input
id="customerEmail"
@@ -1445,7 +1445,7 @@ export function PublicBookingPage({ complexSlug }: PublicBookingPageProps) {
startTime: selectedSlot.startTime,
customerName: payload.customerName,
customerPhone: payload.customerPhone,
customerEmail: payload.customerEmail || undefined,
customerEmail: payload.customerEmail,
});
},
});