Skip to content

Conversation

@hariombalhara
Copy link
Member

What does this PR do?

This PR adds context parameter support to the bulk booking audit methods (onBulkBookingsCreated and onBulkBookingsRescheduled) and threads impersonation context through the booking flow in RegularBookingService, RecurringBookingService, and handleSeats.

This ensures that when bookings are created or rescheduled via impersonation, the audit logs will capture who performed the impersonation.

Changes:

  • Add context?: BookingAuditContext parameter to queueBulkCreatedAudit and queueBulkRescheduledAudit in the interface
  • Add context parameter to BookingAuditTaskerProducerService implementation
  • Add context parameter to onBulkBookingsCreated and onBulkBookingsRescheduled in BookingEventHandlerService
  • Update RegularBookingService.fireBookingEvents to accept and pass impersonatedByUserUuid
  • Update RecurringBookingService.fireBookingEvents to accept and pass impersonatedByUserUuid
  • Update handleSeats to accept and pass impersonatedByUserUuid

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.

How should this be tested?

  1. Create a booking while impersonating another user
  2. Check the audit logs to verify the impersonatedBy field is populated with the impersonator's UUID
  3. Create a recurring booking while impersonating another user
  4. Verify the bulk audit logs also capture the impersonation context
  5. Test seat bookings with impersonation to ensure context is passed through handleSeats

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have checked if my changes generate no new warnings

Link to Devin run: https://app.devin.ai/sessions/a3815ac7a0d340959788039cd98e8e2d
Requested by: @hariombalhara

…upport

- Add context parameter to queueBulkCreatedAudit and queueBulkRescheduledAudit in BookingAuditProducerService interface
- Add context parameter to BookingAuditTaskerProducerService implementation
- Add context parameter to onBulkBookingsCreated and onBulkBookingsRescheduled in BookingEventHandlerService
- Update RegularBookingService.fireBookingEvents to accept and pass impersonation context
- Update RecurringBookingService.fireBookingEvents to accept and pass impersonation context
- Update handleSeats to accept and pass impersonation context

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

@hariombalhara hariombalhara changed the base branch from main to integrate-booking-creation-reschedule-audit January 7, 2026 14:42
@vercel
Copy link

vercel bot commented Jan 7, 2026

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

Project Deployment Review Updated (UTC)
cal-com-v2-1767797589266-uOAD Canceled Canceled Jan 7, 2026 2:53pm
cal-com-v2-5dan Canceled Canceled Jan 7, 2026 2:53pm
1 Skipped Deployment
Project Deployment Review Updated (UTC)
cal-companion Ignored Ignored Jan 7, 2026 2:53pm

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants