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 billing issues #11160

Merged
merged 4 commits into from
Mar 25, 2025
Merged

fix billing issues #11160

merged 4 commits into from
Mar 25, 2025

Conversation

etiennejouan
Copy link
Contributor

@etiennejouan etiennejouan commented Mar 25, 2025

  • first commit : fix quantity update on Enterprise plan
  • second commit : fix user with soft deleted workspace trying to recreate another workspace

closes twentyhq/core-team-issues#634

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR addresses two billing-related issues in the Twenty workspace management system:

  • Moves billing subscription deletion logic to deleteWorkspace method to ensure proper cleanup during both soft and hard workspace deletions
  • Replaces hardcoded PRO plan references with dynamic plan key retrieval for more flexible billing plan handling

Key Changes:

  • Relocated subscription deletion from deleteMetadataSchemaCacheAndUserWorkspace to deleteWorkspace in workspace.service.ts
  • Added getPlanKeyFromSubscription utility to dynamically determine billing plan in billing-subscription.service.ts
  • Improved cleanup of billing resources during workspace soft-delete operations
  • Removed hardcoded plan references to support Enterprise plan quantity updates

The changes make the billing system more robust by ensuring proper resource cleanup and supporting multiple plan types dynamically.

2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

@prastoin prastoin left a comment

Choose a reason for hiding this comment

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

"Une PR de qualite" as who would say
Left 2 nitpicks
Have a great evening !

@etiennejouan etiennejouan merged commit 934abf1 into main Mar 25, 2025
32 checks passed
@etiennejouan etiennejouan deleted the ej/634 branch March 25, 2025 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

investigate workspaces with same email for stripe customer having subscription issues
2 participants