Skip to content

Comments

refactor: rename eventType files to eventTypeRepository and eventTypeService#22670

Merged
emrysal merged 2 commits intomainfrom
devin/rename-event-type-files-1753174089
Jul 22, 2025
Merged

refactor: rename eventType files to eventTypeRepository and eventTypeService#22670
emrysal merged 2 commits intomainfrom
devin/rename-event-type-files-1753174089

Conversation

@eunjae-lee
Copy link
Contributor

refactor: rename eventType files to eventTypeRepository and eventTypeService

Summary

This PR renames two TypeScript files to follow more descriptive naming conventions:

  • packages/lib/server/repository/eventType.tseventTypeRepository.ts
  • packages/lib/server/service/eventType.tseventTypeService.ts

All import statements across the codebase (18 files) have been updated to reference the new file paths. The exports (EventTypeRepository and EventTypeService classes) remain unchanged - only the file paths were modified.

Review & Testing Checklist for Human

  • Search for missed imports: Run git grep -r "server/repository/eventType\|server/service/eventType" to verify no old import paths remain
  • Run full test suite: Execute TZ=UTC yarn test to ensure no tests are broken by the file renames
  • Test event type functionality: Create, edit, and delete an event type to verify core functionality works end-to-end
  • Verify complete CI passage: Ensure all CI checks pass, including E2E tests if they run

Diagram

%%{ init : { "theme" : "default" }}%%
graph TD
    %% Renamed files
    EventTypeRepo["packages/lib/server/repository/<br/>eventTypeRepository.ts"]:::major-edit
    EventTypeService["packages/lib/server/service/<br/>eventTypeService.ts"]:::major-edit
    
    %% Key importers
    PlatformLibs["packages/platform/libraries/<br/>repositories.ts"]:::minor-edit
    TRPCCreate["packages/trpc/server/routers/viewer/<br/>eventTypes/create.handler.ts"]:::minor-edit
    TRPCDupe["packages/trpc/server/routers/viewer/<br/>eventTypes/duplicate.handler.ts"]:::minor-edit
    VideoProps["apps/web/lib/video/[uid]/<br/>getServerSideProps.ts"]:::minor-edit
    RoutingForms["packages/app-store/routing-forms/<br/>lib/crmRouting/..."]:::minor-edit
    SalesforceHandler["packages/app-store/salesforce/<br/>lib/routingFormBookingFormHandler.ts"]:::minor-edit
    
    %% Dependencies
    EventTypeRepo --> PlatformLibs
    EventTypeRepo --> TRPCCreate  
    EventTypeRepo --> TRPCDupe
    EventTypeRepo --> VideoProps
    EventTypeRepo --> RoutingForms
    EventTypeService --> SalesforceHandler
    
    subgraph Legend
        L1[Major Edit]:::major-edit
        L2[Minor Edit]:::minor-edit  
        L3[Context/No Edit]:::context
    end
    
    classDef major-edit fill:#90EE90
    classDef minor-edit fill:#87CEEB
    classDef context fill:#FFFFFF
Loading

Notes

  • This is a mechanical refactoring with no functional changes
  • TypeScript compilation (yarn type-check:ci) passes successfully
  • The lint-staged process ran during commit and applied formatting fixes
  • 20 files total were modified (2 renames + 18 import updates)

Link to Devin run: https://app.devin.ai/sessions/4d8ed432958b4d3ea36b36e68eaa2c1b
Requested by: @eunjae-lee

…Service

- Rename packages/lib/server/repository/eventType.ts to eventTypeRepository.ts
- Rename packages/lib/server/service/eventType.ts to eventTypeService.ts
- Update all import statements across the codebase to use new filenames
- No functional changes, only file path updates

Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
@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'.
  • 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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 22, 2025

Walkthrough

This change updates import statements across multiple files in the codebase to reference a new module path for the EventTypeRepository and EventTypeService. The import source is switched from "@calcom/lib/server/repository/eventType" to "@calcom/lib/server/repository/eventTypeRepository" (and similarly for EventTypeService). No other code, logic, or exported/public entity declarations are modified in any of the affected files. The changes are limited strictly to the import paths.

Estimated code review effort

1 (~2 minutes)

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

apps/web/lib/video/[uid]/getServerSideProps.ts

Oops! 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:

npm install eslint-plugin-playwright@latest --save-dev

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/routing-forms/lib/crmRouting/routerGetCrmContactOwnerEmail.ts

Oops! 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:

npm install eslint-plugin-playwright@latest --save-dev

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/lib/routingFormBookingFormHandler.ts

Oops! 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:

npm install eslint-plugin-playwright@latest --save-dev

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.

  • 15 others
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@keithwillcode keithwillcode added consumer core area: core, team members only labels Jul 22, 2025
@delve-auditor
Copy link

delve-auditor bot commented Jul 22, 2025

No security or compliance issues detected. Reviewed everything up to e7360e1.

Security Overview
  • 🔎 Scanned files: 20 changed file(s)
Detected Code Changes
Change Type Relevant files
Refactor ► eventType.ts → eventTypeRepository.ts
    Rename repository file
► eventType.ts → eventTypeService.ts
    Rename service file
► Multiple files
    Update import paths to reflect new file names

Reply to this PR with @delve-auditor followed by a description of what change you want and we'll auto-submit a change to this PR to implement it.

@eunjae-lee eunjae-lee marked this pull request as ready for review July 22, 2025 09:08
@eunjae-lee eunjae-lee requested a review from a team as a code owner July 22, 2025 09:08
@eunjae-lee eunjae-lee requested a review from a team July 22, 2025 09:08
@graphite-app graphite-app bot requested a review from a team July 22, 2025 09:08
@graphite-app
Copy link

graphite-app bot commented Jul 22, 2025

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (07/22/25)

1 reviewer was added to this PR based on Keith Williams's automation.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (4)
packages/trpc/server/routers/viewer/eventTypes/getTeamAndEventTypeOptions.handler.ts (1)

2-2: Import path updated – looks good

No further issues spotted for this line.

packages/trpc/server/routers/viewer/slots/isAvailable.handler.ts (1)

5-5: Import path update acknowledged

Change is purely mechanical and correct.

packages/trpc/server/routers/viewer/eventTypes/duplicate.handler.ts (1)

5-5: Import path update acknowledged

Looks good.

packages/trpc/server/routers/viewer/slots/util.ts (1)

46-46: Import path update acknowledged

No issues found with the type-only import.

🧹 Nitpick comments (3)
packages/app-store/salesforce/lib/routingFormBookingFormHandler.ts (1)

2-2: Use path alias for consistency (optional).

The new relative import works, but elsewhere in the repo we standardize on the @calcom/... alias.
Switching to @calcom/lib/server/service/eventTypeService would keep the style uniform and avoid future breakage if this file is moved.

packages/trpc/server/routers/viewer/slots/util.ts (1)

670-675: Heavy Day.js usage in hot path – consider optimisation

getStartTime (and several other helpers) call dayjs/dayjs.utc() inside tight loops that run for every availability request. Day.js with timezone support is notably slow; native Date, numeric epoch comparisons, or pre-computed utc() objects can yield sizeable latency wins in slot-generation endpoints.

packages/lib/getConnectedDestinationCalendars.ts (1)

12-12: Prefer project-wide alias over relative path for uniformity

Most other modules now import the repository via the @calcom/lib/server/repository/eventTypeRepository alias instead of a relative path. Sticking to the alias keeps grepping simpler and avoids breakage if this file is ever moved.

-import { EventTypeRepository } from "./server/repository/eventTypeRepository";
+import { EventTypeRepository } from "@calcom/lib/server/repository/eventTypeRepository";
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cb78692 and a5c4773.

📒 Files selected for processing (18)
  • apps/web/lib/video/[uid]/getServerSideProps.ts (1 hunks)
  • packages/app-store/routing-forms/lib/crmRouting/routerGetCrmContactOwnerEmail.ts (1 hunks)
  • packages/app-store/salesforce/lib/routingFormBookingFormHandler.ts (1 hunks)
  • packages/features/credentials/deleteCredential.test.ts (1 hunks)
  • packages/lib/di/modules/eventType.ts (1 hunks)
  • packages/lib/event-types/getEventTypeById.ts (1 hunks)
  • packages/lib/event-types/getEventTypesByViewer.ts (1 hunks)
  • packages/lib/getConnectedDestinationCalendars.ts (1 hunks)
  • packages/lib/getUserAvailability.ts (1 hunks)
  • packages/platform/libraries/repositories.ts (1 hunks)
  • packages/trpc/server/routers/viewer/eventTypes/create.handler.ts (1 hunks)
  • packages/trpc/server/routers/viewer/eventTypes/duplicate.handler.ts (1 hunks)
  • packages/trpc/server/routers/viewer/eventTypes/getEventTypesFromGroup.handler.ts (1 hunks)
  • packages/trpc/server/routers/viewer/eventTypes/getTeamAndEventTypeOptions.handler.ts (1 hunks)
  • packages/trpc/server/routers/viewer/eventTypes/util.ts (1 hunks)
  • packages/trpc/server/routers/viewer/routing-forms/findTeamMembersMatchingAttributeLogicOfRoute.handler.ts (1 hunks)
  • packages/trpc/server/routers/viewer/slots/isAvailable.handler.ts (1 hunks)
  • packages/trpc/server/routers/viewer/slots/util.ts (1 hunks)
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/review.mdc)

Flag excessive Day.js use in performance-critical code. Functions like .add, .diff, .isBefore, and .isAfter are slow, especially in timezone mode. Prefer .utc() for better performance. Where possible, replace with native Date and direct .valueOf() comparisons for faster execution. Recommend using native methods or Day.js .utc() consistently in hot paths like loops.

Files:

  • packages/app-store/salesforce/lib/routingFormBookingFormHandler.ts
  • packages/trpc/server/routers/viewer/eventTypes/create.handler.ts
  • packages/app-store/routing-forms/lib/crmRouting/routerGetCrmContactOwnerEmail.ts
  • packages/lib/event-types/getEventTypeById.ts
  • apps/web/lib/video/[uid]/getServerSideProps.ts
  • packages/lib/di/modules/eventType.ts
  • packages/trpc/server/routers/viewer/eventTypes/getTeamAndEventTypeOptions.handler.ts
  • packages/trpc/server/routers/viewer/slots/util.ts
  • packages/features/credentials/deleteCredential.test.ts
  • packages/lib/getConnectedDestinationCalendars.ts
  • packages/trpc/server/routers/viewer/eventTypes/util.ts
  • packages/trpc/server/routers/viewer/eventTypes/getEventTypesFromGroup.handler.ts
  • packages/trpc/server/routers/viewer/routing-forms/findTeamMembersMatchingAttributeLogicOfRoute.handler.ts
  • packages/trpc/server/routers/viewer/slots/isAvailable.handler.ts
  • packages/lib/getUserAvailability.ts
  • packages/trpc/server/routers/viewer/eventTypes/duplicate.handler.ts
  • packages/lib/event-types/getEventTypesByViewer.ts
  • packages/platform/libraries/repositories.ts
🧠 Learnings (11)
packages/app-store/salesforce/lib/routingFormBookingFormHandler.ts (1)

Learnt from: eunjae-lee
PR: #22106
File: packages/features/insights/components/FailedBookingsByField.tsx:65-71
Timestamp: 2025-07-15T12:59:34.389Z
Learning: In the FailedBookingsByField component (packages/features/insights/components/FailedBookingsByField.tsx), although routingFormId is typed as optional in useInsightsParameters, the system automatically enforces a routing form filter, so routingFormId is always present in practice. This means the data always contains only one entry, making the single-entry destructuring approach safe.

packages/lib/event-types/getEventTypeById.ts (1)

Learnt from: vijayraghav-io
PR: #21072
File: packages/app-store/office365calendar/api/webhook.ts:120-123
Timestamp: 2025-07-18T17:57:16.395Z
Learning: The office365calendar webhook handler in packages/app-store/office365calendar/api/webhook.ts is specifically designed for Office365 calendar integration, not as a generic webhook handler. Therefore, it's safe to assume that fetchAvailabilityAndSetCache method will be implemented in the Office365CalendarService, making explicit validation checks unnecessary.

packages/trpc/server/routers/viewer/slots/util.ts (1)

Learnt from: eunjae-lee
PR: #22106
File: packages/features/insights/components/FailedBookingsByField.tsx:65-71
Timestamp: 2025-07-15T12:59:34.389Z
Learning: In the FailedBookingsByField component (packages/features/insights/components/FailedBookingsByField.tsx), although routingFormId is typed as optional in useInsightsParameters, the system automatically enforces a routing form filter, so routingFormId is always present in practice. This means the data always contains only one entry, making the single-entry destructuring approach safe.

packages/features/credentials/deleteCredential.test.ts (2)

Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to backend/**/*.{ts,tsx} : Make sure the credential.key field is never returned back from tRPC endpoints or APIs.

Learnt from: vijayraghav-io
PR: #21072
File: .env.example:354-357
Timestamp: 2025-07-18T08:49:18.779Z
Learning: For E2E integration tests that require real third-party service credentials (like Outlook calendar), it's acceptable to temporarily include actual test account credentials in .env.example during feature development and validation, provided there's a clear plan to replace them with placeholder values before final release. Test credentials should be for dedicated test tenants/accounts, not production systems.

packages/lib/getConnectedDestinationCalendars.ts (2)

Learnt from: vijayraghav-io
PR: #21072
File: packages/app-store/office365calendar/api/webhook.ts:120-123
Timestamp: 2025-07-18T17:57:16.395Z
Learning: The office365calendar webhook handler in packages/app-store/office365calendar/api/webhook.ts is specifically designed for Office365 calendar integration, not as a generic webhook handler. Therefore, it's safe to assume that fetchAvailabilityAndSetCache method will be implemented in the Office365CalendarService, making explicit validation checks unnecessary.

Learnt from: vijayraghav-io
PR: #21072
File: packages/prisma/schema.prisma:891-891
Timestamp: 2025-07-18T08:47:01.264Z
Learning: The Outlook Calendar integration in Cal.com intentionally reuses subscription IDs across multiple event types for efficiency. The upsertSelectedCalendarsForEventTypeIds method creates separate SelectedCalendar records for each eventTypeId, all sharing the same outlookSubscriptionId. This subscription sharing pattern means that unique constraints like @@unique([outlookSubscriptionId, eventTypeId]) should not be applied as they would prevent this intended functionality.

packages/trpc/server/routers/viewer/eventTypes/util.ts (1)

Learnt from: hariombalhara
PR: #22547
File: packages/embeds/embed-core/src/lib/eventHandlers/scrollByDistanceEventHandler.ts:11-14
Timestamp: 2025-07-16T11:46:28.759Z
Learning: In Cal.com's embed system, internal events like "__scrollByDistance" are fired by Cal.com's own code, so runtime validation of event data structure is unnecessary since TypeScript type system guarantees type safety for internal events.

packages/trpc/server/routers/viewer/eventTypes/getEventTypesFromGroup.handler.ts (2)

Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to backend/**/*.{ts,tsx} : For Prisma queries: Never use Includes - use select.

Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to backend/**/*.{ts,tsx} : For Prisma queries: Only select data you need.

packages/trpc/server/routers/viewer/routing-forms/findTeamMembersMatchingAttributeLogicOfRoute.handler.ts (3)

Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to backend/**/*.{ts,tsx} : For Prisma queries: Only select data you need.

Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to backend/**/*.{ts,tsx} : For Prisma queries: Never use Includes - use select.

Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to backend/**/*.{ts,tsx} : For Prisma queries: Select selects only the fields you specify explicitly.

packages/trpc/server/routers/viewer/slots/isAvailable.handler.ts (1)

Learnt from: vijayraghav-io
PR: #21072
File: packages/app-store/office365calendar/api/webhook.ts:120-123
Timestamp: 2025-07-18T17:57:16.395Z
Learning: The office365calendar webhook handler in packages/app-store/office365calendar/api/webhook.ts is specifically designed for Office365 calendar integration, not as a generic webhook handler. Therefore, it's safe to assume that fetchAvailabilityAndSetCache method will be implemented in the Office365CalendarService, making explicit validation checks unnecessary.

packages/lib/getUserAvailability.ts (1)

Learnt from: vijayraghav-io
PR: #21072
File: packages/app-store/office365calendar/api/webhook.ts:120-123
Timestamp: 2025-07-18T17:57:16.395Z
Learning: The office365calendar webhook handler in packages/app-store/office365calendar/api/webhook.ts is specifically designed for Office365 calendar integration, not as a generic webhook handler. Therefore, it's safe to assume that fetchAvailabilityAndSetCache method will be implemented in the Office365CalendarService, making explicit validation checks unnecessary.

packages/platform/libraries/repositories.ts (1)

Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to backend/**/*.{ts,tsx} : For Prisma queries: Select selects only the fields you specify explicitly.

🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/review.mdc)

Flag excessive Day.js use in performance-critical code. Functions like .add, .diff, .isBefore, and .isAfter are slow, especially in timezone mode. Prefer .utc() for better performance. Where possible, replace with native Date and direct .valueOf() comparisons for faster execution. Recommend using native methods or Day.js .utc() consistently in hot paths like loops.

Files:

  • packages/app-store/salesforce/lib/routingFormBookingFormHandler.ts
  • packages/trpc/server/routers/viewer/eventTypes/create.handler.ts
  • packages/app-store/routing-forms/lib/crmRouting/routerGetCrmContactOwnerEmail.ts
  • packages/lib/event-types/getEventTypeById.ts
  • apps/web/lib/video/[uid]/getServerSideProps.ts
  • packages/lib/di/modules/eventType.ts
  • packages/trpc/server/routers/viewer/eventTypes/getTeamAndEventTypeOptions.handler.ts
  • packages/trpc/server/routers/viewer/slots/util.ts
  • packages/features/credentials/deleteCredential.test.ts
  • packages/lib/getConnectedDestinationCalendars.ts
  • packages/trpc/server/routers/viewer/eventTypes/util.ts
  • packages/trpc/server/routers/viewer/eventTypes/getEventTypesFromGroup.handler.ts
  • packages/trpc/server/routers/viewer/routing-forms/findTeamMembersMatchingAttributeLogicOfRoute.handler.ts
  • packages/trpc/server/routers/viewer/slots/isAvailable.handler.ts
  • packages/lib/getUserAvailability.ts
  • packages/trpc/server/routers/viewer/eventTypes/duplicate.handler.ts
  • packages/lib/event-types/getEventTypesByViewer.ts
  • packages/platform/libraries/repositories.ts
🧠 Learnings (11)
packages/app-store/salesforce/lib/routingFormBookingFormHandler.ts (1)

Learnt from: eunjae-lee
PR: #22106
File: packages/features/insights/components/FailedBookingsByField.tsx:65-71
Timestamp: 2025-07-15T12:59:34.389Z
Learning: In the FailedBookingsByField component (packages/features/insights/components/FailedBookingsByField.tsx), although routingFormId is typed as optional in useInsightsParameters, the system automatically enforces a routing form filter, so routingFormId is always present in practice. This means the data always contains only one entry, making the single-entry destructuring approach safe.

packages/lib/event-types/getEventTypeById.ts (1)

Learnt from: vijayraghav-io
PR: #21072
File: packages/app-store/office365calendar/api/webhook.ts:120-123
Timestamp: 2025-07-18T17:57:16.395Z
Learning: The office365calendar webhook handler in packages/app-store/office365calendar/api/webhook.ts is specifically designed for Office365 calendar integration, not as a generic webhook handler. Therefore, it's safe to assume that fetchAvailabilityAndSetCache method will be implemented in the Office365CalendarService, making explicit validation checks unnecessary.

packages/trpc/server/routers/viewer/slots/util.ts (1)

Learnt from: eunjae-lee
PR: #22106
File: packages/features/insights/components/FailedBookingsByField.tsx:65-71
Timestamp: 2025-07-15T12:59:34.389Z
Learning: In the FailedBookingsByField component (packages/features/insights/components/FailedBookingsByField.tsx), although routingFormId is typed as optional in useInsightsParameters, the system automatically enforces a routing form filter, so routingFormId is always present in practice. This means the data always contains only one entry, making the single-entry destructuring approach safe.

packages/features/credentials/deleteCredential.test.ts (2)

Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to backend/**/*.{ts,tsx} : Make sure the credential.key field is never returned back from tRPC endpoints or APIs.

Learnt from: vijayraghav-io
PR: #21072
File: .env.example:354-357
Timestamp: 2025-07-18T08:49:18.779Z
Learning: For E2E integration tests that require real third-party service credentials (like Outlook calendar), it's acceptable to temporarily include actual test account credentials in .env.example during feature development and validation, provided there's a clear plan to replace them with placeholder values before final release. Test credentials should be for dedicated test tenants/accounts, not production systems.

packages/lib/getConnectedDestinationCalendars.ts (2)

Learnt from: vijayraghav-io
PR: #21072
File: packages/app-store/office365calendar/api/webhook.ts:120-123
Timestamp: 2025-07-18T17:57:16.395Z
Learning: The office365calendar webhook handler in packages/app-store/office365calendar/api/webhook.ts is specifically designed for Office365 calendar integration, not as a generic webhook handler. Therefore, it's safe to assume that fetchAvailabilityAndSetCache method will be implemented in the Office365CalendarService, making explicit validation checks unnecessary.

Learnt from: vijayraghav-io
PR: #21072
File: packages/prisma/schema.prisma:891-891
Timestamp: 2025-07-18T08:47:01.264Z
Learning: The Outlook Calendar integration in Cal.com intentionally reuses subscription IDs across multiple event types for efficiency. The upsertSelectedCalendarsForEventTypeIds method creates separate SelectedCalendar records for each eventTypeId, all sharing the same outlookSubscriptionId. This subscription sharing pattern means that unique constraints like @@unique([outlookSubscriptionId, eventTypeId]) should not be applied as they would prevent this intended functionality.

packages/trpc/server/routers/viewer/eventTypes/util.ts (1)

Learnt from: hariombalhara
PR: #22547
File: packages/embeds/embed-core/src/lib/eventHandlers/scrollByDistanceEventHandler.ts:11-14
Timestamp: 2025-07-16T11:46:28.759Z
Learning: In Cal.com's embed system, internal events like "__scrollByDistance" are fired by Cal.com's own code, so runtime validation of event data structure is unnecessary since TypeScript type system guarantees type safety for internal events.

packages/trpc/server/routers/viewer/eventTypes/getEventTypesFromGroup.handler.ts (2)

Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to backend/**/*.{ts,tsx} : For Prisma queries: Never use Includes - use select.

Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to backend/**/*.{ts,tsx} : For Prisma queries: Only select data you need.

packages/trpc/server/routers/viewer/routing-forms/findTeamMembersMatchingAttributeLogicOfRoute.handler.ts (3)

Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to backend/**/*.{ts,tsx} : For Prisma queries: Only select data you need.

Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to backend/**/*.{ts,tsx} : For Prisma queries: Never use Includes - use select.

Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to backend/**/*.{ts,tsx} : For Prisma queries: Select selects only the fields you specify explicitly.

packages/trpc/server/routers/viewer/slots/isAvailable.handler.ts (1)

Learnt from: vijayraghav-io
PR: #21072
File: packages/app-store/office365calendar/api/webhook.ts:120-123
Timestamp: 2025-07-18T17:57:16.395Z
Learning: The office365calendar webhook handler in packages/app-store/office365calendar/api/webhook.ts is specifically designed for Office365 calendar integration, not as a generic webhook handler. Therefore, it's safe to assume that fetchAvailabilityAndSetCache method will be implemented in the Office365CalendarService, making explicit validation checks unnecessary.

packages/lib/getUserAvailability.ts (1)

Learnt from: vijayraghav-io
PR: #21072
File: packages/app-store/office365calendar/api/webhook.ts:120-123
Timestamp: 2025-07-18T17:57:16.395Z
Learning: The office365calendar webhook handler in packages/app-store/office365calendar/api/webhook.ts is specifically designed for Office365 calendar integration, not as a generic webhook handler. Therefore, it's safe to assume that fetchAvailabilityAndSetCache method will be implemented in the Office365CalendarService, making explicit validation checks unnecessary.

packages/platform/libraries/repositories.ts (1)

Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-21T13:54:11.770Z
Learning: Applies to backend/**/*.{ts,tsx} : For Prisma queries: Select selects only the fields you specify explicitly.

⏰ 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)
  • GitHub Check: Check for E2E label
  • GitHub Check: Security Check
🔇 Additional comments (13)
apps/web/lib/video/[uid]/getServerSideProps.ts (1)

15-15: LGTM – import path correctly updated.

No further action needed.

packages/features/credentials/deleteCredential.test.ts (1)

11-11: LGTM – import path correctly updated.

No further action needed.

packages/app-store/routing-forms/lib/crmRouting/routerGetCrmContactOwnerEmail.ts (1)

2-2: LGTM – import path correctly updated.

No further action needed.

packages/lib/event-types/getEventTypeById.ts (1)

14-14: LGTM – import path correctly updated.

No further action needed.

packages/trpc/server/routers/viewer/eventTypes/create.handler.ts (1)

6-6: No lingering references to the old import path found

I’ve verified across the repository that there are no imports using @calcom/lib/server/repository/eventType (without “Repository”). All occurrences now correctly reference @calcom/lib/server/repository/eventTypeRepository.

packages/lib/getConnectedDestinationCalendars.ts (1)

12-12: No stray old module paths found

I ran the suggested scans:

rg --fixed-strings '"@calcom/lib/server/repository/eventType"' --glob '!.git/**'
rg --fixed-strings '"./server/repository/eventType"' --glob 'packages/**/*.{ts,tsx}'

and got no matches. The mechanical rename appears clean—no further action needed.

packages/lib/event-types/getEventTypesByViewer.ts (1)

12-12: Import update looks good

Import path matches the new filename; no further action needed.

packages/lib/di/modules/eventType.ts (1)

4-4: Module binding updated correctly

The IoC binding now references the renamed repository file; everything else remains untouched.

packages/trpc/server/routers/viewer/routing-forms/findTeamMembersMatchingAttributeLogicOfRoute.handler.ts (1)

17-17: Import path updated as expected

Change is mechanical and consistent with the rename.

packages/trpc/server/routers/viewer/eventTypes/util.ts (1)

5-5: Type-only import path fixed

Nothing else to flag. Good catch.

packages/trpc/server/routers/viewer/eventTypes/getEventTypesFromGroup.handler.ts (1)

6-6: No leftover eventType imports found
Verified with ripgrep—there are no remaining references to the old @calcom/lib/server/repository/eventType path. The import rename is complete.

packages/lib/getUserAvailability.ts (1)

29-29: Updated repository import LGTM

The switch to eventTypeRepository matches the new filename; no functional impact.

packages/platform/libraries/repositories.ts (1)

4-4: Alias points to renamed repository – looks good

Export now targets the new module; downstream consumers stay intact.

@github-actions
Copy link
Contributor

E2E results are ready!

@vercel
Copy link

vercel bot commented Jul 22, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Jul 22, 2025 0:06am
cal-eu ⬜️ Ignored (Inspect) Jul 22, 2025 0:06am

@emrysal emrysal enabled auto-merge (squash) July 22, 2025 12:21
@emrysal emrysal merged commit 42a4a38 into main Jul 22, 2025
39 of 40 checks passed
@emrysal emrysal deleted the devin/rename-event-type-files-1753174089 branch July 22, 2025 12:27
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.

3 participants