Skip to content

feat: enhance CreatedAuditActionService with Salesforce app data for Team Round Robin events#26012

Closed
hariombalhara wants to merge 1 commit intobooking-audit-more-infrafrom
devin/salesforce-audit-data-1766045516
Closed

feat: enhance CreatedAuditActionService with Salesforce app data for Team Round Robin events#26012
hariombalhara wants to merge 1 commit intobooking-audit-more-infrafrom
devin/salesforce-audit-data-1766045516

Conversation

@hariombalhara
Copy link
Member

What does this PR do?

Enhances the booking audit system to capture Salesforce CRM data during booking creation, specifically for Team Round Robin events. This builds on PR #25125 (booking-audit-more-infra).

Changes:

  • Adds Salesforce audit data schema to CreatedAuditActionService to track lead/contact creation and field writes
  • Creates extractSalesforceAuditData helper to extract Salesforce data from EventManager results
  • Modifies Salesforce CRM service to capture and return fields written to event records and lead/contact records
  • Updates RegularBookingService to pass extracted Salesforce data to the audit system

Data captured:

  • Lead/Contact record ID and type when created
  • Fields written to the Salesforce Event record with their values
  • Fields written to the Lead/Contact record with their values

Link to Devin run: https://app.devin.ai/sessions/2b352c202412416d95ac10c6202178d2
Requested by: hariom@cal.com (@hariombalhara)

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 changes only.
  • 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 Team Round Robin event type with Salesforce integration configured
  2. Configure Salesforce app options to write to event records and/or lead/contact records on booking
  3. Create a booking for the event type
  4. Check the booking audit log to verify Salesforce data is captured:
    • apps.salesforce.leadOrContactCreated should contain the contact/lead ID and type
    • apps.salesforce.eventRecordFields should contain fields written to the SF Event
    • apps.salesforce.leadOrContactFields should contain fields written to the lead/contact

Environment variables needed:

  • Salesforce app credentials configured

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

Items for Human Review

  • Verify writeToRecordAndReturnFields correctly mirrors writeToRecord behavior (CrmService.ts lines 1099-1168)
  • Confirm no other callers of salesforceCreateEvent exist that might be affected by the return type change
  • Consider whether createdRecord should be populated when new leads/contacts are created (currently only captures existing contacts)
  • Unit tests for extractSalesforceAuditData helper function are not included

…Team Round Robin events

- Add Salesforce audit data schema to track lead/contact creation, event record fields, and lead/contact fields
- Create extractSalesforceAuditData helper function to extract Salesforce data from EventManager results
- Update Salesforce CRM service to capture and return audit data (eventRecordFields, leadOrContactFields)
- Update RegularBookingService to pass Salesforce data to audit system
- Export SalesforceAuditData and AppsAuditData types for external use

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

@vercel
Copy link

vercel bot commented Dec 18, 2025

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

Project Deployment Review Updated (UTC)
cal-companion Ready Ready Preview, Comment Dec 18, 2025 8:23am

@github-actions
Copy link
Contributor

This PR has been marked as stale due to inactivity. If you're still working on it or need any help, please let us know or update the PR to keep it active.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant