Skip to content

feat(customcurrency): support custom currency subscriptions#4744

Draft
GAlexIHU wants to merge 1 commit into
codex/custom-currency-subscriptionsfrom
codex/custom-currency-subscription-semantics
Draft

feat(customcurrency): support custom currency subscriptions#4744
GAlexIHU wants to merge 1 commit into
codex/custom-currency-subscriptionsfrom
codex/custom-currency-subscription-semantics

Conversation

@GAlexIHU

Copy link
Copy Markdown
Contributor

cc @chrisgacsal @turip — this is the semantic cutover in a three-PR stack.

stack and rollout

  1. feat(productcatalog): support custom currencies #4738 adds custom-currency identities, persistence, and compatibility rules to plans, rate cards, add-ons, and assignments.
  2. feat(customcurrency): materialize subscription item currencies #4742 expands subscription-item persistence and materializes currency for every new or rewritten priced item, while legacy null-currency items stay readable. It deliberately changes no subscription semantics.
  3. This PR performs the cutover after that expand/write step: Subscription.InvoiceCurrency is the invoice FIAT; each priced subscription item carries its actual FIAT or managed custom currency.

Deployed environments should roll out #4742 first, backfill existing priced items, verify none remain without currency, then deploy this PR. OSS has the same requirement documented in the migration guide; this PR is intentionally breaking for upgrades that skip it.

product behavior

  • customer and subscription invoice currencies remain FIAT and must align with any FIAT used by the plan/items
  • custom-only plans use the customer FIAT as invoiceCurrency
  • item currency is materialized and immutable across edits/add-on overlays
  • credit_only subscriptions do not require a cost basis
  • credit_then_invoice subscriptions require each custom → invoice-FIAT pair
  • cost bases can remain dynamic or be pinned per currency pair; add-ons reuse existing pins or resolve a new pair at their effective time
  • v3 exposes invoiceCurrency; v1 keeps its existing currency compatibility surface

Actual billing conversion is still outside this PR. Until it lands, automatic subscription sync skips custom-currency subscriptions and explicit sync fails before creating billing artifacts. Dynamic conversion will resolve at the charge FSP start; pinned subscriptions will use their stored pair.

@greptile-apps

greptile-apps Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Too many files changed for review. (155 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

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0e77e1ea-5177-4290-bd6e-0e0d99c2be2b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/custom-currency-subscription-semantics

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 added the release-note/feature Release note: Exciting New Features label Jul 17, 2026
@GAlexIHU
GAlexIHU force-pushed the codex/custom-currency-subscription-semantics branch from d6b8deb to 8e4110f Compare July 17, 2026 21:08
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.

1 participant