revert: fix: managed orgs get bookings#23066
Conversation
This reverts commit 13ba680.
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
Walkthrough
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~18 minutes Possibly related PRs
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
|
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: |
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. |
There was a problem hiding this comment.
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 ambiguityThe 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 formatIn 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 checksThis 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
⛔ Files ignored due to path filters (1)
yarn.lockis 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 useinclude, always useselect
Ensure thecredential.keyfield is never returned from tRPC endpoints or APIs
Files:
packages/platform/types/event-types/inputs/private-link.input.tsapps/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.tsapps/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 onlyDefining the body DTO locally via OmitType(UpdatePrivateLinkInput, ["linkId"]) prevents clients from passing linkId in the body while preserving API docs and validation. Solid.
E2E results are ready! |
Reverts #23063