Skip to content

Conversation

@hariombalhara
Copy link
Member

@hariombalhara hariombalhara commented Jan 7, 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 #26046 (booking creation/rescheduling audit) and PR #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)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. N/A - no documentation changes needed.
  • 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

  • My code follows the style guidelines of this project
  • 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

Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

…value

Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
@pull-request-size pull-request-size bot added size/S and removed size/M labels Jan 7, 2026
@vercel
Copy link

vercel bot commented Jan 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

4 Skipped Deployments
Project Deployment Review Updated (UTC)
api-v2 Ignored Ignored Preview Jan 10, 2026 8:06pm
cal Ignored Ignored Jan 10, 2026 8:06pm
cal-companion Ignored Ignored Preview Jan 10, 2026 8:06pm
cal-eu Ignored Ignored Jan 10, 2026 8:06pm

…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.
@pull-request-size pull-request-size bot added size/L and removed size/S labels Jan 8, 2026
@hariombalhara hariombalhara marked this pull request as ready for review January 8, 2026 10:44
@graphite-app graphite-app bot added core area: core, team members only enterprise area: enterprise, audit log, organisation, SAML, SSO labels Jan 8, 2026
@graphite-app graphite-app bot requested a review from a team January 8, 2026 10:45
Comment on lines +18 to 20
rescheduleReason: z.string().nullable(),
rescheduledRequestedBy: z.string().nullable(),
});
Copy link
Member Author

@hariombalhara hariombalhara Jan 8, 2026

Choose a reason for hiding this comment

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

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.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

E2E results are ready!

…ompatibility

Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
Copy link
Member Author

hariombalhara commented Jan 9, 2026

Merge activity

  • Jan 9, 8:32 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jan 9, 8:33 AM UTC: @hariombalhara merged this pull request with Graphite.

@hariombalhara hariombalhara merged commit f3a3788 into main Jan 9, 2026
44 of 45 checks passed
@hariombalhara hariombalhara deleted the devin/reschedule-request-audit-1767769845 branch January 9, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core area: core, team members only enterprise area: enterprise, audit log, organisation, SAML, SSO ready-for-e2e size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants