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
22 lines
573 B
TypeScript
22 lines
573 B
TypeScript
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
|
|
}
|
|
})
|