Skip to content

refactor: rename repository files to include Repository suffix #22717

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 30, 2025

Conversation

eunjae-lee
Copy link
Contributor

@eunjae-lee eunjae-lee commented Jul 24, 2025

refactor: rename repository files and classes with Prisma prefix

Summary

Renamed three repository files in packages/lib/server/repository/ to include the "Prisma" prefix for better naming consistency and updated all references throughout the codebase:

  • attribute.tsPrismaAttributeRepository.ts
  • attributeOption.tsPrismaAttributeOptionRepository.ts
  • attributeToUser.tsPrismaAttributeToUserRepository.ts

Additionally updated the class names to match:

  • AttributeRepositoryPrismaAttributeRepository
  • AttributeOptionRepositoryPrismaAttributeOptionRepository
  • AttributeToUserRepositoryPrismaAttributeToUserRepository

Updated all import statements and class references across 5 files in the web app, TRPC handlers, and service layer.

Review & Testing Checklist for Human

  • Verify all import statements are correctly updated - Check that all files importing these repositories use the new PrismaAttributeRepository.ts paths and class names
  • Test attributes functionality end-to-end - Go to Organization Settings → Members and verify that attribute filtering, assignment, and management still works correctly
  • Search codebase for any missed references - Search for any remaining references to the old class names (AttributeRepository, AttributeOptionRepository, AttributeToUserRepository)
  • Confirm type checking passes - The pre-existing type errors in membership.ts, selectedCalendar.ts, and team.ts are unrelated to these changes

Recommended Test Plan

  1. Navigate to /settings/organizations/members in the Cal.com app
  2. Test attribute filtering functionality
  3. Test assigning/unassigning attributes to team members
  4. Verify attribute options load correctly

Diagram

%%{ init : { "theme" : "default" }}%%
graph TD
    PrismaAttrRepo["PrismaAttributeRepository.ts"]:::major-edit
    PrismaAttrOptRepo["PrismaAttributeOptionRepository.ts"]:::major-edit  
    PrismaAttrToUserRepo["PrismaAttributeToUserRepository.ts"]:::major-edit
    
    MembersPage["members/page.tsx"]:::minor-edit
    AssignValueToUser["assignValueToUser.ts"]:::minor-edit
    GetAttributes["getAttributes.ts"]:::minor-edit
    Utils["utils.ts"]:::minor-edit
    ListHandler["list.handler.ts"]:::minor-edit
    
    PrismaAttrRepo --> MembersPage
    PrismaAttrRepo --> AssignValueToUser
    PrismaAttrRepo --> GetAttributes
    PrismaAttrRepo --> ListHandler
    
    PrismaAttrOptRepo --> AssignValueToUser
    PrismaAttrToUserRepo --> GetAttributes
    PrismaAttrToUserRepo --> Utils
    
    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

  • Type checking revealed 7 pre-existing errors in unrelated repository files (membership.ts, selectedCalendar.ts, team.ts) - these existed on main branch and are not caused by this PR
  • Used automated find_and_edit commands to update imports across the codebase, but manual verification recommended
  • This refactoring improves naming consistency by clearly indicating these are Prisma-based repository implementations

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

- Rename attribute.ts -> attributeRepository.ts
- Rename attributeOption.ts -> attributeOptionRepository.ts
- Rename attributeToUser.ts -> attributeToUserRepository.ts
- Update all import statements throughout codebase

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

Copy link
Contributor

coderabbitai bot commented Jul 24, 2025

Walkthrough

This change set systematically replaces the usage of generic repository classes (AttributeRepository, AttributeOptionRepository, and AttributeToUserRepository) with their Prisma-specific counterparts (PrismaAttributeRepository, PrismaAttributeOptionRepository, and PrismaAttributeToUserRepository). The updates include renaming class declarations and updating all relevant imports and method calls throughout the codebase, including service, utility, handler, and page files. No modifications were made to the business logic, function signatures, or control flow—only the repository implementations and their references were altered.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Complexity label: Simple
Rationale: The changes are systematic, mechanical, and limited to class renaming and import updates, with no logic or structural alterations. Review mainly involves verifying the accuracy of class renaming and ensuring all references are updated consistently.


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7e39a2f and cfab8a5.

