Skip to content

Revert "feat: route frontend billing through control plane"#3963

Merged
grutt merged 2 commits into
mainfrom
revert-a081804-control-plane-billing
May 19, 2026
Merged

Revert "feat: route frontend billing through control plane"#3963
grutt merged 2 commits into
mainfrom
revert-a081804-control-plane-billing

Conversation

@grutt
Copy link
Copy Markdown
Contributor

@grutt grutt commented May 19, 2026

This reverts commit a081804.

Copilot AI review requested due to automatic review settings May 19, 2026 19:30
@vercel
Copy link
Copy Markdown

vercel Bot commented May 19, 2026

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

Project Deployment Actions Updated (UTC)
hatchet-docs Ready Ready Preview, Comment May 19, 2026 7:36pm

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR reverts the earlier change that routed frontend billing interactions through the control plane, switching billing-related UI flows back to using the Cloud API and Cloud-generated client/types.

Changes:

  • Switched subscription plan prefetching and billing queries from queries.controlPlane.* back to queries.cloud.*.
  • Replaced manual controlPlaneApi.request(...) billing calls with typed cloudApi billing endpoints (billing portal link, subscription update, billing state, payment methods, credit balance).
  • Moved billing-related generated types/endpoints from the control-plane client/contracts into the cloud client/contracts.

Reviewed changes

Copilot reviewed 13 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
frontend/app/src/pages/onboarding/create-tenant/index.tsx Prefetch subscription plans via cloud query key.
frontend/app/src/pages/onboarding/create-organization/index.tsx Prefetch subscription plans via cloud query key after org creation.
frontend/app/src/pages/main/v1/managed-workers/index.tsx Use cloudApi.billingPortalLinkGet instead of control-plane request path.
frontend/app/src/pages/main/v1/managed-workers/create/index.tsx Use cloudApi.billingPortalLinkGet instead of control-plane request path.
frontend/app/src/pages/authenticated.tsx Prefetch subscription plans via queries.cloud.subscriptionPlans().
frontend/app/src/lib/atoms.ts Switch TenantBillingState import to cloud-generated contracts.
frontend/app/src/lib/api/queries.ts Consolidate billing queries under queries.cloud using cloud API endpoints.
frontend/app/src/lib/api/generated/control-plane/data-contracts.ts Remove billing-related enums/types from control-plane contracts.
frontend/app/src/lib/api/generated/control-plane/Api.ts Remove billing endpoints from control-plane API client.
frontend/app/src/lib/api/generated/cloud/Api.ts Add billing endpoints (plans, billing state, subscription update, portal link, etc.) to cloud API client.
frontend/app/src/lib/api/api.ts Update interceptor comment example to /api/v1/billing/plans.
frontend/app/src/hooks/use-tenant.tsx Switch tenant billing/payment methods queries to queries.cloud.*.
frontend/app/src/components/v1/cloud/billing/subscription.tsx Switch billing actions (portal link, subscription update, credit balance, invalidation) to cloud API/queries and cloud types.
frontend/app/src/components/v1/cloud/billing/plan-selector.tsx Switch plan/coupon types and subscription plans query to cloud.
frontend/app/src/components/modals/welcome-modal.tsx Switch subscription plans query and subscription update mutation to cloud API/types.

Comment on lines 29 to 34
export const queries = createQueryKeyStore({
controlPlane: {
cloud: {
billing: (tenant: string) => ({
queryKey: ['control-plane-billing-state:get', tenant],
queryFn: async () =>
(
await controlPlaneApi.request<TenantBillingState>({
path: `/api/v1/control-plane/billing/tenants/${tenant}`,
method: 'GET',
secure: true,
format: 'json',
})
).data,
queryKey: ['billing-state:get', tenant],
queryFn: async () => (await cloudApi.tenantBillingStateGet(tenant)).data,
}),
@grutt grutt merged commit 1f09b00 into main May 19, 2026
27 checks passed
@grutt grutt deleted the revert-a081804-control-plane-billing branch May 19, 2026 19:38
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.

3 participants