Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Description

Fixed organization creation failure introduced by subscription updates

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Code refactoring (no functional changes)

How Has This Been Tested?

Tested issuance of plan, and that I was prompted in team management to create an org and then once I created it I could manage the seats and have visibility into my org.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • All tests pass locally and in CI (npm test)
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • I have updated version numbers as needed (if needed)
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Security Considerations:

  • My changes do not introduce any new security vulnerabilities
  • I have considered the security implications of my changes

@vercel
Copy link

vercel bot commented May 15, 2025

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

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 15, 2025 7:10pm
sim ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 15, 2025 7:10pm

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 fixes organization creation failures by implementing proper subscription transfer and seat management functionality. The changes include new API endpoints and improved error handling for subscription operations.

  • New /api/user/subscription/[id]/transfer/route.ts implements secure subscription transfers between users and organizations with proper validation
  • Refactored seat management in /api/user/subscription/[id]/seats/route.ts with improved metadata handling and permission checks
  • Bug in test case /api/user/subscription/[id]/transfer/route.test.ts where 'should transfer a personal subscription' test expects failure (403) instead of success
  • Improved type safety and error handling in team-management.tsx with proper TypeScript types and consolidated seat management logic
  • Modified auth.ts to correctly handle both team and enterprise plan subscribers for organization creation

7 file(s) reviewed, 8 comment(s)
Edit PR Review Bot Settings | Greptile

@waleedlatif1 waleedlatif1 merged commit 1152a26 into main May 15, 2025
5 checks passed
waleedlatif1 added a commit that referenced this pull request May 15, 2025
… subscription updates (#361)

* fix(subscriptions): fixed organization creation failure introduced by subscription updates

* cleaned up tests

* run format
@waleedlatif1 waleedlatif1 deleted the fix/sub branch May 15, 2025 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants