fix(enterprise-billing): simplification to be fixed-cost #1196
Merged
waleedlatif1 merged 9 commits intostagingfrom Aug 31, 2025
Merged
fix(enterprise-billing): simplification to be fixed-cost #1196waleedlatif1 merged 9 commits intostagingfrom
waleedlatif1 merged 9 commits intostagingfrom
Conversation
Contributor
There was a problem hiding this comment.
Greptile Summary
This PR implements a significant architectural change to enterprise billing, transitioning from a complex usage-based, per-seat pricing model to a simplified fixed-cost subscription model. The changes affect multiple layers of the billing system:
Core Billing Logic Changes:
- The
EnterpriseSubscriptionMetadatainterface is simplified to only includemonthlyPriceinstead of complex seat-based pricing fields (perSeatPrice,maxSeats,fixedSeats) - The
getPlanPricingfunction is simplified to only accept a plan string parameter, removing subscription-specific calculations - Enterprise plans now return a
basePriceof 0 for overage calculations, effectively eliminating usage-based billing
Organization Management:
- Enterprise organizations now have their usage limits automatically set to match their monthly price during subscription setup
- Enterprise plans can no longer edit their usage limits through the UI or API
- Seat management for enterprise plans becomes fixed (no self-service changes)
Invoice and Billing Processing:
- Enterprise plans are excluded from overage invoice generation entirely
- Usage resets still occur at cycle end for proper accounting, but no additional charges are calculated
- The billing system now treats enterprise subscriptions as predictable fixed-cost arrangements
Authentication and Validation:
- Enhanced validation ensures enterprise subscriptions include valid
referenceIdandmonthlyPricemetadata - Automatic organization limit updates maintain consistency between billing configuration and usage controls
This refactoring integrates with the existing subscription management system by maintaining the same database schema while changing how enterprise billing calculations are performed. The changes preserve existing functionality for Pro and Team plans while creating a separate, simplified path for Enterprise customers.
Confidence score: 2/5
- This PR introduces breaking changes to enterprise billing with potential for billing calculation errors
- Score reflects significant architectural changes across critical billing components without complete testing
- Pay close attention to billing calculation files, enterprise subscription handling, and overage logic
11 files reviewed, 7 comments
waleedlatif1
added a commit
that referenced
this pull request
Sep 1, 2025
* fix(enterprise-billing): simplify * conceptual improvement * add seats to enterprise sub meta * correct type * fix UI * send emails to new enterprise users * fix fallback * fix merge conflict issue --------- Co-authored-by: waleedlatif1 <walif6@gmail.com>
arenadeveloper02
pushed a commit
to arenadeveloper02/p2-sim
that referenced
this pull request
Sep 19, 2025
…#1196) * fix(enterprise-billing): simplify * conceptual improvement * add seats to enterprise sub meta * correct type * fix UI * send emails to new enterprise users * fix fallback * fix merge conflict issue --------- Co-authored-by: waleedlatif1 <walif6@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Simplification to just auto-generate invoice with fixed cost of their respective configured product and standardized updating of period end and period start.
Type of Change
Testing
IN PROGRESS
Checklist