* fix(api): remove OAuth client ID suffix from email in booking API responses Fixes #25494 | Linear: CAL-6843 When managed users create or receive bookings, their emails were being returned with an internal OAuth client ID suffix (e.g., bob+cuid123@example.com). This suffix is used internally for user identification but should not be exposed in API responses. Changes: - Add cleanOAuthEmailSuffix() helper using CUID regex pattern - Clean email suffix in hosts[], attendees[], bookingFieldsResponses.email, bookingFieldsResponses.guests[], and reassignedTo.email - Pattern consistent with google-calendar.service.ts implementation Affected output methods: - getOutputBooking - getOutputRecurringBooking - getOutputSeatedBooking - getOutputRecurringSeatedBooking - getOutputReassignedBooking - getHost * refactor(api): preserve original email, add displayEmail field Per team discussion, keep original email unchanged to avoid breaking changes for platform customers. Add displayEmail field with CUID suffix removed for display purposes * feat(api): add displayEmail to booking output DTOs Add displayEmail property to BookingAttendee, BookingHost and ReassignedToDto for API documentation and type safety * test(api): add e2e tests for displayEmail fields in managed user bookings Add tests to verify that displayEmail fields correctly strip CUID suffix from OAuth managed user emails in booking API responses: - Test host displayEmail returns email without CUID suffix - Test attendee displayEmail returns email without CUID suffix - Test bookingFieldsResponses.displayEmail returns clean email - Test displayGuests array returns emails without CUID suffix * false positive breaking change * false positive breaking change * test(api): update existing e2e tests to expect displayEmail field * fix(api): add missing displayEmail to seated booking test assertions The seated booking tests were missing displayEmail in the attendee assertions for the second booking test and cancel-as-host test, causing CI test failures --------- Co-authored-by: cal.com <morgan@cal.com> Co-authored-by: Morgan <33722304+ThyMinimalDev@users.noreply.github.com>
1.0 MiB
1.0 MiB