Revert "feat: route frontend billing through control plane"#3963
Merged
Conversation
This reverts commit a081804.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
mrkaye97
approved these changes
May 19, 2026
This reverts commit 4aae77b.
Contributor
There was a problem hiding this comment.
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 toqueries.cloud.*. - Replaced manual
controlPlaneApi.request(...)billing calls with typedcloudApibilling 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, | ||
| }), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This reverts commit a081804.