feat(bookings): implement booking system and confirmation flow
Add database tables and repository for managing bookings Create API endpoints for booking submission and capacity management Update landing page to persist bookings before WhatsApp redirection
This commit is contained in:
21
server/api/bookings.get.ts
Normal file
21
server/api/bookings.get.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { requireAuth } from '../utils/auth'
|
||||
import { getBookingCapacitySettings, getBookingInventorySummary, listBookings } from '../utils/booking-repository'
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const auth = await requireAuth(event)
|
||||
const [bookings, settings, summary] = await Promise.all([
|
||||
listBookings(
|
||||
auth.user.role === 'super_admin'
|
||||
? undefined
|
||||
: { personInChargeId: auth.user.id }
|
||||
),
|
||||
getBookingCapacitySettings(),
|
||||
getBookingInventorySummary()
|
||||
])
|
||||
|
||||
return {
|
||||
bookings,
|
||||
settings,
|
||||
summary
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user