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

feat: Organization onboarding improvement - Payment before creation of org but onboarding doesn't require payment #18990

Open
wants to merge 43 commits into
base: main
Choose a base branch
from

Conversation

sean-brydon
Copy link
Member

@sean-brydon sean-brydon commented Jan 29, 2025

What does this PR do?

Self Serve Flow - Loom

  • Org is now created only through stripe webhook and thus code has been adapted to be idempotent in case of retries from Stripe when failure happens.
  • We store the complete progress of the onboarding in OrganizationOnboarding table including any error that last happened and the end of lifecycle with isComplete set to true.
  • Admin can configure a custom price for a customer(identified by email) and handover the onboarding to the customer(through a handover onboarding link). In this way, the customer still setups the onboarding himself but pays a custom price.
  • Admin Doing organization onboarding on behalf of an email that doesn't exist in our system, is temporarily disabled. [Can be enabled in the future if needed]
  • Earlier Organization onboarding updated DB step by step but now in one go after the payment, we create everything - Domain Creation, Org Setup, Teams Creation, Teams Migration, Migrating Teams' members migration, member invitations. So, we have been extra careful with the logic to ensure errors don;t occur and if occur they are retried by webhook and also recorded in OrganizationOnboarding table.

Deprecations/Removals:

  • NEXT_PUBLIC_ORGANIZATIONS_SELF_SERVE_PRICE env variable is removed and user must set NEXT_PUBLIC_ORGANIZATIONS_SELF_SERVE_PRICE_NEW with the difference that it doesn't have 00 in the end (37 instead of 3700 now). Reason was that 00 is a stripe specific thing and also because we store the price in DB with OrganizationOnboarding record and it doesn't make sense for it to be 3700 when infact it is 37.

Deployment Plan

  • Need Stripe Product ID in Env variable
  • Set NEXT_PUBLIC_ORGANIZATIONS_SELF_SERVE_PRICE_NEW to 37

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs 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

Copy link
Contributor

github-actions bot commented Jan 29, 2025

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 "Feat/org payment before creation". 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

@github-actions github-actions bot added ❗️ migrations contains migration files ❗️ .env changes contains changes to env variables labels Jan 29, 2025
@keithwillcode keithwillcode added consumer core area: core, team members only labels Jan 29, 2025
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Hariom Balhara seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link

vercel bot commented Feb 10, 2025

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

Name Status Preview Comments Updated (UTC)
cal-com-ui-playground ❌ Failed (Inspect) Feb 15, 2025 1:06pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Feb 15, 2025 1:06pm
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Feb 15, 2025 1:06pm

…cal.com into feat/org-payment-before-creation
@hariombalhara hariombalhara changed the title feat: Org payment before creation feat: Organization onboarding improvement - Payment before creation of org but onboarding doesn't require payment Feb 15, 2025
@hariombalhara hariombalhara marked this pull request as ready for review February 15, 2025 11:54
@hariombalhara hariombalhara requested a review from a team as a code owner February 15, 2025 11:54
@graphite-app graphite-app bot requested a review from a team February 15, 2025 11:54
@dosubot dosubot bot added organizations area: organizations, orgs ✨ feature New feature or request labels Feb 15, 2025
Copy link

graphite-app bot commented Feb 15, 2025

Graphite Automations

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

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

Copy link

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher

🚮 Removed packages: npm/@formkit/[email protected]

View full report↗︎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consumer core area: core, team members only ❗️ .env changes contains changes to env variables ✨ feature New feature or request ❗️ migrations contains migration files organizations area: organizations, orgs ready-for-e2e
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants