feat: Refactor RR logic to exclude the Salesforce bookings#21861
feat: Refactor RR logic to exclude the Salesforce bookings#21861JagjeevanAK wants to merge 19 commits intocalcom:mainfrom JagjeevanAK:JagjeevanAK/RR-refactor
Conversation
Signed-off-by: Jagjeevan Kashid <jagjeevandev97@gmail.com>
Signed-off-by: Jagjeevan Kashid <jagjeevandev97@gmail.com>
|
@JagjeevanAK is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (06/17/25)1 reviewer was added to this PR based on Keith Williams's automation. "Add community label" took an action on this PR • (06/17/25)1 label was added to this PR based on Keith Williams's automation. |
There was a problem hiding this comment.
cubic reviewed 8 files and found no issues. Review PR in cubic.dev.
Signed-off-by: Jagjeevan Kashid <jagjeevandev97@gmail.com>
Signed-off-by: Jagjeevan Kashid <jagjeevandev97@gmail.com>
Signed-off-by: Jagjeevan Kashid <jagjeevandev97@gmail.com>
Signed-off-by: Jagjeevan Kashid <jagjeevandev97@gmail.com>
Signed-off-by: Jagjeevan Kashid <jagjeevandev97@gmail.com>
|
Ready to merge. |
|
Hey @keithwillcode, can you take look at it ? and suggest a review ? |
|
Hi @JagjeevanAK, thank you for opening this PR 🙏 Could we show this setting in the event type's Salesforce settings instead? |
|
Hey @CarinaWolli does that mean we need to create a different tab like |
|
hey @CarinaWolli I have updated the PR according to your suggestions can you check it ? |
Signed-off-by: Jagjeevan Kashid <jagjeevandev97@gmail.com>
|
@Udit-takkar can you just review this PR ? |
|
hey @Devanshusharma2005 can you look into this PR as well ? |
|
@kart1ka @CarinaWolli any update on this PR? |
WalkthroughA new feature is introduced to optionally exclude Salesforce-assigned bookings from round robin calculations. This includes database schema changes, backend logic updates, a new UI toggle, localization additions, and corresponding test coverage. The change is controlled by a new boolean property, Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UI
participant Backend
participant DB
User->>UI: Toggles "Exclude Salesforce bookings from round robin"
UI->>Backend: Save updated EventType with excludeSalesforceBookingsFromRR
Backend->>DB: Update EventType.excludeSalesforceBookingsFromRR
User->>UI: Triggers round robin booking
UI->>Backend: Request round robin assignment
Backend->>DB: Fetch EventType.excludeSalesforceBookingsFromRR
Backend->>DB: Query bookings (exclude Salesforce if flag is true)
Backend->>UI: Return assigned user
Assessment against linked issues
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
packages/app-store/salesforce/components/EventTypeAppCardInterface.tsxOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "eslint-plugin-playwright". (The package "eslint-plugin-playwright" was not found when loaded as a Node module from the directory "".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following: The plugin "eslint-plugin-playwright" was referenced from the config file in ".eslintrc.js". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. packages/app-store/salesforce/zod.tsOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "eslint-plugin-playwright". (The package "eslint-plugin-playwright" was not found when loaded as a Node module from the directory "".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following: The plugin "eslint-plugin-playwright" was referenced from the config file in ".eslintrc.js". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. packages/features/eventtypes/components/tabs/assignment/EventTeamAssignmentTab.tsxOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "eslint-plugin-playwright". (The package "eslint-plugin-playwright" was not found when loaded as a Node module from the directory "".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following: The plugin "eslint-plugin-playwright" was referenced from the config file in ".eslintrc.js". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (12)
🧰 Additional context used🧠 Learnings (1)packages/lib/server/locales/en/common.json (1)undefined <retrieved_learning> 🧬 Code Graph Analysis (2)packages/app-store/salesforce/components/EventTypeAppCardInterface.tsx (2)
packages/lib/server/getLuckyUser.test.ts (3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (21)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
@JagjeevanAK Can you please resolve the merge conflicts? There also seems to be a test failing, can you fix that as well? |
|
Closing this PR due to merge conflicts, failing tests and inactivity. You’re welcome to reopen if you plan to continue. |
|
Hey I will solve the Merge conflicts and failing tests issue |
Signed-off-by: Jagjeevan Kashid jagjeevandev97@gmail.com
What does this PR do?
This PR implements a new setting for event types that allows users to exclude Salesforce-assigned bookings from Round Robin calculations. When enabled, only bookings assigned via Round Robin logic will count towards the RR distribution, while bookings assigned due to Salesforce ownership will not affect the balance.
Image Demo:
I have not added image as I don't have salseforce ID
Settings UI:
Behavior:
Key Changes Made
Testing Updates
packages/lib/server/getLuckyUser.test.ts: Updated tests to mock Salesforce app data usingvi.spyOn(EventTypeService, 'getEventTypeAppDataFromId')apps/web/test/lib/handleChildrenEventTypes.test.ts: Cleaned up by removing deprecated field from all test mocksTest Steps:
Test 1: Default Behavior (Setting Disabled)
Test 2: New Behavior (Setting Enabled)
Test 3: Backend Verification
excludeSalesforceBookingsFromRRflag is derived from Salesforce app metadataExpected Results:
false(maintains existing behavior)Checklist
Summary by cubic
REFACTORED the backend to read Salesforce booking exclusion setting from app data instead of EventType property, ensuring consistency between frontend and backend data sources.
getLuckyUser.tsto fetch setting from Salesforce app metadataSummary by CodeRabbit
New Features
Bug Fixes
Tests
Style
Chores