Skip to content

Add guest management functionality to existing bookings#9

Draft
ShashankFC wants to merge 1 commit into
guest-management-basefrom
guest-management-enhanced
Draft

Add guest management functionality to existing bookings#9
ShashankFC wants to merge 1 commit into
guest-management-basefrom
guest-management-enhanced

Conversation

@ShashankFC

Copy link
Copy Markdown
Collaborator

Test 10nn---nReplicated from ai-code-review-evaluation/cal.com-cursor#10

* feat: ability to add guests via app.cal.com/bookings

* fix: some update

* fix: minor issue

* fix: final update

* update

* update

* add requested changes

* fix type error

* small update

* final update

* fix type error

* fix location

* update calender event

---------

Co-authored-by: Somay Chauhan <somaychauhan98@gmail.com>
@GitHoobar

Copy link
Copy Markdown

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: baa9045af7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +46 to +48
const isTeamAdminOrOwner =
(await isTeamAdmin(user.id, booking.eventType?.teamId ?? 0)) &&
(await isTeamOwner(user.id, booking.eventType?.teamId ?? 0));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Allow team admins or owners to add guests

The permission gate sets isTeamAdminOrOwner using isTeamAdmin && isTeamOwner, which requires a user to be both roles. For team bookings this will block legitimate admins who are not owners (and owners who are not admins) from adding guests, even though they should have the right to manage attendees. This is introduced here and can be fixed by using an OR check or the appropriate existing helper for admin/owner access.

Useful? React with 👍 / 👎.

Comment on lines +167 to +168
try {
await sendAddGuestsEmails(evt, guests);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid sending “new guest” emails to existing attendees

The handler computes uniqueGuests (new, non-blacklisted emails) but passes the original guests array into sendAddGuestsEmails. That email helper treats any address in newGuests as a newly added attendee, so if a caller includes an existing attendee email alongside new ones, the existing attendee will be sent the scheduled/new-attendee email instead of the “guests added” notification. Passing uniqueGuests (or filtering before calling) prevents this misclassification.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants