fix(billing): increase free tier credits#862
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
There was a problem hiding this comment.
Greptile Summary
This PR increases the free tier credits from $5 to $10 across the Sim application by introducing a centralized constant DEFAULT_FREE_CREDITS and systematically replacing hardcoded values throughout the billing system.
The change introduces a new constant DEFAULT_FREE_CREDITS = 10 in apps/sim/lib/billing/constants.ts and updates 12 files across the billing infrastructure. The affected areas include:
- Core billing logic: Subscription state management, usage monitoring, and billing calculations
- Database schema: Default
currentUsageLimitfor new users in theuserStatstable - Frontend components: Subscription settings modal fallback values
- Authentication: User initialization with proper credit limits
- Organization billing: Team member usage limits and plan configurations
- Test suites: Updated test data and assertions to reflect the new credit amount
This change follows the codebase's modular architecture by centralizing billing constants, making the configuration more maintainable and reducing the risk of inconsistencies. The systematic approach ensures that all parts of the billing system—from user registration to usage monitoring to subscription management—consistently apply the new $10 free tier limit.
The implementation properly handles fallback scenarios where environment variables (FREE_TIER_COST_LIMIT) might not be set, ensuring the new default takes effect across development and production environments.
Confidence score: 4/5
- This PR is safe to merge with minimal risk as it's a straightforward configuration change that increases user benefits
- Score reflects the systematic approach and thorough coverage, with a minor deduction for one inconsistent hardcoded value
- Pay close attention to
apps/sim/lib/billing/core/usage.tsline 321 which still contains a hardcoded fallback value of 5 instead of using the new constant
13 files reviewed, no comments
waleedlatif1
left a comment
There was a problem hiding this comment.
@Sg312 lgtm, let's make sure to also update the envvar for FREE_TIER_COST_LIMIT to 10
* Update free tier to 10 * Lint
* Update free tier to 10 * Lint
* Update free tier to 10 * Lint
Summary
Increases free tier credits to 10 from 5
Type of Change
Testing
Tests
Checklist