Skip to content

feat(balances): price tracks by credit dimensions - #3220

Draft
charlietlamb wants to merge 1 commit into
charlie/dim-catalogfrom
charlie/dim-track
Draft

feat(balances): price tracks by credit dimensions#3220
charlietlamb wants to merge 1 commit into
charlie/dim-catalogfrom
charlie/dim-track

Conversation

@charlietlamb

@charlietlamb charlietlamb commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

getCreditSchemaItem is the one place dimensions enter: a row with rules is
projected through resolveCreditDimensionRate into an ordinary flat or
graduated item (most specific match sets the rate, every matching
multiplier scales it, no match keeps the row's rate), so the cost math,
rate cards, Lua and SQL stay unchanged. The winning dimension names the
attribution key. Event properties are threaded from the deduction options
through computeCreditCosts and the creditSystemUtils entry points, the
check conversion, and finalize — which previously dropped the receipt's
properties. Dimensioned rows join the fail-closed set and report no single
rate to analytics.


Stack created with GitHub Stacks CLIGive Feedback 💬


Summary by cubic

Prices track events by credit dimensions: a rate-card row with dimension rules now matches the event's properties, and the most specific match sets the rate (multipliers scale it, no match falls back to the row's rate). The winning dimension names the usage attribution key, and dimensioned rows are fail-closed with no single rate reported to analytics.

  • Threads event properties from deduction options through cost computation, check conversion, and finalize (finalize previously dropped the receipt's properties).
  • Dimensioned rows join the fail-closed set and report no single rate to analytics.

Migration

  • Event properties must be provided at check and finalize time for dimensioned pricing to apply.

Written for commit 3340807. Summary will update on new commits.

Review in cubic

getCreditSchemaItem is the one place dimensions enter: a row with rules is
projected through resolveCreditDimensionRate into an ordinary flat or
graduated item (most specific match sets the rate, every matching
multiplier scales it, no match keeps the row's rate), so the cost math,
rate cards, Lua and SQL stay unchanged. The winning dimension names the
attribution key. Event properties are threaded from the deduction options
through computeCreditCosts and the creditSystemUtils entry points, the
check conversion, and finalize — which previously dropped the receipt's
properties. Dimensioned rows join the fail-closed set and report no single
rate to analytics.
@vercel

vercel Bot commented Sep 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated
checkout Ignored Ignored Sep 2, 2026 4:55pm UTC
landing-page Ignored Ignored Sep 2, 2026 4:55pm UTC

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant