feat(minimum-cancellation-notice): add minimum cancellation/reschedule notice for bookings (#15647) #23852
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR implements a Minimum Cancellation Notice feature that allows event organizers to set a minimum time period before which attendees cannot cancel or reschedule
bookings.
Key Features:
Adds a
minimumCancellationNotice
field to event types (default: 0 minutes)Prevents cancellations and reschedules within the specified notice period
Shows clear error messages to users attempting to cancel/reschedule within the restricted period
Fully configurable through the Event Type Limits tab
Fixes Add a field to Cal.com to limit time people can cancel/reschedule a meeting. #15647 (GitHub issue number)
Visual Demo (For contributors especially)
Image Demo:
1. Event Type Configuration
The new "Minimum cancellation notice" field in the Event Type Limits tab:
![Configuration UI - To be added]
2. Cancellation Blocked
Error message when trying to cancel within the minimum notice period:
![Cancellation Error - To be added]
3. Reschedule Blocked
Error message when trying to reschedule within the minimum notice period:
![Reschedule Error - To be added]
Mandatory Tasks (DO NOT REMOVE)
docs/developing/guides/event-types/minimum-cancellation-notice.mdx
How should this be tested?
Environment Setup
yarn dx
yarn db-migrate
Test Scenarios
Configure Minimum Notice Period
Test Cancellation Prevention
Test Reschedule Prevention
Automated Tests
yarn test minimumCancellationNotice
yarn playwright test cancellation-validation.e2e.ts
Expected Behavior
Checklist
Additional Notes
Testing Challenges
Despite numerous attempts, I was unable to run the e2e tests locally due to extremely slow Next.js compilation times (30-40+ minutes). I've tried various configurations
including:
yarn dx
environmentThe tests consistently timeout. Is there a staging server or alternative testing environment available for contributors?
Implementation Details
minimumCancellationNotice
field (integer, minutes, default: 0)handleCancelBooking
andrequestReschedule
handlers