Skip to content
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

fix: Allow less than 30 seats for orgs #14995

Merged
merged 3 commits into from
May 13, 2024

Conversation

hariombalhara
Copy link
Member

@hariombalhara hariombalhara commented May 13, 2024

What does this PR do?

Allowing going below 30 seats for orgs.

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
  • I have added or modified automated tests that prove my fix is effective or that my feature works (PRs might be rejected if logical changes are not properly tested)

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

Copy link

vercel bot commented May 13, 2024

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

3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
ai ⬜️ Ignored (Inspect) Visit Preview May 13, 2024 9:12am
cal ⬜️ Ignored (Inspect) Visit Preview May 13, 2024 9:12am
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview May 13, 2024 9:12am

Copy link
Contributor

github-actions bot commented May 13, 2024

Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link.

@keithwillcode keithwillcode added consumer core area: core, team members only labels May 13, 2024
Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @hariombalhara and the rest of your teammates on Graphite Graphite

Copy link

linear bot commented May 13, 2024

Copy link
Contributor

github-actions bot commented May 13, 2024

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

Six Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (350 KB)
/availability 464.99 KB 693.67 KB 198.19% (🟡 +10.67%)
/settings/admin/lockedSMS/UsersTable 78.89 KB 307.56 KB 87.88% (🟢 -0.18%)
/settings/admin/lockedSMS/lockedSMSView 118.56 KB 347.24 KB 99.21% (🟢 -0.20%)
/settings/admin/oAuth/oAuthView 94.97 KB 323.64 KB 92.47% (🟢 -0.20%)
/settings/organizations/dsync 331.73 KB 560.41 KB 160.12% (🟡 +10.61%)
/settings/organizations/members 430.82 KB 659.5 KB 188.43% (🟡 +8.82%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

@hariombalhara hariombalhara force-pushed the 05-13-fix_allow_less_than_30_seats_for_orgs branch from 953aba5 to 8be3d4a Compare May 13, 2024 06:56
@github-actions github-actions bot added seats area: seats, guest meetings, multiple people 🐛 bug Something isn't working labels May 13, 2024
Copy link

deploysentinel bot commented May 13, 2024

No failed tests 🎉

@hariombalhara hariombalhara marked this pull request as ready for review May 13, 2024 07:42
@graphite-app graphite-app bot requested a review from a team May 13, 2024 07:42
@dosubot dosubot bot added the api area: API, enterprise API, access token, OAuth label May 13, 2024
});

describe("purchaseTeamOrOrgSubscription", () => {
it("should use `seatsToChargeFor` to create price", async () => {
Copy link
Member Author

Choose a reason for hiding this comment

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

Added a very basic test. We can add more tests later.

@@ -39,7 +39,10 @@ export const publishHandler = async ({ ctx }: PublishOptions) => {
if (IS_TEAM_BILLING_ENABLED) {
const checkoutSession = await purchaseTeamOrOrgSubscription({
teamId: prevTeam.id,
seats: Math.max(prevTeam.members.length, metadata.data?.orgSeats ?? 0),
seatsUsed: prevTeam.members.length,
seatsToChargeFor: metadata.data?.orgSeats
Copy link
Member Author

Choose a reason for hiding this comment

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

We are supposed to directly use orgSeats, if available, for charging user.

Copy link

graphite-app bot commented May 13, 2024

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (05/13/24)

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

Copy link
Member

@sean-brydon sean-brydon left a comment

Choose a reason for hiding this comment

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

LGTM - thanks for the tests <3

@hariombalhara hariombalhara enabled auto-merge (squash) May 13, 2024 11:33
@hariombalhara hariombalhara merged commit 917c7b0 into main May 13, 2024
41 checks passed
@hariombalhara hariombalhara deleted the 05-13-fix_allow_less_than_30_seats_for_orgs branch May 13, 2024 11:37
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 🐛 bug Something isn't working consumer core area: core, team members only seats area: seats, guest meetings, multiple people
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CAL-3690] Org. Checkout not Capturing # of Seats
3 participants