📒 Files selected for processing (1)
  • apps/web/app/(use-page-wrapper)/settings/(settings-layout)/teams/[id]/members/page.tsx (2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.tsx

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

Always use t() for text localization in frontend code; direct text embedding should trigger a warning

Files:

  • apps/web/app/(use-page-wrapper)/settings/(settings-layout)/teams/[id]/members/page.tsx
**/*.{ts,tsx}

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

Flag excessive Day.js use in performance-critical code; prefer native Date or Day.js .utc() in hot paths like loops

Files:

  • apps/web/app/(use-page-wrapper)/settings/(settings-layout)/teams/[id]/members/page.tsx
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-28T11:50:23.946Z
Learning: Applies to **/*Repository.ts : Repository files must include `Repository` suffix, prefix with technology if applicable (e.g., `PrismaAppRepository.ts`), and use PascalCase matching the exported class
Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-28T11:50:23.946Z
Learning: For large pull requests (>500 lines changed or >10 files touched), advise splitting into smaller, focused PRs by feature, layer, dependency chain, or file/module
apps/web/app/(use-page-wrapper)/settings/(settings-layout)/teams/[id]/members/page.tsx (1)

Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-28T11:50:23.946Z
Learning: Applies to **/*Repository.ts : Repository files must include Repository suffix, prefix with technology if applicable (e.g., PrismaAppRepository.ts), and use PascalCase matching the exported class

🧬 Code Graph Analysis (1)
apps/web/app/(use-page-wrapper)/settings/(settings-layout)/teams/[id]/members/page.tsx (1)
packages/lib/server/repository/PrismaAttributeRepository.ts (1)
  • PrismaAttributeRepository (3-56)
⏰ 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). (1)
  • GitHub Check: Install dependencies / Yarn install & cache
🔇 Additional comments (3)
apps/web/app/(use-page-wrapper)/settings/(settings-layout)/teams/[id]/members/page.tsx (3)

7-7: LGTM! Import correctly updated to use the new Prisma-prefixed repository.

The import statement has been properly updated to reflect the renamed PrismaAttributeRepository class, maintaining consistency with the systematic refactoring across the codebase.


40-40: LGTM! Method call correctly updated to use the new repository class.

The method call has been properly updated to use PrismaAttributeRepository.findAllByOrgIdWithOptions, maintaining the same functionality while aligning with the systematic repository refactoring. The method signature and error handling remain unchanged.


7-7: Excellent refactoring implementation - clean and consistent updates.

This file exemplifies the systematic repository refactoring perfectly:

  • Both import statement and method call are consistently updated
  • No functional changes to business logic, error handling, or caching behavior
  • Aligns with the established naming convention of prefixing repository classes with their technology stack
  • Maintains the same method signatures and parameter structures

The changes support the broader goal of making repository implementations more explicit about their underlying technology (Prisma).

Also applies to: 40-40

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch devin/rename-repository-files-1753364183

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 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 generate unit tests to generate unit tests for 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.

- Rename attribute.ts -> PrismaAttributeRepository.ts
- Rename attributeOption.ts -> PrismaAttributeOptionRepository.ts
- Rename attributeToUser.ts -> PrismaAttributeToUserRepository.ts
- Update class names to PrismaAttributeRepository, PrismaAttributeOptionRepository, PrismaAttributeToUserRepository
- Update all import statements and references throughout codebase

Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
Copy link

vercel bot commented Jul 24, 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 30, 2025 11:25am
cal-eu ⬜️ Ignored (Inspect) Jul 30, 2025 11:25am

@graphite-app graphite-app bot requested a review from a team July 29, 2025 09:21
Copy link

graphite-app bot commented Jul 29, 2025

Graphite Automations

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

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

"Add ready-for-e2e label" took an action on this PR • (07/30/25)

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

sean-brydon
sean-brydon previously approved these changes Jul 30, 2025
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

🔭 Outside diff range comments (3)
packages/lib/server/repository/PrismaAttributeRepository.ts (2)

16-24: include violates our Prisma-query guideline – switch to select

Coding-guidelines mandate: “never use include, always use select.
Replace the include with an equivalent nested select to avoid fetching unused columns.

-      include: {
-        options: {
-          select: {
-            id: true,
-            value: true,
-            slug: true,
-          },
-        },
-      },
+      select: {
+        id: true,
+        name: true,
+        type: true,
+        slug: true,
+        options: {
+          select: {
+            id: true,
+            value: true,
+            slug: true,
+          },
+        },
+      },

51-53: Second occurrence of include – same fix needed

findAllByOrgIdWithOptions also uses include. Mirror the earlier diff to comply with guidelines.

-      include: {
-        options: true,
-      },
+      select: {
+        id: true,
+        name: true,
+        type: true,
+        slug: true,
+        options: {
+          select: {
+            id: true,
+            value: true,
+            slug: true,
+          },
+        },
+      },
packages/lib/server/repository/PrismaAttributeToUserRepository.ts (1)

20-29: include here breaches the “no-include” rule

Switch to a nested select to stay within the Prisma query standard and avoid over-fetching.

-      include: {
-        attributeOption: {
-          select: {
-            attribute: true,
-            value: true,
-            slug: true,
-          },
-        },
-      },
+      select: {
+        id: true,
+        memberId: true,
+        attributeOption: {
+          select: {
+            attribute: true,
+            value: true,
+            slug: true,
+          },
+        },
+      },
🧹 Nitpick comments (2)
packages/lib/server/repository/PrismaAttributeRepository.ts (1)

30-41: Select all options fields – narrow the projection

options: true pulls every column of AttributeOption. If you only need a subset (id/value/slug), list them explicitly to keep responses lean and avoid accidental PII leakage.

packages/trpc/server/routers/viewer/attributes/list.handler.ts (1)

17-20: Nit: typo in error message

“apart of” → “a part of”.

-      message: "You need to be apart of an organization to use this feature",
+      message: "You need to be a part of an organization to use this feature",
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6c93647 and 7e39a2f.

📒 Files selected for processing (8)
  • apps/web/app/(use-page-wrapper)/settings/organizations/(org-user-only)/members/page.tsx (2 hunks)
  • packages/lib/server/repository/PrismaAttributeOptionRepository.ts (1 hunks)
  • packages/lib/server/repository/PrismaAttributeRepository.ts (1 hunks)
  • packages/lib/server/repository/PrismaAttributeToUserRepository.ts (1 hunks)
  • packages/lib/service/attribute/server/assignValueToUser.ts (3 hunks)
  • packages/lib/service/attribute/server/getAttributes.ts (2 hunks)
  • packages/lib/service/attribute/server/utils.ts (2 hunks)
  • packages/trpc/server/routers/viewer/attributes/list.handler.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*Repository.ts

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

Repository files must include Repository suffix, prefix with technology if applicable (e.g., PrismaAppRepository.ts), and use PascalCase matching the exported class

Files:

  • packages/lib/server/repository/PrismaAttributeToUserRepository.ts
  • packages/lib/server/repository/PrismaAttributeRepository.ts
  • packages/lib/server/repository/PrismaAttributeOptionRepository.ts
**/*.ts

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

**/*.ts: For Prisma queries, only select data you need; never use include, always use select
Ensure the credential.key field is never returned from tRPC endpoints or APIs

Files:

  • packages/lib/server/repository/PrismaAttributeToUserRepository.ts
  • packages/lib/server/repository/PrismaAttributeRepository.ts
  • packages/lib/server/repository/PrismaAttributeOptionRepository.ts
  • packages/trpc/server/routers/viewer/attributes/list.handler.ts
  • packages/lib/service/attribute/server/getAttributes.ts
  • packages/lib/service/attribute/server/assignValueToUser.ts
  • packages/lib/service/attribute/server/utils.ts
**/*.{ts,tsx}

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

Flag excessive Day.js use in performance-critical code; prefer native Date or Day.js .utc() in hot paths like loops

Files:

  • packages/lib/server/repository/PrismaAttributeToUserRepository.ts
  • packages/lib/server/repository/PrismaAttributeRepository.ts
  • packages/lib/server/repository/PrismaAttributeOptionRepository.ts
  • packages/trpc/server/routers/viewer/attributes/list.handler.ts
  • apps/web/app/(use-page-wrapper)/settings/organizations/(org-user-only)/members/page.tsx
  • packages/lib/service/attribute/server/getAttributes.ts
  • packages/lib/service/attribute/server/assignValueToUser.ts
  • packages/lib/service/attribute/server/utils.ts
**/*.tsx

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

Always use t() for text localization in frontend code; direct text embedding should trigger a warning

Files:

  • apps/web/app/(use-page-wrapper)/settings/organizations/(org-user-only)/members/page.tsx
🧠 Learnings (9)
📓 Common learnings
Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-28T11:50:23.946Z
Learning: Applies to **/*Repository.ts : Repository files must include `Repository` suffix, prefix with technology if applicable (e.g., `PrismaAppRepository.ts`), and use PascalCase matching the exported class
Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-28T11:50:23.946Z
Learning: For large pull requests (>500 lines changed or >10 files touched), advise splitting into smaller, focused PRs by feature, layer, dependency chain, or file/module
packages/lib/server/repository/PrismaAttributeToUserRepository.ts (1)

Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-28T11:50:23.946Z
Learning: Applies to **/*Repository.ts : Repository files must include Repository suffix, prefix with technology if applicable (e.g., PrismaAppRepository.ts), and use PascalCase matching the exported class

packages/lib/server/repository/PrismaAttributeRepository.ts (2)

Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-28T11:50:23.946Z
Learning: Applies to **/*Repository.ts : Repository files must include Repository suffix, prefix with technology if applicable (e.g., PrismaAppRepository.ts), and use PascalCase matching the exported class

Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-28T11:50:23.946Z
Learning: Applies to **/*.ts : For Prisma queries, only select data you need; never use include, always use select

packages/lib/server/repository/PrismaAttributeOptionRepository.ts (3)

Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-28T11:50:23.946Z
Learning: Applies to **/*Repository.ts : Repository files must include Repository suffix, prefix with technology if applicable (e.g., PrismaAppRepository.ts), and use PascalCase matching the exported class

Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-28T11:50:23.946Z
Learning: Applies to **/*.{service,repository}.ts : Avoid dot-suffixes like .service.ts or .repository.ts for new files; reserve .test.ts, .spec.ts, .types.ts for their specific purposes

Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-28T11:50:23.946Z
Learning: Applies to **/*.ts : For Prisma queries, only select data you need; never use include, always use select

packages/trpc/server/routers/viewer/attributes/list.handler.ts (1)

Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-28T11:50:23.946Z
Learning: Applies to **/*Repository.ts : Repository files must include Repository suffix, prefix with technology if applicable (e.g., PrismaAppRepository.ts), and use PascalCase matching the exported class

apps/web/app/(use-page-wrapper)/settings/organizations/(org-user-only)/members/page.tsx (1)

Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-28T11:50:23.946Z
Learning: Applies to **/*Repository.ts : Repository files must include Repository suffix, prefix with technology if applicable (e.g., PrismaAppRepository.ts), and use PascalCase matching the exported class

packages/lib/service/attribute/server/getAttributes.ts (3)

Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-28T11:50:23.946Z
Learning: Applies to **/*Repository.ts : Repository files must include Repository suffix, prefix with technology if applicable (e.g., PrismaAppRepository.ts), and use PascalCase matching the exported class

Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-28T11:50:23.946Z
Learning: Applies to **/*.{service,repository}.ts : Avoid dot-suffixes like .service.ts or .repository.ts for new files; reserve .test.ts, .spec.ts, .types.ts for their specific purposes

Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-28T11:50:23.946Z
Learning: Applies to **/*.ts : For Prisma queries, only select data you need; never use include, always use select

packages/lib/service/attribute/server/assignValueToUser.ts (2)

Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-28T11:50:23.946Z
Learning: Applies to **/*Repository.ts : Repository files must include Repository suffix, prefix with technology if applicable (e.g., PrismaAppRepository.ts), and use PascalCase matching the exported class

Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-28T11:50:23.946Z
Learning: Applies to **/*.ts : For Prisma queries, only select data you need; never use include, always use select

packages/lib/service/attribute/server/utils.ts (2)

Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-28T11:50:23.946Z
Learning: Applies to **/*Repository.ts : Repository files must include Repository suffix, prefix with technology if applicable (e.g., PrismaAppRepository.ts), and use PascalCase matching the exported class

Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-28T11:50:23.946Z
Learning: Applies to **/*.ts : For Prisma queries, only select data you need; never use include, always use select

🧬 Code Graph Analysis (5)
packages/trpc/server/routers/viewer/attributes/list.handler.ts (1)
packages/lib/server/repository/PrismaAttributeRepository.ts (1)
  • PrismaAttributeRepository (3-56)
apps/web/app/(use-page-wrapper)/settings/organizations/(org-user-only)/members/page.tsx (1)
packages/lib/server/repository/PrismaAttributeRepository.ts (1)
  • PrismaAttributeRepository (3-56)
packages/lib/service/attribute/server/getAttributes.ts (2)
packages/lib/server/repository/PrismaAttributeRepository.ts (1)
  • PrismaAttributeRepository (3-56)
packages/lib/server/repository/PrismaAttributeToUserRepository.ts (1)
  • PrismaAttributeToUserRepository (5-47)
packages/lib/service/attribute/server/assignValueToUser.ts (2)
packages/lib/server/repository/PrismaAttributeRepository.ts (1)
  • PrismaAttributeRepository (3-56)
packages/lib/server/repository/PrismaAttributeOptionRepository.ts (1)
  • PrismaAttributeOptionRepository (5-31)
packages/lib/service/attribute/server/utils.ts (1)
packages/lib/server/repository/PrismaAttributeToUserRepository.ts (1)
  • PrismaAttributeToUserRepository (5-47)
⏰ 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). (10)
  • GitHub Check: Install dependencies / Yarn install & cache
  • GitHub Check: Install dependencies / Yarn install & cache
  • GitHub Check: Install dependencies / Yarn install & cache
  • GitHub Check: Install dependencies / Yarn install & cache
  • GitHub Check: Install dependencies / Yarn install & cache
  • GitHub Check: Install dependencies / Yarn install & cache
  • GitHub Check: Install dependencies / Yarn install & cache
  • GitHub Check: Install dependencies / Yarn install & cache
  • GitHub Check: Install dependencies / Yarn install & cache
  • GitHub Check: Install dependencies / Yarn install & cache
🔇 Additional comments (13)
packages/lib/server/repository/PrismaAttributeRepository.ts (1)

3-3: Naming now complies with repository conventions – good job
Prisma prefix + Repository suffix matches the agreed guidelines.

packages/lib/server/repository/PrismaAttributeOptionRepository.ts (1)

5-30: Repository is clean and guideline-compliant

Uses select, projections are tight, and naming aligns with conventions.

packages/lib/server/repository/PrismaAttributeToUserRepository.ts (1)

10-15: Good defensive check before mass delete

Empty-where guard prevents catastrophic deletes – nice.

apps/web/app/(use-page-wrapper)/settings/organizations/(org-user-only)/members/page.tsx (1)

20-26: Caching looks correct with new repository – nothing to flag

packages/lib/service/attribute/server/getAttributes.ts (3)

8-9: LGTM! Repository import statements updated correctly.

The import statements have been properly updated to use the Prisma-specific repository classes, aligning with the naming convention improvements outlined in the PR objectives.


221-221: LGTM! Repository method call updated correctly.

The method call has been properly updated to use PrismaAttributeRepository.findManyByOrgId, maintaining the same functionality while using the renamed class.


227-228: LGTM! Repository method call updated correctly.

The method call has been properly updated to use PrismaAttributeToUserRepository.findManyByOrgMembershipIds, maintaining the same functionality while using the renamed class.

packages/lib/service/attribute/server/assignValueToUser.ts (4)

5-6: LGTM! Repository import statements updated correctly.

The import statements have been properly updated to use the Prisma-specific repository classes, maintaining consistency with the refactoring objectives.


40-43: Repository method call updated correctly, but consider reviewing the underlying query.

The method call has been properly updated to use PrismaAttributeRepository.findManyByNamesAndOrgIdIncludeOptions. However, note that this method uses include in its implementation, which may violate the coding guideline that states "For Prisma queries, only select data you need; never use include, always use select".

Consider reviewing the implementation of findManyByNamesAndOrgIdIncludeOptions in the repository file to ensure it follows the select pattern instead of include.


328-330: LGTM! Repository method call updated correctly.

The method call has been properly updated to use PrismaAttributeOptionRepository.createMany, maintaining the same functionality.


334-336: LGTM! Repository method call updated correctly.

The method call has been properly updated to use PrismaAttributeOptionRepository.findMany, maintaining the same functionality.

packages/lib/service/attribute/server/utils.ts (2)

1-1: LGTM! Repository import statement updated correctly.

The import statement has been properly updated to use the Prisma-specific repository class, maintaining consistency with the refactoring objectives.


13-13: LGTM! Repository method call updated correctly.

The method call has been properly updated to use PrismaAttributeToUserRepository.findManyIncludeAttribute, maintaining the same functionality while using the renamed class.

…itory in teams members page

Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
Copy link
Contributor

E2E results are ready!

@eunjae-lee eunjae-lee merged commit 4489cb8 into main Jul 30, 2025
42 checks passed
@eunjae-lee eunjae-lee deleted the devin/rename-repository-files-1753364183 branch July 30, 2025 12:33
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.

4 participants