chore: Integrate reschedule request booking audit#26527
Merged
hariombalhara merged 8 commits intomainfrom Jan 9, 2026
Merged
Conversation
Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
Contributor
🤖 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:
|
…value Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
…est-audit-1767769845
…est-audit-1767769845
…ld names and improve type definitions - Changed field names in the schema from `cancellationReason` and `cancelledBy` to `rescheduleReason` and `rescheduledRequestedBy`. - Updated the `getDisplayJson` method to reflect the new field names. - Added type imports for `ActionSource` in relevant files to enhance type safety. - Modified `requestRescheduleHandler` to accept and utilize the `source` parameter for audit logging.
hariombalhara
commented
Jan 8, 2026
Comment on lines
+18
to
20
| rescheduleReason: z.string().nullable(), | ||
| rescheduledRequestedBy: z.string().nullable(), | ||
| }); |
Member
Author
There was a problem hiding this comment.
Old values aren't applicable here too as request rescheudle can happe only once for a booking
Also, rescheduled property isn't needed because we know it is a rescheudle.
Contributor
E2E results are ready! |
…ompatibility Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
Udit-takkar
approved these changes
Jan 9, 2026
Member
Author
Merge activity
|
Anshumancanrock
pushed a commit
to Anshumancanrock/cal.com
that referenced
this pull request
Jan 12, 2026
## What does this PR do? Adds audit logging for the reschedule request flow. When an organizer requests an attendee to reschedule a booking, this action is now logged to the booking audit system. This is part of the booking audit integration effort, following the pattern established in PR calcom#26046 (booking creation/rescheduling audit) and PR calcom#26458 (cancellation audit). ## Changes - Added audit logging call to `requestReschedule.handler.ts` using `BookingEventHandlerService.onRescheduleRequested()` - Captures audit data: - `rescheduleReason`: The reason provided for requesting the reschedule (nullable string) - `rescheduledRequestedBy`: Email of the user who requested the reschedule - Uses `makeUserActor(user.uuid)` to identify the actor performing the action - Added required `source` parameter for action source tracking (passed as `"WEBAPP"` from tRPC router) - Updated `RescheduleRequestedAuditActionService` schema to use simpler field structure - Updated test helper `getTrpcHandlerData` to pass `source: "WEBAPP"` parameter ## Updates since last revision - Changed `source` parameter from optional with default to required - tests now explicitly pass `source: "WEBAPP"` instead of relying on a default value ## Mandatory Tasks (DO NOT REMOVE) - [x] I have self-reviewed the code (A decent size PR without self-review might be rejected). - [x] I have updated the developer docs in /docs if this PR makes changes that would require a [documentation change](https://cal.com/docs). N/A - no documentation changes needed. - [x] I confirm automated tests are in place that prove my fix is effective or that my feature works. N/A - follows established audit pattern with existing infrastructure tests. ## How should this be tested? 1. Log in as a user with a booking 2. Navigate to the booking and click "Request Reschedule" 3. Provide a reschedule reason and submit 4. Verify the audit log is created with the correct data (requires access to audit log storage/database) The audit logging follows the same pattern as other booking audit integrations, so if those are working, this should work as well. ## Checklist - [x] My code follows the style guidelines of this project - [x] I have checked if my changes generate no new warnings --- **Link to Devin run**: https://app.devin.ai/sessions/ae84d093c4594a5d89b88c45639a6a06 **Requested by**: @hariombalhara ## Human Review Checklist - [ ] Verify the audit data schema matches `RescheduleRequestedAuditActionService` expectations (fields: `rescheduleReason`, `rescheduledRequestedBy`) - [ ] Confirm the schema change from change-based fields (`{ old, new }`) to simple nullable strings is intentional - [ ] Confirm `user.uuid` is available in the tRPC session context - [ ] Note: API v2 does not have a reschedule request endpoint, so no API v2 changes are needed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?
Adds audit logging for the reschedule request flow. When an organizer requests an attendee to reschedule a booking, this action is now logged to the booking audit system.
This is part of the booking audit integration effort, following the pattern established in PR #26046 (booking creation/rescheduling audit) and PR #26458 (cancellation audit).
Changes
requestReschedule.handler.tsusingBookingEventHandlerService.onRescheduleRequested()rescheduleReason: The reason provided for requesting the reschedule (nullable string)rescheduledRequestedBy: Email of the user who requested the reschedulemakeUserActor(user.uuid)to identify the actor performing the actionsourceparameter for action source tracking (passed as"WEBAPP"from tRPC router)RescheduleRequestedAuditActionServiceschema to use simpler field structuregetTrpcHandlerDatato passsource: "WEBAPP"parameterUpdates since last revision
sourceparameter from optional with default to required - tests now explicitly passsource: "WEBAPP"instead of relying on a default valueMandatory Tasks (DO NOT REMOVE)
How should this be tested?
The audit logging follows the same pattern as other booking audit integrations, so if those are working, this should work as well.
Checklist
Link to Devin run: https://app.devin.ai/sessions/ae84d093c4594a5d89b88c45639a6a06
Requested by: @hariombalhara
Human Review Checklist
RescheduleRequestedAuditActionServiceexpectations (fields:rescheduleReason,rescheduledRequestedBy){ old, new }) to simple nullable strings is intentionaluser.uuidis available in the tRPC session context