Skip to content

feat(productcatalog): support custom currencies - #4738

Merged
chrisgacsal merged 28 commits into
mainfrom
codex/custom-currency-productcatalog-subscription
Jul 30, 2026
Merged

chrisgacsal merged 28 commits into
mainfrom
codex/custom-currency-productcatalog-subscription

Conversation

@GAlexIHU

@GAlexIHU GAlexIHU commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • allow plans and add-ons to use either fiat or managed custom currencies
  • materialize and validate rate-card currency overrides, including plan single-fiat and add-on compatibility rules
  • resolve managed currencies and cost-basis availability through the currency domain
  • persist fiat currencies by code and custom currencies by managed-resource ID, with hydrated in-memory identities
  • temporarily reject custom-currency subscriptions until the follow-up subscription PR lands

Database migration

  • add mutually exclusive fiat-code/custom-currency-ID references for plans, add-ons, and their rate cards
  • preserve existing fiat codes and inherited rate-card currencies
  • enforce reference and priced-rate-card constraints at the database boundary

Validation

  • go test -tags=dynamic ./openmeter/productcatalog/... ./openmeter/subscription/service
  • go test -tags=dynamic ./tools/migrate -run '^TestProductCatalogCurrencyReferencesMigration$' -count=1
  • go vet -tags=dynamic ./openmeter/productcatalog/... ./openmeter/subscription/service ./tools/migrate

Built on the currency domain contract introduced by #4701.

Summary by CodeRabbit

  • New Features

    • Added support for managed custom currencies end-to-end, including custom currency codes in billing APIs and SDK typings.
    • Added optional currency overrides on rate cards (inherited from the containing plan/add-on when omitted).
    • Added currency + cost-basis validation with clear error reporting, including ensuring overrides require pricing.
  • Bug Fixes

    • Prevented archived/deleted custom currencies from being resolved and reused.
    • Improved handling of currency overrides in legacy and subscription flows (override resources are excluded/rejected where unsupported, and unknown custom currencies now return the correct “not found” response).

@GAlexIHU GAlexIHU added the release-note/feature Release note: Exciting New Features label Jul 17, 2026
@greptile-apps

greptile-apps Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Too many files changed for review. (167 files found, 100 file limit)

Bypass the limit by tagging @greptile-apps to review.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This change adds managed custom-currency references and rate-card overrides across product-catalog models, persistence, validation, APIs, service wiring, subscription validation, and v1 compatibility handling.

Changes

Custom currency model and storage

Layer / File(s) Summary
Currency references and persistence
openmeter/currencies/..., openmeter/ent/schema/...
Currency references distinguish fiat codes from managed custom-currency IDs, with database constraints, cost-basis loading, eager loading, and deletion restrictions.
Catalog behavior and resolution
openmeter/productcatalog/...
Plans, add-ons, rate cards, and plan-add-on assignments support overrides, effective currencies, identity preservation, validation, and code-based JSON serialization.
API and runtime integration
api/spec/..., api/v3/..., app/common/..., cmd/.../wire_gen.go
API contracts accept custom currencies and rate-card overrides; conversion handlers and runtime wiring use currency resolvers.
Compatibility and validation coverage
openmeter/subscription/..., e2e/..., test/..., tools/migrate/...
Unsupported subscription and v1 paths reject or exclude custom-currency overrides, with migration and integration coverage added.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant API
  participant PlanService
  participant CurrencyResolver
  participant ProductCatalogAdapter
  participant Database

  API->>PlanService: Submit plan currency references
  PlanService->>CurrencyResolver: Resolve currency identities
  CurrencyResolver->>Database: Load custom currency and cost basis
  Database-->>CurrencyResolver: Return currency identity
  CurrencyResolver-->>PlanService: Return resolved reference
  PlanService->>ProductCatalogAdapter: Persist plan and rate-card currencies
  ProductCatalogAdapter->>Database: Store fiat code or custom currency ID
  Database-->>ProductCatalogAdapter: Reload currency relationships
  ProductCatalogAdapter-->>API: Return catalog resource
Loading

Possibly related PRs

Suggested labels: area/product-catalog, area/subscriptions

Suggested reviewers: chrisgacsal, mark-vass-konghq, tothandras

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 21.90% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: product catalog support for custom currencies.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/custom-currency-productcatalog-subscription

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@GAlexIHU
GAlexIHU marked this pull request as ready for review July 17, 2026 14:48
@GAlexIHU
GAlexIHU requested a review from a team as a code owner July 17, 2026 14:48

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 12

🧹 Nitpick comments (3)
openmeter/productcatalog/currencyresolver_test.go (1)

184-193: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Avoid adding the local must... wrapper.

Please inline these builder calls or use an existing currency fixture; this helper only hides a short operation.

As per coding guidelines, do not add local wrappers such as must when existing helpers or direct operations suffice.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@openmeter/productcatalog/currencyresolver_test.go` around lines 184 - 193,
Remove the local mustFiatCurrency helper and replace its call sites with direct
currencyx.NewCurrencyBuilder(...).WithCode(...).Build() usage or an existing
currency fixture. Preserve the current fiat currency construction and error
assertions at each call site.

Source: Coding guidelines

openmeter/productcatalog/addon/serializer_test.go (1)

32-43: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cover the usage-based serialization branch too.

The new serializer switches separately on flat-fee and usage-based rate cards, but this round-trip only exercises flat-fee. A table case using UsageBasedRateCard would catch regressions in that branch.

As per path instructions, tests should comprehensively cover introduced behavior.

Also applies to: 67-73

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@openmeter/productcatalog/addon/serializer_test.go` around lines 32 - 43,
Extend the serializer round-trip test cases in the relevant test function to
include a UsageBasedRateCard fixture alongside the existing FlatFeeRateCard
case. Populate the usage-based card with the required metadata and usage pricing
fields, then assert it round-trips successfully so the separate usage-based
serialization branch is covered.

Source: Path instructions

pkg/currencyx/code.go (1)

39-44: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Skip custom length check for empty inputs to keep validation errors tidy.

