Add attendee count field to booking requests and display it
Updates API schemas and database to include attendee count for bookings, modifies the public request form to accept this new optional field, and displays the attendee count on the booking details. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 9c655ed7-866c-454d-b646-e458df854c65 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/OsTuUKE Replit-Helium-Checkpoint-Created: true
This commit is contained in:
@@ -161,6 +161,7 @@ const bookingCreateSchema = z
|
||||
roomId: z.number().int().positive(),
|
||||
title: z.string().trim().min(1).max(500),
|
||||
requesterName: z.string().trim().max(300).nullable().optional(),
|
||||
attendeeCount: z.number().int().positive().max(100000).nullable().optional(),
|
||||
startsAt: isoDateTime,
|
||||
endsAt: isoDateTime,
|
||||
notes: z.string().trim().max(5000).nullable().optional(),
|
||||
@@ -175,6 +176,7 @@ const bookingPatchSchema = z
|
||||
roomId: z.number().int().positive().optional(),
|
||||
title: z.string().trim().min(1).max(500).optional(),
|
||||
requesterName: z.string().trim().max(300).nullable().optional(),
|
||||
attendeeCount: z.number().int().positive().max(100000).nullable().optional(),
|
||||
startsAt: isoDateTime.optional(),
|
||||
endsAt: isoDateTime.optional(),
|
||||
notes: z.string().trim().max(5000).nullable().optional(),
|
||||
@@ -191,6 +193,7 @@ const publicBookingRequestSchema = z
|
||||
requesterName: z.string().trim().min(1).max(300),
|
||||
requesterPhone: z.string().trim().min(3).max(40),
|
||||
requesterOrg: z.string().trim().max(300).nullable().optional(),
|
||||
attendeeCount: z.number().int().positive().max(100000).nullable().optional(),
|
||||
startsAt: isoDateTime,
|
||||
endsAt: isoDateTime,
|
||||
notes: z.string().trim().max(5000).nullable().optional(),
|
||||
@@ -458,6 +461,7 @@ router.post(
|
||||
requesterName: body.requesterName,
|
||||
requesterPhone: body.requesterPhone,
|
||||
requesterOrg: body.requesterOrg ?? null,
|
||||
attendeeCount: body.attendeeCount ?? null,
|
||||
startsAt,
|
||||
endsAt,
|
||||
status: "pending",
|
||||
@@ -687,6 +691,7 @@ router.post(
|
||||
roomId: body.roomId,
|
||||
title: body.title,
|
||||
requesterName: body.requesterName ?? null,
|
||||
attendeeCount: body.attendeeCount ?? null,
|
||||
startsAt,
|
||||
endsAt,
|
||||
status: canApprove ? "approved" : "pending",
|
||||
@@ -773,6 +778,9 @@ router.patch(
|
||||
...(body.requesterName !== undefined
|
||||
? { requesterName: body.requesterName }
|
||||
: {}),
|
||||
...(body.attendeeCount !== undefined
|
||||
? { attendeeCount: body.attendeeCount }
|
||||
: {}),
|
||||
startsAt,
|
||||
endsAt,
|
||||
...(body.notes !== undefined ? { notes: body.notes } : {}),
|
||||
|
||||
Reference in New Issue
Block a user