Skip to content

Comments

revert: fix: managed orgs get bookings#23066

Merged
supalarry merged 1 commit intomainfrom
revert-23063-fix-managed-orgs-get-bookings
Aug 13, 2025
Merged

revert: fix: managed orgs get bookings#23066
supalarry merged 1 commit intomainfrom
revert-23063-fix-managed-orgs-get-bookings

Conversation

@supalarry
Copy link
Contributor

Reverts #23063

@vercel
Copy link

vercel bot commented Aug 13, 2025

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

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
cal ⬜️ Ignored Aug 13, 2025 3:03pm
cal-eu ⬜️ Ignored Aug 13, 2025 3:03pm

@supalarry supalarry requested a review from a team as a code owner August 13, 2025 15:03
@supalarry supalarry requested a review from a team August 13, 2025 15:03
@supalarry supalarry enabled auto-merge (squash) August 13, 2025 15:03
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 13, 2025

Walkthrough

  • Downgraded @calcom/platform-libraries from 0.0.304 to 0.0.300 in apps/api/v2/package.json.
  • In event-types-private-links controller, replaced imported UpdatePrivateLinkBody with a local class using OmitType(UpdatePrivateLinkInput, ["linkId"]); request body now excludes linkId (still taken from URL).
  • Removed E2E test file for managed organizations bookings.
  • Removed createManagedOrganization method from ManagedOrganizationsRepositoryFixture.
  • In platform types, removed exported UpdatePrivateLinkBody; added default: 1 to CreatePrivateLinkInput.maxUsageCount description/metadata.
  • In TRPC viewer bookings handler, removed teamId filter when deriving admin/owner memberships.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~18 minutes

Possibly related PRs

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch revert-23063-fix-managed-orgs-get-bookings

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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

@graphite-app graphite-app bot requested a review from a team August 13, 2025 15:03
@github-actions
Copy link
Contributor

Hey there and thank you for opening this pull request! 👋🏼

We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted.

Details:

No release type found in pull request title "revert fix: managed orgs get bookings". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - feat: A new feature
 - fix: A bug fix
 - docs: Documentation only changes
 - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
 - refactor: A code change that neither fixes a bug nor adds a feature
 - perf: A code change that improves performance
 - test: Adding missing tests or correcting existing tests
 - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
 - ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
 - chore: Other changes that don't modify src or test files
 - revert: Reverts a previous commit

@keithwillcode keithwillcode added core area: core, team members only platform Anything related to our platform plan labels Aug 13, 2025
@supalarry supalarry changed the title revert fix: managed orgs get bookings revert: fix: managed orgs get bookings Aug 13, 2025
@dosubot dosubot bot added bookings area: bookings, availability, timezones, double booking organizations area: organizations, orgs 🐛 bug Something isn't working labels Aug 13, 2025
@graphite-app
Copy link

