-
Notifications
You must be signed in to change notification settings - Fork 11.7k
feat: managed event reassignment #24809
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 15 files (reviewed changes from recent commits).
Prompt for AI agents (all 1 issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="packages/features/ee/managed-event-types/reassignment/utils/buildNewBookingPlan.ts">
<violation number="1" location="packages/features/ee/managed-event-types/reassignment/utils/buildNewBookingPlan.ts:26">
JSDoc claims this is a "pure function" but it uses `Date.now()` on line 53, making it non-deterministic. Consider updating the comment to remove the "pure function" claim, or document that the UID generation is intentionally unique per call.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
| /** | ||
| * Builds the new booking plan for a reassigned booking | ||
| * | ||
| * This is a pure function that constructs the booking data structure needed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JSDoc claims this is a "pure function" but it uses Date.now() on line 53, making it non-deterministic. Consider updating the comment to remove the "pure function" claim, or document that the UID generation is intentionally unique per call.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/features/ee/managed-event-types/reassignment/utils/buildNewBookingPlan.ts, line 26:
<comment>JSDoc claims this is a "pure function" but it uses `Date.now()` on line 53, making it non-deterministic. Consider updating the comment to remove the "pure function" claim, or document that the UID generation is intentionally unique per call.</comment>
<file context>
@@ -0,0 +1,103 @@
+/**
+ * Builds the new booking plan for a reassigned booking
+ *
+ * This is a pure function that constructs the booking data structure needed
+ * for the reassignment transaction. It generates a new UID, computes the booking
+ * title, and assembles all fields from the original booking.
</file context>
✅ Addressed in 0d46dab
|
|
||
| export const OrganizerReassignedEmail = (props: React.ComponentProps<typeof OrganizerScheduledEmail>) => { | ||
| const t = props.teamMember?.language.translate || props.calEvent.organizer.language.translate; | ||
| const isRoundRobin = props.calEvent.schedulingType === SchedulingType.ROUND_ROBIN; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still not working for me
packages/features/ee/managed-event-types/reassignment/managedEventManualReassignment.ts
Show resolved
Hide resolved
packages/features/ee/managed-event-types/reassignment/managedEventReassignment.ts
Show resolved
Hide resolved
packages/features/ee/managed-event-types/reassignment/managedEventReassignment.ts
Show resolved
Hide resolved
...atures/ee/managed-event-types/reassignment/services/ManagedEventManualReassignmentService.ts
Outdated
Show resolved
Hide resolved
...atures/ee/managed-event-types/reassignment/services/ManagedEventManualReassignmentService.ts
Outdated
Show resolved
Hide resolved
...ges/features/ee/managed-event-types/reassignment/services/ManagedEventReassignmentService.ts
Outdated
Show resolved
Hide resolved
...ges/features/ee/managed-event-types/reassignment/services/ManagedEventReassignmentService.ts
Outdated
Show resolved
Hide resolved
...features/ee/managed-event-types/reassignment/services/ManagedEventWorkflowReminderService.ts
Outdated
Show resolved
Hide resolved
...features/ee/managed-event-types/reassignment/services/ManagedEventWorkflowReminderService.ts
Outdated
Show resolved
Hide resolved
ThyMinimalDev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What does this PR do?
This PR introduces full support for booking reassignment within Managed Events, enabling both manual and auto reassignment of bookings created under a parent + child event-type model.
Previously, reassignment logic existed only for Round Robin event types (where bookings reference a single event type with multiple hosts). Managed Events differ in that each booking belongs to a child event type (one per user), so reassignment requires cancelling the old booking and creating a new one with the new host.
Adds two new routes: managedEventManualReassign (explicit user choice) and managedEventReassign (auto-select available user)
Core logic ensures:
ReassignDialog.tsxdetect managed context and show child-user list, availability indicatorsHere’s a polished, reviewer-friendly PR description for Cal.com’s PR #24809 — “feat: managed event reassignment”. It’s structured so that anyone reading it (even without context) can quickly understand what changed, why it matters, and how to test / validate it. Feel free to copy-paste and adapt as needed (or paste into a GitHub PR template).
Core changes & functionality
New backend endpoints
managedEventManualReassign— explicitly reassign a booking to a chosen user.managedEventReassign— automatically pick an available user (fallback / auto-assign).getManagedEventUsersToReassign— lists eligible users (with availability), supports pagination.Transactional reassignment logic
iCalUID, incrementsiCalSequence, sets new idempotencyKey.Frontend / UI updates
ReassignDialog.tsxfor managed events that shows: paginated eligible users, availability status, and manual / auto options.Full test coverage
Performance / no new scale risk
🚧 Notes & Follow-ups
BOOKING_REASSIGNEDwebhook trigger to allow external systems to respond to reassignment (out of scope for this PR).📝 Checklist (completed / for reviewers)
👇 TL;DR
This PR adds fully-functional managed-event reassignment — manual or automatic — without breaking existing booking flows, preserving data integrity, availability constraints, audit history, and notifications.
Visual Demo (For contributors especially)
A visual demonstration is strongly recommended, for both the original and new change (video / image - any one).
Video Demo (if applicable):
Loom
Image Demo (if applicable):
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Checklist
Summary by cubic
Adds managed event reassignment so bookings on managed event types can be reassigned automatically to the best available user or manually to a specific teammate. Updates the UI and APIs while keeping round-robin behavior unchanged for non-managed events.
New Features
Bug Fixes
Written for commit 46f5302. Summary will update automatically on new commits.