Skip to content

Conversation

@hariombalhara
Copy link
Member

@hariombalhara hariombalhara commented Jan 8, 2026

What does this PR do?

Adds audit logging for the "add guests" booking operation. This is PR-4 in the booking audit integration series, following the pattern established in PR #26046.

Changes:

  • Integrates BookingEventHandlerService.onAttendeeAdded() to log when guests are added to a booking
  • Captures old and new attendee email lists for the audit trail
  • Uses makeUserActor(user.uuid) to identify who performed the action
  • Extended TUser type to include uuid field required for actor creation
  • Added actionSource parameter to support different sources (WEBAPP vs API_V2)
  • API v2 booking-guests.service.ts now passes actionSource: "API_V2" for proper source tracking

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 - internal audit logging only.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works. N/A - follows existing audit logging patterns with existing test coverage.

How should this be tested?

Web App:

  1. Add guests to an existing booking via the web app
  2. Verify the audit log entry is created with:
    • action: "ATTENDEE_ADDED"
    • source: "WEBAPP"
    • auditData.attendees.old containing previous attendee emails
    • auditData.attendees.new containing all attendee emails after addition

API v2:

  1. Add guests to an existing booking via the API v2 endpoint
  2. Verify the audit log entry is created with:
    • action: "ATTENDEE_ADDED"
    • source: "API_V2"
    • Same audit data structure as above

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/ae84d093c4594a5d89b88c45639a6a06
Requested by: @hariombalhara

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

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

vercel bot commented Jan 8, 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 8, 2026 6:34pm
cal Ignored Ignored Jan 8, 2026 6:34pm
cal-companion Ignored Ignored Preview Jan 8, 2026 6:34pm
cal-eu Ignored Ignored Jan 8, 2026 6:34pm

- Modified the `AttendeeAddedAuditActionService` to replace the old attendees schema with a new `emailSchema` for better validation.
- Adjusted the `addGuestsHandler` to pass the action source explicitly and updated the audit logging to reflect the new structure.
- Cleaned up the code for better readability and consistency.
@pull-request-size pull-request-size bot added size/L and removed size/M labels Jan 8, 2026
@hariombalhara hariombalhara marked this pull request as ready for review January 8, 2026 12:34
@hariombalhara hariombalhara requested a review from a team as a code owner January 8, 2026 12:34
@graphite-app graphite-app bot added enterprise area: enterprise, audit log, organisation, SAML, SSO core area: core, team members only labels Jan 8, 2026
@graphite-app graphite-app bot requested a review from a team January 8, 2026 12:35
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 4 files

Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
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.

2 participants