Repository navigation
fix(credits): support custom currencies in grant APIs - #5318
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Credit grant API contracts api/spec/packages/aip/..., api/spec/packages/aip-client-javascript/src/..., api/v3/api.gen.go, api/v3/client/models_customers.go, openmeter/billing/charges/README.md |
The API specification and generated clients add managed custom-currency references to credit grants. Credit grant filters use billing currency codes. The JavaScript client also includes credit-balance and transaction schemas and types, and the documentation notes that grant reads expose the managed currency ID. |
Grant response mapping and filter serialization api/v3/handlers/customers/credits/convert.go, api/v3/client/customers_credits_grants.go |
Grant conversion sets the managed currency reference for custom-currency grants. Filter serialization converts the typed currency value to a query string. |
Filter and grant lifecycle coverage api/v3/test/credit_grants_test.go, api/v3/handlers/customers/credits/convert_test.go, e2e/creditgrant_customcurrency_v3_test.go, test/credits/creditgrant_customcurrency_test.go, test/credits/customcurrency_test.go |
Tests cover accepted and rejected filter values, response conversion, custom-currency grant lifecycles, listing, managed currency IDs, and pagination. The test setup also obtains default tax codes through TaxCodeEnv. |
Priority:
Estimated code review effort: 4 (Complex) | ~45 minutes
Change: Bug fix
Possibly related PRs
- openmeterio/openmeter#5316: Updates shared credit-balance and credit-transaction contracts that are also regenerated in this change.
- openmeterio/openmeter#5354: Continues the credit test setup migration to
TaxCodeEnv.ProvisionDefaultTaxCodes.
Suggested labels: area/api, area/billing, kind/bug
Suggested reviewers: turip
Merge Risk: 
Minimal · up to 55f73
-
The reviewed changes are mergeable after normal checks; no actionable grant-contract or lifecycle issue was established.
Pre-merge checks: 
4
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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 @coderabbitai help to get the list of available commands.
78281d9 to
490041c
Compare
490041c to
55f7334
Compare
Overview
Credit-grant list requests rejected custom currency codes, and grant responses omitted managed currency identity.
custom_currency.idconsistently from create, get, list, void, and external-settlement responses.Validation
Notes for reviewer
*BillingCurrencyCodeinstead of*string.Summary by CodeRabbit
New Features
Documentation
Tests


Confidence Score: 5/5
The PR appears safe to merge; no blocking issues were found.Summary
Grant list filters now accept custom currency codes, and grant responses expose
custom_currency.id.Reviews (4) · Last reviewed commit: "fix(credits): preserve currency filterin..." · Reviewed by Greptile