graphite-app bot commented Aug 13, 2025

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (08/13/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 • (08/13/25)

1 label 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

🧹 Nitpick comments (3)
packages/platform/types/event-types/inputs/private-link.input.ts (2)

21-27: Clarify default behavior for maxUsageCount to avoid ambiguity

The description says “If omitted and expiresAt is not provided, defaults to 1,” but the schema also sets default: 1, which implies default=1 regardless of expiresAt. Given prior decisions to default to single-use, the text should reflect that.

Apply:

-    description: "Maximum number of times the link can be used. If omitted and expiresAt is not provided, defaults to 1 (one time use).",
+    description: "Maximum number of times the link can be used. If omitted, defaults to 1 (single use).",

42-47: Align OpenAPI schema for expiresAt to string with RFC3339 date-time format

In CreatePrivateLinkInput, expiresAt uses type String + format: date-time. Here, UpdatePrivateLinkInput uses type: Date. Use a consistent schema for better Swagger UI and client generation.

   @ApiPropertyOptional({
-    description: "New expiration date for time-based links",
-    type: Date,
-    example: "2024-12-31T23:59:59.000Z",
+    description: "New expiration date for time-based links",
+    type: String,
+    format: "date-time",
+    example: "2024-12-31T23:59:59.000Z",
   })
apps/api/v2/src/ee/event-types-private-links/controllers/event-types-private-links.controller.ts (1)

86-94: Minor: add explicit type to updateInput for stronger compile-time checks

This helps guard against future DTO drift and improves readability.

-    const updateInput = { ...body, linkId };
+    const updateInput: UpdatePrivateLinkInput = { ...body, linkId };
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 13ba680 and a07a9fc.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (6)
  • apps/api/v2/package.json (1 hunks)
  • apps/api/v2/src/ee/event-types-private-links/controllers/event-types-private-links.controller.ts (2 hunks)
  • apps/api/v2/src/modules/organizations/bookings/managed-organizations-bookings.controller.e2e-spec.ts (0 hunks)
  • apps/api/v2/test/fixtures/repository/managed-organizations.repository.fixture.ts (0 hunks)
  • packages/platform/types/event-types/inputs/private-link.input.ts (1 hunks)
  • packages/trpc/server/routers/viewer/bookings/get.handler.ts (0 hunks)
💤 Files with no reviewable changes (3)
  • apps/api/v2/test/fixtures/repository/managed-organizations.repository.fixture.ts
  • packages/trpc/server/routers/viewer/bookings/get.handler.ts
  • apps/api/v2/src/modules/organizations/bookings/managed-organizations-bookings.controller.e2e-spec.ts
🧰 Additional context used
📓 Path-based instructions (2)
**/*.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/platform/types/event-types/inputs/private-link.input.ts
  • apps/api/v2/src/ee/event-types-private-links/controllers/event-types-private-links.controller.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/platform/types/event-types/inputs/private-link.input.ts
  • apps/api/v2/src/ee/event-types-private-links/controllers/event-types-private-links.controller.ts
🧠 Learnings (2)
📚 Learning: 2025-07-16T05:10:22.891Z
Learnt from: alishaz-polymath
PR: calcom/cal.com#22304
File: packages/prisma/schema.prisma:1068-1071
Timestamp: 2025-07-16T05:10:22.891Z
Learning: In PR #22304 for Cal.com private link expiration features, the `maxUsageCount` field was intentionally set to default to 1 (non-nullable) as a breaking change, making all existing private links single-use after migration. This was a deliberate design decision by alishaz-polymath.

Applied to files:

  • packages/platform/types/event-types/inputs/private-link.input.ts
📚 Learning: 2025-07-16T06:42:27.024Z
Learnt from: alishaz-polymath
PR: calcom/cal.com#22304
File: packages/features/eventtypes/components/MultiplePrivateLinksController.tsx:92-94
Timestamp: 2025-07-16T06:42:27.024Z
Learning: In the MultiplePrivateLinksController component (packages/features/eventtypes/components/MultiplePrivateLinksController.tsx), the `currentLink.maxUsageCount ?? 1` fallback in the openSettingsDialog function is intentional. Missing maxUsageCount values indicate old/legacy private links that existed before the expiration feature was added, and they should default to single-use behavior (1) for backward compatibility.

Applied to files:

  • packages/platform/types/event-types/inputs/private-link.input.ts
🧬 Code Graph Analysis (1)
apps/api/v2/src/ee/event-types-private-links/controllers/event-types-private-links.controller.ts (1)
packages/platform/types/event-types/inputs/private-link.input.ts (1)
  • UpdatePrivateLinkInput (30-59)
⏰ 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: Detect changes
  • GitHub Check: Atoms E2E Tests
🔇 Additional comments (2)
apps/api/v2/package.json (1)

41-41: Cross-repo version consistency confirmed

  • Only one declaration found:
    • apps/api/v2/package.json → "@calcom/platform-libraries": "npm:@calcom/platform-libraries@0.0.300"
  • No other package.json references a different version.
  • yarn.lock resolutions are either the npm alias at v0.0.300 or the local workspace entry.

Please manually verify that none of the API v2 code or any dependent workspace relies on fixes introduced in versions 0.0.301–0.0.304 before merging.

apps/api/v2/src/ee/event-types-private-links/controllers/event-types-private-links.controller.ts (1)

36-37: Good move: local UpdatePrivateLinkBody via OmitType keeps linkId in the URL only

Defining the body DTO locally via OmitType(UpdatePrivateLinkInput, ["linkId"]) prevents clients from passing linkId in the body while preserving API docs and validation. Solid.

@supalarry supalarry merged commit 58ef0ab into main Aug 13, 2025
162 of 175 checks passed
@supalarry supalarry deleted the revert-23063-fix-managed-orgs-get-bookings branch August 13, 2025 15:54
@github-actions
Copy link
Contributor

E2E results are ready!

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

Labels

bookings area: bookings, availability, timezones, double booking 🐛 bug Something isn't working core area: core, team members only organizations area: organizations, orgs platform Anything related to our platform plan ready-for-e2e

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants