-
Notifications
You must be signed in to change notification settings - Fork 10.8k
feat: Add endpoint to add attendees to existing bookings #24414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: Add endpoint to add attendees to existing bookings #24414
Conversation
- Created POST /v2/bookings/:bookingUid/attendees endpoint - Added AddAttendeesInput_2024_08_13 for input validation - Added AddAttendeesOutput_2024_08_13 for response format - Created BookingAttendeesService_2024_08_13 for business logic - Created BookingAttendeesController_2024_08_13 for API endpoint - Added validation to check for duplicate attendee emails - Integrated with existing booking and event type repositories - Added validateAndTransformAddAttendeesInput method to InputBookingsService - Fixed pre-existing ESLint no-prototype-builtins warnings - Left placeholder for custom booking field validation logic Co-Authored-By: [email protected] <[email protected]>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The latest updates on your projects. Learn more about Vercel for GitHub. |
…ing-bookings-via-the-api
What does this PR do?
Adds a new API v2 endpoint
POST /v2/bookings/:bookingUid/attendees
to add attendees to existing bookings.Requested by: @SomayChauhan
Devin session: https://app.devin.ai/sessions/5709b1f8262d4a23bb4b6e7b5c8bb9dd
Implementation Details
New Files:
booking-attendees.controller.ts
- NestJS controller for the endpointbooking-attendees.service.ts
- Service handling attendee addition logicadd-attendees.output.ts
- Output type (returns full booking with updated attendees)add-attendees.input.ts
- Input validation (array of attendees with email, name, timeZone, phoneNumber)Modified Files:
bookings.module.ts
- Registered new controller and serviceinput.service.ts
- AddedvalidateAndTransformAddAttendeesInput()
methodno-prototype-builtins
warnings inisRescheduleSeatedBody()
andisCancelSeatedBody()
Validation Logic
The endpoint validates:
bookingFields
are fetched but not used.Important Limitations
Default values:
locale: "en"
(hardcoded)Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Prerequisites
Test Cases
Happy Path:
Expected: 200 OK with full booking object including new attendee
Error Cases:
Human Review Checklist
Critical items to verify:
Email/Calendar Integration - Is it intentional that this endpoint doesn't send notifications or update calendar events? Should we add this functionality?
Booking Field Validation - The user mentioned adding custom validation logic for booking fields. The placeholder is in
validateAndTransformAddAttendeesInput()
wherebookingFields
are fetched. Is this acceptable for now?Paid Events - If the event type requires payment, should adding attendees collect payment from new attendees?
Seated Events - If the event type uses seats (
seatsPerTimeSlot
), should this endpoint verify seat availability?Default Locale - All attendees get
locale: "en"
. Should this be configurable or derived from other fields?Security - Verify that
BookingUidGuard
properly validates ownership/permissions for the booking.ESLint Fixes - The PR includes fixes for pre-existing
no-prototype-builtins
warnings in the same file. While good hygiene, this is technically unrelated to the feature.Checklist