Skip to content

feat: Add EXPAND accepting "team" in API V1 Bookings#16736

Merged
emrysal merged 10 commits into
mainfrom
feat/add-api-v1-bookings-expand-teams
Sep 20, 2024
Merged

feat: Add EXPAND accepting "team" in API V1 Bookings#16736
emrysal merged 10 commits into
mainfrom
feat/add-api-v1-bookings-expand-teams

Conversation

@alishaz-polymath
Copy link
Copy Markdown
Member

@alishaz-polymath alishaz-polymath commented Sep 20, 2024

What does this PR do?

Adds the use of EXPAND to get relational data, POC includes using EXPAND with "team" to get eventType.team data returned on team events booked.

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have added a Docs issue here if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  • Are there environment variables that should be set?
  • What are the minimal test data to have?
  • What is expected (happy path) to have (input and output)?
  • Any other important info that could help to test that PR

Checklist

@keithwillcode keithwillcode added core area: core, team members only enterprise area: enterprise, audit log, organisation, SAML, SSO labels Sep 20, 2024
@vercel
Copy link
Copy Markdown

vercel Bot commented Sep 20, 2024

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

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Sep 20, 2024 9:54am
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Sep 20, 2024 9:54am

@alishaz-polymath alishaz-polymath marked this pull request as ready for review September 20, 2024 08:32
@dosubot dosubot Bot added api area: API, enterprise API, access token, OAuth ✨ feature New feature or request labels Sep 20, 2024
attendees: true,
user: true,
payment: true,
eventType: expand.includes("team") ? { include: { team: true } } : false,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Only show when req.expand contains "team".

attendees: true,
user: true,
payment: true,
eventType: expand.includes("team") ? { include: { team: true } } : false,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

only include when req.expand contains "team"

@@ -0,0 +1,12 @@
import { z } from "zod";

const expandEnum = z.enum(["team"]);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We can add more relations here, as we wish to allow expansion via expand parameter

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

?expand=team&expand=.. Have we considered a more industry standard param like select=? (Not a blocker just curious)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, we really like the stripe way

Comment on lines +103 to +105
attendees: true,
user: true,
payment: true,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not including them as part of the expand feature to avoid breaking changes. expand="team" should serve as a POC.

@alishaz-polymath

This comment was marked as resolved.

@alishaz-polymath alishaz-polymath marked this pull request as ready for review September 20, 2024 09:53
@emrysal emrysal enabled auto-merge (squash) September 20, 2024 11:24
@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented Sep 20, 2024

Graphite Automations

"Add ready-for-e2e label" took an action on this PR • (09/20/24)

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

@emrysal emrysal merged commit 8cb5a70 into main Sep 20, 2024
@emrysal emrysal deleted the feat/add-api-v1-bookings-expand-teams branch September 20, 2024 11:46
@github-actions
Copy link
Copy Markdown
Contributor

E2E results are ready!

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

Labels

api area: API, enterprise API, access token, OAuth core area: core, team members only enterprise area: enterprise, audit log, organisation, SAML, SSO ✨ feature New feature or request ready-for-e2e

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants