Repository navigation
feat: pay-as-you-go billing (usage page + retention UI) - #4913
Conversation
Write plan retention onto the tenant via UpdateTenant, expose dataRetentionPeriod on the API, and show a billing upgrade banner when the UI looks past the window. The API is not restricted.
Replace the post-query RetentionBanner with picker-native limits so out-of-bound ranges never apply.
Add upcoming and previous invoice history above plan history, using Autumn-hosted invoice links for past charges.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
| const re = /^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/; | ||
| const match = period.trim().match(re); | ||
|
|
There was a problem hiding this comment.
Go duration parser is incomplete
If a tenant uses a backend-valid Go duration such as 1.5h or 500ms, parseGoDuration returns null, so the new UI retention checks fail open and omit the retention dialog and expired-run state. Either parse the full backend-supported grammar or constrain accepted values consistently.
Hide legacy plans from the selector, drop annual billing, and send welcome-modal upgrades to the new Pay as you Go plan.
Rebuild billing around Autumn balances and sparkline detail, and list the upcoming invoice as the first row of one invoices table.
…r, and retention limits Lead with the value of upgrading, send Upgrade straight to Stripe checkout, and keep Details as a secondary view of plan contents.
…te modal Color meters at 75% and 95%, sort by current usage, and open the Pay as you Go pitch instead of jumping straight to Stripe or a second details screen.
…retention ToTask and ToTaskSummary left the required top-level createdAt at Go's zero time, which serialized as 0001-01-01 and made the run page treat every standalone task run as retention-expired. Also guard isBeforeRetention against invalid or pre-epoch timestamps.
…iance page Rework the welcome modal around Pay as you Go, make SSO/audit/Prometheus gates consistent, spell out Single Sign On, and add a cloud-only compliance settings page with inactivity timeout and Trust Center links.
The Limit reached menu only knew about tenant engine caps, so org features like users never appeared. Surface those usage rows and persist dismissals in localStorage so they stay hidden after refresh.
Legacy subscriptions can no longer upgrade to Pay as you Go from the billing page; they get a Talk to sales CTA instead.
Render the gate on the SetupCard dialog surface used by the onboarding, welcome, and invoice dialogs, with small footer buttons. Titles are in active voice and descriptions point at the upgrade instead of repeating numbers. Below the header, two labelled tables compare Free with Pay as you Go: metered usage (included per month, then overage priced from the plan API) and plan limits. The table opens collapsed to the single gated row, highlighted, with a "See full breakdown" toggle. Pass the gated feature id from the usage meters so the usage gate can name the resource. Give SetupCard dialogs a solid backing; the card's own fill is translucent and page text bled through. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The chart row was declared as { date: string } & Record<string, number>,
which no object literal can satisfy because date collides with the numeric
index signature. Widen the index signature to string | number via a shared
TenantChartPoint type.
Summary
dataRetentionPeriodand gates events, logs, and runs history with a retention upgrade modal / expired-run state instead of a silent empty table.feat/pay-as-you-go-billingbranch.Supersedes #4812. Depends on the control-plane companion: https://github.com/hatchet-dev/hatchet-control-plane/pull/134
Test plan
sdksorg