feat(customcurrencies): add configuration flag#4776
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (19)
📝 WalkthroughWalkthroughChangesCustom-currency enablement is now configured through Custom currency configuration
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Config
participant NewServer
participant CurrencyHandler
participant Client
Config->>NewServer: credits.customCurrenciesEnabled
NewServer->>CurrencyHandler: initialize with feature flag
Client->>CurrencyHandler: create currency or cost basis
CurrencyHandler-->>Client: 400 validation error when disabled
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Checkov (3.3.8)config.example.yamlTraceback (most recent call last): e2e/config.yamlTraceback (most recent call last): quickstart/config.yamlTraceback (most recent call last): Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Adds an explicit
credits.customCurrenciesEnabledopt-in for the experimental custom-currency flow.When enabled, the setting initializes custom-currency support for flat-fee, usage-based, and credit-purchase charges and allows custom currencies and their cost bases to be created through the API. It remains disabled by default, while quickstart and e2e opt in so the flow can be exercised in development and automated coverage.
The example configuration includes a prominent warning that the feature is experimental and can cause database inconsistencies until the full implementation is complete.
Validation
make lint-go-fastmake test-nocache(6,288 tests; only the out-of-scope Svix connectivity test failed because the local Svix service was not running)Greptile Summary
Adds an opt-in configuration flag for experimental custom-currency support.
Confidence Score: 5/5
The PR appears safe to merge with the custom-currency opt-in consistently applied across API mutations and production charge services.
The disabled default is preserved, both API constructions receive the configured value, and server, billing-worker, and jobs wiring propagate it to flat-fee, usage-based, and credit-purchase services without an uncovered production path.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD Config[credits.customCurrenciesEnabled] --> V1[v1 currency handler] Config --> V3[v3 currency handler] Config --> Registry[charges registry] Registry --> FlatFee[flat-fee service] Registry --> Usage[usage-based service] Registry --> Purchase[credit-purchase service] V1 --> Mutations[custom currency and cost-basis mutations] V3 --> Mutations FlatFee --> Charges[custom-currency charge creation] Usage --> Charges Purchase --> ChargesReviews (1): Last reviewed commit: "feat(customcurrencies): add configuratio..." | Re-trigger Greptile
Context used:
Summary by CodeRabbit
New Features
Bug Fixes
Documentation