Skip to content

fix(billing): Use canonical PAYG allowances in public estimator (fixes #399) - #420

Open
stroland02 wants to merge 1 commit into
superloglabs:mainfrom
stroland02:fix-issue-399
Open

fix(billing): Use canonical PAYG allowances in public estimator (fixes #399)#420
stroland02 wants to merge 1 commit into
superloglabs:mainfrom
stroland02:fix-issue-399

Conversation

@stroland02

@stroland02 stroland02 commented Jul 27, 2026

Copy link
Copy Markdown

This PR resolves an issue where the public PAYG estimator was overstating the estimated monthly bill. Previously, the estimator did not account for the included investigation credits and telemetry allowances. By updating \Pricing.tsx\ to import and utilize the canonical billing models from @superlog/billing, the calculator now correctly factors in these allowances before computing overage costs. A regression test has also been added to ensure the pricing estimator logic remains sound. Fixes #399.


Summary by cubic

The public PAYG estimator now uses canonical billing rates and allowances from @superlog/billing, so estimates no longer overstate monthly costs. It correctly accounts for included investigation credits and telemetry before charging overages.

  • Bug Fixes
    • Replaced local PAYG constants with PLANS, PAYG_RATES, and PAYG_PROMOTION_CREDITS from @superlog/billing.
    • Compute billable investigations and telemetry overage after included credits/allowances.
    • Added a regression test to confirm the default state displays $0.00 within allowances.

Written for commit 49bd827. Summary will update on new commits.

Review in cubic

@superlog-app superlog-app 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.

Observability review

All clear — no observability concerns found.

Send us some more PRs. We really like them!

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 2 files

Re-trigger cubic

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.

The public PAYG estimator bills included usage and overstates the contracted price

1 participant