Booking Service
Component Detail
Service Layer
low complexity
backend
3
Dependencies
1
Dependents
0
Entities
0
Integrations
Description
Server-side Next.js API route handler that receives booking form submissions, applies server-side Zod validation, persists the lead record to PostgreSQL, and triggers the transactional confirmation email. Acts as the authoritative entry point for all booking form submissions and enforces security controls independently of the client.
booking-service
Responsibilities
- Validate incoming POST payload against the Zod booking schema on the server
- Persist qualified lead data to the leads table in PostgreSQL
- Invoke the transactional email service to dispatch the confirmation email to the prospect
- Return appropriate HTTP responses (200 success, 400 validation error, 429 rate limited)
- Enforce per-IP and per-email rate limits to prevent spam and abuse
Interfaces
POST /api/v1/bookings
createBooking(data: BookingFormData): Promise<BookingRecord>
validatePayload(data: unknown): BookingFormData
Relationships
Dependencies (3)
Components this component depends on