Since an empty string will evaluate IsFiat() as false, the code currently emits two errors when no currency is provided: "currency code is required" and "custom currency code must be between 3 and 64 characters".

We can skip the latter check if the code is completely empty to keep the returned error slightly more concise!

💡 Suggested refactor
-	if !c.IsFiat() {
+	if c != "" && !c.IsFiat() {
		if length := len(code); length < CustomCurrencyCodeMinLength || length > CustomCurrencyCodeMaxLength {
			errs = append(errs, fmt.Errorf("custom currency code must be between %d and %d characters", CustomCurrencyCodeMinLength, CustomCurrencyCodeMaxLength))
		}
	}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/currencyx/code.go` around lines 39 - 44, Update the custom currency
length validation in the IsFiat check to run only when code is non-empty, so
empty input produces only the existing required-code error. Preserve the current
3–64 character validation for non-empty custom currency codes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@openmeter/currencies/currency.go`:
- Around line 83-87: The managed custom currency ID validation error in the
currency validation method is missing field context. Update the `c.IsCustom() &&
c.ID == ""` branch to wrap its error with the `code:` field prefix, matching the
existing code validation failure, while preserving collection through
`errors.Join(errs...)` and `models.NewNillableGenericValidationError`.

In `@openmeter/productcatalog/addon.go`:
- Around line 90-96: Update the currency validation branch in the addon
validation method to wrap and retain the concrete error returned by
m.Currency.Validate() alongside ErrCurrencyInvalid, while preserving the
existing currency field selector and collecting the error in errs. Keep the
nil-currency handling unchanged.

In `@openmeter/productcatalog/addon/service.go`:
- Around line 410-424: The currency-preservation logic around persistedCurrency
and updatedCurrency must only replace code-only currency values, not an
explicitly managed update identity. Before calling rateCard.ChangeMeta, detect
when updatedCurrency is already a ManagedCurrency with a non-empty ID and skip
preservation; retain the existing same-code behavior for code-only updates and
continue preserving the persisted identity there.

In `@openmeter/productcatalog/currencyresolver.go`:
- Around line 150-153: Update the existing.IsCustom branch in the currency
resolution flow to avoid returning ManagedCurrency values solely because GetID()
is non-empty; re-resolve managed custom currencies by their ID or verify their
concrete type belongs to the requested namespace before returning. Preserve the
current fast path only for currencies proven to match namespace, and add a test
covering a managed custom currency from another namespace.

In `@openmeter/productcatalog/currencyresolver/resolver_test.go`:
- Around line 22-27: Update mockCurrencyService.ListCurrencies to honor
params.Page and the requested page size instead of returning all currencies. Add
a regression test with two archived currencies before an active matching
currency, ensuring Resolve still finds the active result. Update Resolve to
query active currencies or continue paging until a valid match is found.

In `@openmeter/productcatalog/currencyresolver/resolver.go`:
- Around line 45-68: The currency lookup around ListCurrencies currently
paginates before excluding archived entries, so active matches can be missed.
Push the DeletedAt-is-nil predicate into the ListCurrencies filter for custom
currencies, or continue fetching pages until activeCurrencies establishes a
definitive not-found or unique result; preserve the existing uniqueness and
error handling behavior.

In `@openmeter/productcatalog/errors.go`:
- Around line 265-315: Rename the new error-code constants in this section and
the additionally referenced declaration from the ErrCode... form to the required
ErrorCode... form, including ErrorCodeRateCardCurrencyOverrideNotAllowed,
ErrorCodeRateCardCurrencyOverrideRedundant,
ErrorCodeRateCardCurrencyRequiresPrice, ErrorCodePlanMultipleFiatCurrencies,
ErrorCodeCurrencyNotFound, and ErrorCodeCurrencyCostBasisNotFound. Update every
corresponding reference while leaving the exported validation issue variables
unchanged.

In `@openmeter/productcatalog/plan.go`:
- Around line 382-388: Update the currency validation branches in the plan
validation method so both missing-currency and Currency.Validate() failures are
wrapped with the “currency” field context. Preserve the underlying validation
error as the cause when wrapping the Currency.Validate() result, rather than
replacing it with ErrCurrencyInvalid.

In `@openmeter/productcatalog/plan/ratecard.go`:
- Around line 103-224: Remove the map-based currency rewriting from RateCard
MarshalJSON and UnmarshalJSON. In MarshalJSON, delegate directly to json.Marshal
on r.RateCard; in UnmarshalJSON, unmarshal serialized.RateCard directly into the
type-specific rateCard selected by serialized.Type. Delete
marshalRateCardForJSON, rateCardJSONWithoutCurrency, and
setRateCardCurrencyIdentity, while preserving existing error handling and
managed-field assignment.
- Around line 103-224: Remove the map-based currency rewriting from
RateCard.MarshalJSON and RateCard.UnmarshalJSON. Delegate serialization and
deserialization directly to json.Marshal and json.Unmarshal on the concrete
FlatFeeRateCard and UsageBasedRateCard values, then delete
marshalRateCardForJSON, rateCardJSONWithoutCurrency, and
setRateCardCurrencyIdentity while preserving the existing type selection and
managed-field handling.

In `@openmeter/productcatalog/plan/service/service_test.go`:
- Around line 924-928: Strengthen the assertions in the stored rate-card test
around storedRateCard.Currency and EffectiveCurrency to validate the managed
currency resource identity, not only its code. Assert both values are
currencyx.ManagedCurrency instances and compare their IDs with the expected
custom managed currency ID, preserving the existing code checks and ensuring
hydration cannot resolve a different resource sharing CREDITS.

In `@openmeter/productcatalog/planaddon/service/planaddon.go`:
- Around line 148-150: Update the create flow around ValidateWith to first run
the full plan-addon validation, mirroring the update path, before executing the
resolver-backed currency validation. Ensure invalid phases, keys, quantities,
cadence, and overlays are rejected before persistence while retaining the
existing currency-only check afterward.

---

Nitpick comments:
In `@openmeter/productcatalog/addon/serializer_test.go`:
- Around line 32-43: Extend the serializer round-trip test cases in the relevant
test function to include a UsageBasedRateCard fixture alongside the existing
FlatFeeRateCard case. Populate the usage-based card with the required metadata
and usage pricing fields, then assert it round-trips successfully so the
separate usage-based serialization branch is covered.

In `@openmeter/productcatalog/currencyresolver_test.go`:
- Around line 184-193: Remove the local mustFiatCurrency helper and replace its
call sites with direct currencyx.NewCurrencyBuilder(...).WithCode(...).Build()
usage or an existing currency fixture. Preserve the current fiat currency
construction and error assertions at each call site.

In `@pkg/currencyx/code.go`:
- Around line 39-44: Update the custom currency length validation in the IsFiat
check to run only when code is non-empty, so empty input produces only the
existing required-code error. Preserve the current 3–64 character validation for
non-empty custom currency codes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 37f5e766-91f8-4e02-be44-f8cad9ee161c

📥 Commits

Reviewing files that changed from the base of the PR and between 02fbd9b and 852168c.

⛔ Files ignored due to path filters (37)
  • api/v3/openapi.yaml is excluded by !**/openapi.yaml
  • openmeter/ent/db/addon.go is excluded by !**/ent/db/**
  • openmeter/ent/db/addon/addon.go is excluded by !**/ent/db/**
  • openmeter/ent/db/addon/where.go is excluded by !**/ent/db/**
  • openmeter/ent/db/addon_create.go is excluded by !**/ent/db/**
  • openmeter/ent/db/addon_query.go is excluded by !**/ent/db/**
  • openmeter/ent/db/addon_update.go is excluded by !**/ent/db/**
  • openmeter/ent/db/addonratecard.go is excluded by !**/ent/db/**
  • openmeter/ent/db/addonratecard/addonratecard.go is excluded by !**/ent/db/**
  • openmeter/ent/db/addonratecard/where.go is excluded by !**/ent/db/**
  • openmeter/ent/db/addonratecard_create.go is excluded by !**/ent/db/**
  • openmeter/ent/db/addonratecard_query.go is excluded by !**/ent/db/**
  • openmeter/ent/db/addonratecard_update.go is excluded by !**/ent/db/**
  • openmeter/ent/db/client.go is excluded by !**/ent/db/**
  • openmeter/ent/db/customcurrency.go is excluded by !**/ent/db/**
  • openmeter/ent/db/customcurrency/customcurrency.go is excluded by !**/ent/db/**
  • openmeter/ent/db/customcurrency/where.go is excluded by !**/ent/db/**
  • openmeter/ent/db/customcurrency_create.go is excluded by !**/ent/db/**
  • openmeter/ent/db/customcurrency_query.go is excluded by !**/ent/db/**
  • openmeter/ent/db/customcurrency_update.go is excluded by !**/ent/db/**
  • openmeter/ent/db/migrate/schema.go is excluded by !**/ent/db/**
  • openmeter/ent/db/mutation.go is excluded by !**/ent/db/**
  • openmeter/ent/db/plan.go is excluded by !**/ent/db/**
  • openmeter/ent/db/plan/plan.go is excluded by !**/ent/db/**
  • openmeter/ent/db/plan/where.go is excluded by !**/ent/db/**
  • openmeter/ent/db/plan_create.go is excluded by !**/ent/db/**
  • openmeter/ent/db/plan_query.go is excluded by !**/ent/db/**
  • openmeter/ent/db/plan_update.go is excluded by !**/ent/db/**
  • openmeter/ent/db/planratecard.go is excluded by !**/ent/db/**
  • openmeter/ent/db/planratecard/planratecard.go is excluded by !**/ent/db/**
  • openmeter/ent/db/planratecard/where.go is excluded by !**/ent/db/**
  • openmeter/ent/db/planratecard_create.go is excluded by !**/ent/db/**
  • openmeter/ent/db/planratecard_query.go is excluded by !**/ent/db/**
  • openmeter/ent/db/planratecard_update.go is excluded by !**/ent/db/**
  • openmeter/ent/db/runtime.go is excluded by !**/ent/db/**
  • openmeter/ent/db/setorclear.go is excluded by !**/ent/db/**
  • tools/migrate/migrations/atlas.sum is excluded by !**/*.sum, !**/*.sum
📒 Files selected for processing (117)
  • api/spec/packages/aip-client-javascript/src/index.ts
  • api/spec/packages/aip-client-javascript/src/models/schemas.ts
  • api/spec/packages/aip-client-javascript/src/models/types.ts
  • api/spec/packages/aip/src/currencies/currency.tsp
  • api/spec/packages/aip/src/productcatalog/plan.tsp
  • api/spec/packages/aip/src/productcatalog/ratecard.tsp
  • api/v3/api.gen.go
  • api/v3/client/models_plans.go
  • api/v3/client/models_shared.go
  • api/v3/handlers/addons/convert.go
  • api/v3/handlers/plans/convert.go
  • api/v3/handlers/plans/convert_test.go
  • app/common/openmeter_billingworker.go
  • app/common/productcatalog.go
  • cmd/billing-worker/wire_gen.go
  • cmd/jobs/internal/wire.go
  • cmd/jobs/internal/wire_gen.go
  • cmd/server/wire_gen.go
  • openmeter/billing/derived.gen.go
  • openmeter/billing/models/stddetailedline/derived.gen.go
  • openmeter/billing/worker/subscriptionsync/service/base_test.go
  • openmeter/billing/worker/subscriptionsync/service/creditsonly_test.go
  • openmeter/billing/worker/subscriptionsync/service/sync_credittheninvoice_test.go
  • openmeter/billing/worker/subscriptionsync/service/sync_test.go
  • openmeter/billing/worker/subscriptionsync/service/syncbillinganchor_test.go
  • openmeter/currencies/adapter/currencies.go
  • openmeter/currencies/adapter/mapping.go
  • openmeter/currencies/adapter/mapping_test.go
  • openmeter/currencies/currency.go
  • openmeter/currencies/currency_test.go
  • openmeter/ent/schema/addon.go
  • openmeter/ent/schema/custom_currencies.go
  • openmeter/ent/schema/productcatalog.go
  • openmeter/ent/schema/ratecard.go
  • openmeter/productcatalog/adapter/feature_test.go
  • openmeter/productcatalog/addon.go
  • openmeter/productcatalog/addon/adapter/adapter_test.go
  • openmeter/productcatalog/addon/adapter/addon.go
  • openmeter/productcatalog/addon/adapter/mapping.go
  • openmeter/productcatalog/addon/assert.go
  • openmeter/productcatalog/addon/httpdriver/addon.go
  • openmeter/productcatalog/addon/httpdriver/mapping.go
  • openmeter/productcatalog/addon/ratecard.go
  • openmeter/productcatalog/addon/serializer.go
  • openmeter/productcatalog/addon/serializer_test.go
  • openmeter/productcatalog/addon/service.go
  • openmeter/productcatalog/addon/service/addon.go
  • openmeter/productcatalog/addon/service/service.go
  • openmeter/productcatalog/addon/service/service_test.go
  • openmeter/productcatalog/addon_test.go
  • openmeter/productcatalog/currency_test.go
  • openmeter/productcatalog/currencyresolver.go
  • openmeter/productcatalog/currencyresolver/resolver.go
  • openmeter/productcatalog/currencyresolver/resolver_test.go
  • openmeter/productcatalog/currencyresolver_test.go
  • openmeter/productcatalog/errors.go
  • openmeter/productcatalog/plan.go
  • openmeter/productcatalog/plan/adapter/adapter_test.go
  • openmeter/productcatalog/plan/adapter/mapping.go
  • openmeter/productcatalog/plan/adapter/phase.go
  • openmeter/productcatalog/plan/adapter/plan.go
  • openmeter/productcatalog/plan/assert.go
  • openmeter/productcatalog/plan/httpdriver/mapping.go
  • openmeter/productcatalog/plan/httpdriver/plan.go
  • openmeter/productcatalog/plan/plan.go
  • openmeter/productcatalog/plan/ratecard.go
  • openmeter/productcatalog/plan/ratecard_test.go
  • openmeter/productcatalog/plan/serializer.go
  • openmeter/productcatalog/plan/serializer_test.go
  • openmeter/productcatalog/plan/service.go
  • openmeter/productcatalog/plan/service/plan.go
  • openmeter/productcatalog/plan/service/service.go
  • openmeter/productcatalog/plan/service/service_test.go
  • openmeter/productcatalog/plan_test.go
  • openmeter/productcatalog/planaddon.go
  • openmeter/productcatalog/planaddon/adapter/planaddon.go
  • openmeter/productcatalog/planaddon/httpdriver/planaddon.go
  • openmeter/productcatalog/planaddon/service.go
  • openmeter/productcatalog/planaddon/service/planaddon.go
  • openmeter/productcatalog/planaddon/service/service.go
  • openmeter/productcatalog/planaddon/service/service_test.go
  • openmeter/productcatalog/planaddon_test.go
  • openmeter/productcatalog/ratecard.go
  • openmeter/productcatalog/ratecard_test.go
  • openmeter/productcatalog/subscription/http/mapping.go
  • openmeter/productcatalog/subscription/plan.go
  • openmeter/productcatalog/testutils/addon.go
  • openmeter/productcatalog/testutils/env.go
  • openmeter/productcatalog/testutils/plan.go
  • openmeter/subscription/addon/diff/restore_test.go
  • openmeter/subscription/addon/events_test.go
  • openmeter/subscription/addon/repo/subscriptionaddon.go
  • openmeter/subscription/serialize_test.go
  • openmeter/subscription/service/servicevalidation.go
  • openmeter/subscription/service/servicevalidation_test.go
  • openmeter/subscription/testutils/addon.go
  • openmeter/subscription/testutils/builder.go
  • openmeter/subscription/testutils/service.go
  • openmeter/subscription/workflow/service/addon_test.go
  • openmeter/subscription/workflow/service/subscription_test.go
  • pkg/currencyx/code.go
  • pkg/currencyx/code_test.go
  • pkg/currencyx/currency.go
  • test/billing/subscription_suite.go
  • test/billing/subscription_test.go
  • test/customer/customer.go
  • test/customer/subject.go
  • test/customer/testenv.go
  • test/subscription/scenario_editaligned_test.go
  • test/subscription/scenario_editcancel_test.go
  • test/subscription/scenario_entinnextphase_test.go
  • test/subscription/scenario_firstofmonth_test.go
  • tools/migrate/migrations/20260717143312_add_rate_card_currency.down.sql
  • tools/migrate/migrations/20260717143312_add_rate_card_currency.up.sql
  • tools/migrate/migrations/20260717143818_add_product_catalog_currency_references.down.sql
  • tools/migrate/migrations/20260717143818_add_product_catalog_currency_references.up.sql
  • tools/migrate/productcatalog_currency_references_test.go

Comment thread openmeter/currencies/currency.go Resolved
Comment thread openmeter/productcatalog/addon.go Resolved
Comment thread openmeter/productcatalog/errors.go Resolved
Comment thread openmeter/productcatalog/plan.go Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/productcatalog/custom_currency_test.go`:
- Around line 28-31: Update newTestEnv to set POSTGRES_HOST to 127.0.0.1 before
calling pctestutils.NewTestEnv(t), ensuring the shared database-backed test
setup uses the explicit PostgreSQL host.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3743cd13-8049-4302-a3ed-351a095cba2c

📥 Commits

Reviewing files that changed from the base of the PR and between d34548e and 6a58931.

📒 Files selected for processing (4)
  • api/v3/handlers/addons/convert.go
  • api/v3/handlers/addons/convert_test.go
  • e2e/v1readsurface_currencyoverride_test.go
  • test/productcatalog/custom_currency_test.go

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/common/productcatalog.go (1)

88-138: 🎯 Functional Correctness | 🔴 Critical | 🏗️ Heavy lift

Build-breaking: costBasisChecker param missing from NewPlanService/NewAddonService/NewPlanAddonService, but wire_gen.go already calls them with it. One root cause — app/common/productcatalog.go only added currencyResolver to these three constructors this round, while both generated wire files were updated/regenerated expecting an additional costBasisChecker argument that doesn't exist yet on the callee side. This won't compile.

  • app/common/productcatalog.go#L88-L138: add the costBasisChecker dependency to NewPlanService, NewAddonService, and NewPlanAddonService, threading it into planservice.Config/addonservice.Config/planaddonservice.Config.
  • cmd/billing-worker/wire_gen.go#L328-L350: regenerate after the productcatalog.go fix (calls at L328, L339, L350 currently pass an extra costBasisChecker arg the constructors don't accept) — do not hand-edit this generated file.
  • cmd/server/wire_gen.go#L225-L350: regenerate after the productcatalog.go fix (calls at L225, L339, L350 have the same extra-argument problem) — do not hand-edit this generated file.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/common/productcatalog.go` around lines 88 - 138, Add the costBasisChecker
dependency to NewPlanService, NewAddonService, and NewPlanAddonService, and pass
it into the corresponding planservice.Config, addonservice.Config, and
planaddonservice.Config. Regenerate cmd/billing-worker/wire_gen.go lines 328-350
and cmd/server/wire_gen.go lines 225-350 after the constructor signatures are
corrected; do not hand-edit generated files.

Source: Path instructions

🧹 Nitpick comments (3)
openmeter/billing/charges/flatfee/charge_test.go (1)

139-157: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicate newCustomCurrency test helper across two packages. Both files independently reimplement construction of a namespaced managed custom currency, when openmeter/currencies/testutils.NewManagedCurrency (already used elsewhere in this PR, e.g. mapping_test.go) does the same job.

  • openmeter/billing/charges/flatfee/charge_test.go#L139-L157: replace the local newCustomCurrency body with a call to currencies/testutils.NewManagedCurrency(t, namespace, ulid.Make().String(), "TOKENS") (or similar), dropping the local models/manual struct construction.
  • openmeter/billing/charges/usagebased/charge_test.go#L138-L156: same replacement — drop the duplicate helper and delegate to the shared NewManagedCurrency constructor.

As per path instructions for **/*_test.go: "avoid duplicate test helpers, and add helpers only when reused or when they express non-obvious domain semantics."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@openmeter/billing/charges/flatfee/charge_test.go` around lines 139 - 157,
Replace the duplicate newCustomCurrency helper with
currencies/testutils.NewManagedCurrency in both
openmeter/billing/charges/flatfee/charge_test.go:139-157 and
openmeter/billing/charges/usagebased/charge_test.go:138-156, passing the test
handle, namespace, generated ID, and "TOKENS" code. Remove now-unused manual
currency/model construction imports while preserving existing callers.

Source: Path instructions

openmeter/currencies/adapter/currencies.go (2)

369-451: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider deduplicating WithActiveCostBasis and WithActiveAndScheduledCostBasis.

These two helpers share ~90% of the same SQL predicate (deleted-currency retention branch is identical; the only difference is whether the EffectiveFrom <= at check is applied). Extracting the shared "deleted-currency" branch and parameterizing the "include scheduled" behavior would reduce the chance of the two drifting apart (as nearly happened with the field-constant slip above).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@openmeter/currencies/adapter/currencies.go` around lines 369 - 451,
Deduplicate the nearly identical predicates in WithActiveCostBasis and
WithActiveAndScheduledCostBasis by extracting their shared cost-basis filtering
logic and parameterizing whether the active query applies the EffectiveFrom <=
at constraint. Keep the deleted-currency retention branch identical in both
helpers, and have each public helper delegate to the shared implementation with
the appropriate scheduled behavior.

379-413: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

Use the customcurrency field constant on the joined currency table alias.

ct aliases the customcurrency table here, so this comparison should use ct.C(customcurrency.FieldDeletedAt) to match the adjacent predicates. As-is it’s still using the right db column name for now, but it makes the intent confusing and is easy to get wrong if the generated constants diverge.

Applies to both WithActiveCostBasis and WithActiveAndScheduledCostBasis.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@openmeter/currencies/adapter/currencies.go` around lines 379 - 413, Update
both WithActiveCostBasis and WithActiveAndScheduledCostBasis to reference the
joined customcurrency table alias consistently: use
ct.C(customcurrency.FieldDeletedAt) for the comparison identified by the review,
matching the adjacent predicates and preserving the existing filtering behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cmd/server/wire_gen.go`:
- Line 225: Update the source constructors NewAddonService, NewPlanService, and
NewPlanAddonService in productcatalog.go to accept the costBasisChecker argument
expected by their callers, then regenerate wire_gen.go using the appropriate
Make target. Do not edit the generated wire file directly.

In `@openmeter/currencies/currency.go`:
- Around line 115-141: Update WithCurrency to assign CustomCurrencyID only when
the resolved currency is custom, matching the guard used by
Currency.Reference(); leave it nil for fiat currencies so the subsequent
Validate call succeeds. Add a regression test in currency_test.go covering
successful WithCurrency resolution with a fiat Currency.

---

Outside diff comments:
In `@app/common/productcatalog.go`:
- Around line 88-138: Add the costBasisChecker dependency to NewPlanService,
NewAddonService, and NewPlanAddonService, and pass it into the corresponding
planservice.Config, addonservice.Config, and planaddonservice.Config. Regenerate
cmd/billing-worker/wire_gen.go lines 328-350 and cmd/server/wire_gen.go lines
225-350 after the constructor signatures are corrected; do not hand-edit
generated files.

---

Nitpick comments:
In `@openmeter/billing/charges/flatfee/charge_test.go`:
- Around line 139-157: Replace the duplicate newCustomCurrency helper with
currencies/testutils.NewManagedCurrency in both
openmeter/billing/charges/flatfee/charge_test.go:139-157 and
openmeter/billing/charges/usagebased/charge_test.go:138-156, passing the test
handle, namespace, generated ID, and "TOKENS" code. Remove now-unused manual
currency/model construction imports while preserving existing callers.

In `@openmeter/currencies/adapter/currencies.go`:
- Around line 369-451: Deduplicate the nearly identical predicates in
WithActiveCostBasis and WithActiveAndScheduledCostBasis by extracting their
shared cost-basis filtering logic and parameterizing whether the active query
applies the EffectiveFrom <= at constraint. Keep the deleted-currency retention
branch identical in both helpers, and have each public helper delegate to the
shared implementation with the appropriate scheduled behavior.
- Around line 379-413: Update both WithActiveCostBasis and
WithActiveAndScheduledCostBasis to reference the joined customcurrency table
alias consistently: use ct.C(customcurrency.FieldDeletedAt) for the comparison
identified by the review, matching the adjacent predicates and preserving the
existing filtering behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c3cdd22d-470b-4c9c-8946-9b45d7fef553

📥 Commits

Reviewing files that changed from the base of the PR and between 6a58931 and 576a7a9.

⛔ Files ignored due to path filters (13)
  • api/v3/openapi.yaml is excluded by !**/openapi.yaml
  • openmeter/ent/db/addon.go is excluded by !**/ent/db/**
  • openmeter/ent/db/addon/addon.go is excluded by !**/ent/db/**
  • openmeter/ent/db/addon/where.go is excluded by !**/ent/db/**
  • openmeter/ent/db/addon_create.go is excluded by !**/ent/db/**
  • openmeter/ent/db/addon_query.go is excluded by !**/ent/db/**
  • openmeter/ent/db/addon_update.go is excluded by !**/ent/db/**
  • openmeter/ent/db/addonratecard.go is excluded by !**/ent/db/**
  • openmeter/ent/db/addonratecard/addonratecard.go is excluded by !**/ent/db/**
  • openmeter/ent/db/addonratecard/where.go is excluded by !**/ent/db/**
  • openmeter/ent/db/addonratecard_create.go is excluded by !**/ent/db/**
  • openmeter/ent/db/addonratecard_query.go is excluded by !**/ent/db/**
  • openmeter/ent/db/addonratecard_update.go is excluded by !**/ent/db/**
📒 Files selected for processing (43)
  • api/spec/packages/aip-client-javascript/src/index.ts
  • api/spec/packages/aip-client-javascript/src/models/schemas.ts
  • api/spec/packages/aip-client-javascript/src/models/types.ts
  • api/spec/packages/aip/src/currencies/currency.tsp
  • api/spec/packages/aip/src/productcatalog/plan.tsp
  • api/spec/packages/aip/src/productcatalog/ratecard.tsp
  • api/v3/api.gen.go
  • api/v3/client/models_plans.go
  • api/v3/client/models_shared.go
  • api/v3/handlers/addons/convert.go
  • api/v3/handlers/addons/convert_test.go
  • api/v3/handlers/currencies/convert.go
  • api/v3/handlers/currencies/list_test.go
  • api/v3/handlers/plans/convert.go
  • api/v3/handlers/plans/convert_test.go
  • app/common/openmeter_billingworker.go
  • app/common/productcatalog.go
  • cmd/billing-worker/wire_gen.go
  • cmd/jobs/internal/wire_gen.go
  • cmd/server/wire_gen.go
  • e2e/plans_v3_test.go
  • e2e/v1readsurface_currencyoverride_test.go
  • openmeter/billing/charges/flatfee/charge_test.go
  • openmeter/billing/charges/usagebased/charge_test.go
  • openmeter/billing/worker/subscriptionsync/service/base_test.go
  • openmeter/billing/worker/subscriptionsync/service/creditsonly_test.go
  • openmeter/billing/worker/subscriptionsync/service/sync_credittheninvoice_test.go
  • openmeter/billing/worker/subscriptionsync/service/sync_test.go
  • openmeter/billing/worker/subscriptionsync/service/syncbillinganchor_test.go
  • openmeter/currencies/adapter/currencies.go
  • openmeter/currencies/adapter/currencies_test.go
  • openmeter/currencies/adapter/mapping.go
  • openmeter/currencies/adapter/mapping_test.go
  • openmeter/currencies/costbasis.go
  • openmeter/currencies/costbasis_test.go
  • openmeter/currencies/currency.go
  • openmeter/currencies/currency_test.go
  • openmeter/currencies/currencyresolver/resolver.go
  • openmeter/currencies/currencyresolver/resolver_test.go
  • openmeter/currencies/service.go
  • openmeter/currencies/service/service.go
  • openmeter/currencies/service/service_test.go
  • openmeter/currencies/testutils/currency.go
🚧 Files skipped from review as they are similar to previous changes (15)
  • app/common/openmeter_billingworker.go
  • openmeter/billing/worker/subscriptionsync/service/base_test.go
  • openmeter/billing/worker/subscriptionsync/service/syncbillinganchor_test.go
  • api/spec/packages/aip/src/productcatalog/ratecard.tsp
  • api/v3/client/models_shared.go
  • e2e/plans_v3_test.go
  • api/v3/client/models_plans.go
  • api/v3/handlers/plans/convert_test.go
  • openmeter/billing/worker/subscriptionsync/service/creditsonly_test.go
  • api/v3/handlers/plans/convert.go
  • api/v3/handlers/addons/convert.go
  • openmeter/billing/worker/subscriptionsync/service/sync_test.go
  • cmd/jobs/internal/wire_gen.go
  • openmeter/billing/worker/subscriptionsync/service/sync_credittheninvoice_test.go
  • api/v3/handlers/addons/convert_test.go

Comment thread cmd/server/wire_gen.go Resolved
Comment thread openmeter/currencies/currency.go Resolved
@chrisgacsal
chrisgacsal force-pushed the codex/custom-currency-productcatalog-subscription branch from 576a7a9 to 9fb97cf Compare July 28, 2026 05:10

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
openmeter/productcatalog/addon/service.go (1)

375-405: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Preservation logic can silently clobber an explicit custom-currency ID on update.

When persisted and updated currencies share the same Code, this always overwrites meta.Currency with the persisted identity — even if updatedCurrency already carries its own explicit CustomCurrencyID pointing at a different (e.g. newly recreated) managed currency. That silently reverts an intentional identity change back to the old resource.

This is the same overwrite risk flagged on an earlier version of this function (back when it used currencyx.ManagedCurrency); the field names changed but the gap carried over into the new currencies.CurrencyReference-based logic. Worth guarding explicitly:

🐛 Proposed guard
 		persistedCurrency := persistedRateCard.AsMeta().Currency
 		updatedCurrency := rateCard.AsMeta().Currency
 		if persistedCurrency == nil || !persistedCurrency.IsCustom() || persistedCurrency.CustomCurrencyID == nil {
 			continue
 		}
 		if updatedCurrency == nil || persistedCurrency.Code != updatedCurrency.Code {
 			continue
 		}
+		if updatedCurrency.CustomCurrencyID != nil && *updatedCurrency.CustomCurrencyID != *persistedCurrency.CustomCurrencyID {
+			continue
+		}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@openmeter/productcatalog/addon/service.go` around lines 375 - 405, Update
preserveAddonRateCardCurrencyIdentities to preserve the persisted custom
currency only when updatedCurrency does not already contain an explicit
CustomCurrencyID. Keep the existing code-match and persisted-identity checks,
but skip the ChangeMeta overwrite when the updated reference points to its own
managed currency.
🧹 Nitpick comments (1)
openmeter/productcatalog/currencyresolver/resolver.go (1)

148-160: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider pulling the currency conversion out of the ChangeMeta closure.

The closure does a non-trivial domain conversion (Currency.WithCurrency(...) + error wrap) inline. As per coding guidelines, domain conversion should live in a named helper rather than inside a local closure — extracting a small resolveRateCardCurrency(rc, resolvedCurrency) helper would keep this readable and testable in isolation.

As per coding guidelines, "Do not hide non-trivial branching, validation, persistence mapping, or domain conversion inside local closures; use named helpers instead."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@openmeter/productcatalog/currencyresolver/resolver.go` around lines 148 -
160, The ChangeMeta closure in the rate-card currency resolution flow contains
non-trivial currency conversion and error wrapping. Extract this logic into a
named resolveRateCardCurrency helper accepting the rate card and resolved
currency, then have the closure call that helper while retaining the existing
error context and ChangeMeta behavior.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@openmeter/productcatalog/plan.go`:
- Around line 195-197: Update the empty currency-code branch in the plan
Validate() method to wrap ErrCurrencyInvalid with the same currency field
selector used by the subsequent validation branches. Preserve the existing
aggregated validation-error flow so API consumers receive the field context.

---

Duplicate comments:
In `@openmeter/productcatalog/addon/service.go`:
- Around line 375-405: Update preserveAddonRateCardCurrencyIdentities to
preserve the persisted custom currency only when updatedCurrency does not
already contain an explicit CustomCurrencyID. Keep the existing code-match and
persisted-identity checks, but skip the ChangeMeta overwrite when the updated
reference points to its own managed currency.

---

Nitpick comments:
In `@openmeter/productcatalog/currencyresolver/resolver.go`:
- Around line 148-160: The ChangeMeta closure in the rate-card currency
resolution flow contains non-trivial currency conversion and error wrapping.
Extract this logic into a named resolveRateCardCurrency helper accepting the
rate card and resolved currency, then have the closure call that helper while
retaining the existing error context and ChangeMeta behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5fe45a1e-d134-4811-9262-616393dd35bf

📥 Commits

Reviewing files that changed from the base of the PR and between 576a7a9 and 9fb97cf.

📒 Files selected for processing (91)
  • api/v3/handlers/addons/convert.go
  • api/v3/handlers/addons/convert_test.go
  • api/v3/handlers/plans/convert.go
  • api/v3/handlers/plans/convert_test.go
  • app/common/productcatalog.go
  • cmd/billing-worker/wire_gen.go
  • cmd/jobs/internal/wire_gen.go
  • cmd/server/wire_gen.go
  • e2e/plans_v3_test.go
  • e2e/v1readsurface_currencyoverride_test.go
  • openmeter/billing/worker/subscriptionsync/service/base_test.go
  • openmeter/billing/worker/subscriptionsync/service/creditsonly_test.go
  • openmeter/billing/worker/subscriptionsync/service/sync_credittheninvoice_test.go
  • openmeter/billing/worker/subscriptionsync/service/sync_test.go
  • openmeter/billing/worker/subscriptionsync/service/syncbillinganchor_test.go
  • openmeter/currencies/adapter/currencies.go
  • openmeter/currencies/adapter/currencies_test.go
  • openmeter/currencies/adapter/mapping.go
  • openmeter/currencies/adapter/mapping_test.go
  • openmeter/currencies/costbasis.go
  • openmeter/currencies/costbasis_test.go
  • openmeter/currencies/currency.go
  • openmeter/currencies/currency_test.go
  • openmeter/currencies/currencyresolver/resolver.go
  • openmeter/currencies/currencyresolver/resolver_test.go
  • openmeter/currencies/service/service_test.go
  • openmeter/currencies/testutils/currency.go
  • openmeter/productcatalog/addon.go
  • openmeter/productcatalog/addon/adapter/adapter_test.go
  • openmeter/productcatalog/addon/adapter/addon.go
  • openmeter/productcatalog/addon/adapter/mapping.go
  • openmeter/productcatalog/addon/httpdriver/mapping.go
  • openmeter/productcatalog/addon/ratecard.go
  • openmeter/productcatalog/addon/serializer.go
  • openmeter/productcatalog/addon/serializer_test.go
  • openmeter/productcatalog/addon/service.go
  • openmeter/productcatalog/addon/service/addon.go
  • openmeter/productcatalog/addon/service/service.go
  • openmeter/productcatalog/addon/service/service_test.go
  • openmeter/productcatalog/addon_test.go
  • openmeter/productcatalog/currency.go
  • openmeter/productcatalog/currency_test.go
  • openmeter/productcatalog/currencyresolver/resolver.go
  • openmeter/productcatalog/currencyresolver/resolver_test.go
  • openmeter/productcatalog/errors.go
  • openmeter/productcatalog/plan.go
  • openmeter/productcatalog/plan/adapter/adapter_test.go
  • openmeter/productcatalog/plan/adapter/mapping.go
  • openmeter/productcatalog/plan/adapter/plan.go
  • openmeter/productcatalog/plan/httpdriver/mapping.go
  • openmeter/productcatalog/plan/ratecard.go
  • openmeter/productcatalog/plan/ratecard_test.go
  • openmeter/productcatalog/plan/serializer.go
  • openmeter/productcatalog/plan/serializer_test.go
  • openmeter/productcatalog/plan/service.go
  • openmeter/productcatalog/plan/service/plan.go
  • openmeter/productcatalog/plan/service/service.go
  • openmeter/productcatalog/plan/service/service_test.go
  • openmeter/productcatalog/plan_test.go
  • openmeter/productcatalog/planaddon.go
  • openmeter/productcatalog/planaddon/adapter/planaddon.go
  • openmeter/productcatalog/planaddon/service/planaddon.go
  • openmeter/productcatalog/planaddon/service/service_test.go
  • openmeter/productcatalog/planaddon_test.go
  • openmeter/productcatalog/ratecard.go
  • openmeter/productcatalog/ratecard_test.go
  • openmeter/productcatalog/subscription/http/mapping.go
  • openmeter/productcatalog/testutils/addon.go
  • openmeter/productcatalog/testutils/currencyresolver.go
  • openmeter/productcatalog/testutils/env.go
  • openmeter/productcatalog/testutils/plan.go
  • openmeter/subscription/addon/diff/restore_test.go
  • openmeter/subscription/addon/events_test.go
  • openmeter/subscription/addon/repo/subscriptionaddon.go
  • openmeter/subscription/serialize_test.go
  • openmeter/subscription/service/servicevalidation_test.go
  • openmeter/subscription/testutils/addon.go
  • openmeter/subscription/testutils/builder.go
  • openmeter/subscription/testutils/service.go
  • openmeter/subscription/workflow/service/addon_test.go
  • openmeter/subscription/workflow/service/subscription_test.go
  • test/billing/subscription_suite.go
  • test/billing/subscription_test.go
  • test/customer/customer.go
  • test/customer/subject.go
  • test/customer/testenv.go
  • test/productcatalog/custom_currency_test.go
  • test/subscription/scenario_editaligned_test.go
  • test/subscription/scenario_editcancel_test.go
  • test/subscription/scenario_entinnextphase_test.go
  • test/subscription/scenario_firstofmonth_test.go
💤 Files with no reviewable changes (2)
  • openmeter/productcatalog/addon/service/service.go
  • openmeter/productcatalog/plan/service/service.go
🚧 Files skipped from review as they are similar to previous changes (51)
  • openmeter/productcatalog/testutils/addon.go
  • test/subscription/scenario_entinnextphase_test.go
  • openmeter/subscription/addon/events_test.go
  • openmeter/subscription/workflow/service/subscription_test.go
  • openmeter/currencies/testutils/currency.go
  • openmeter/subscription/testutils/addon.go
  • test/subscription/scenario_editcancel_test.go
  • test/billing/subscription_test.go
  • e2e/plans_v3_test.go
  • test/customer/customer.go
  • openmeter/subscription/serialize_test.go
  • openmeter/subscription/addon/diff/restore_test.go
  • openmeter/productcatalog/testutils/plan.go
  • openmeter/subscription/workflow/service/addon_test.go
  • openmeter/productcatalog/plan/httpdriver/mapping.go
  • test/customer/subject.go
  • openmeter/currencies/adapter/mapping_test.go
  • openmeter/productcatalog/addon/httpdriver/mapping.go
  • openmeter/subscription/testutils/builder.go
  • openmeter/productcatalog/subscription/http/mapping.go
  • openmeter/subscription/addon/repo/subscriptionaddon.go
  • openmeter/productcatalog/addon/adapter/adapter_test.go
  • openmeter/subscription/service/servicevalidation_test.go
  • openmeter/productcatalog/plan/serializer_test.go
  • test/subscription/scenario_firstofmonth_test.go
  • openmeter/currencies/costbasis_test.go
  • api/v3/handlers/plans/convert.go
  • openmeter/productcatalog/addon/serializer_test.go
  • openmeter/productcatalog/addon/serializer.go
  • openmeter/productcatalog/plan/adapter/adapter_test.go
  • openmeter/currencies/adapter/mapping.go
  • openmeter/currencies/currencyresolver/resolver.go
  • openmeter/productcatalog/addon/ratecard.go
  • openmeter/billing/worker/subscriptionsync/service/creditsonly_test.go
  • openmeter/productcatalog/planaddon/service/service_test.go
  • openmeter/currencies/currency_test.go
  • app/common/productcatalog.go
  • openmeter/productcatalog/addon/service/addon.go
  • openmeter/productcatalog/addon/adapter/addon.go
  • openmeter/billing/worker/subscriptionsync/service/syncbillinganchor_test.go
  • openmeter/productcatalog/plan/ratecard.go
  • openmeter/currencies/service/service_test.go
  • openmeter/currencies/adapter/currencies_test.go
  • openmeter/productcatalog/plan/adapter/plan.go
  • openmeter/productcatalog/errors.go
  • openmeter/currencies/adapter/currencies.go
  • openmeter/currencies/currency.go
  • openmeter/productcatalog/planaddon/service/planaddon.go
  • openmeter/productcatalog/addon/adapter/mapping.go
  • api/v3/handlers/plans/convert_test.go
  • openmeter/billing/worker/subscriptionsync/service/sync_credittheninvoice_test.go

Comment thread openmeter/productcatalog/plan.go Resolved
@chrisgacsal
chrisgacsal force-pushed the codex/custom-currency-productcatalog-subscription branch 3 times, most recently from 9955346 to b710900 Compare July 28, 2026 12:19
@chrisgacsal
chrisgacsal force-pushed the codex/custom-currency-productcatalog-subscription branch from 5437aab to 14ba071 Compare July 29, 2026 22:45
@chrisgacsal
chrisgacsal merged commit f01fb4a into main Jul 30, 2026
29 checks passed
@chrisgacsal
chrisgacsal deleted the codex/custom-currency-productcatalog-subscription branch July 30, 2026 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note/feature Release note: Exciting New Features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants