Skip to content

refactor(dashboard): remove unused billing surfaces and types - #795

Merged
izadoesdev merged 1 commit into
stagingfrom
codex/billing-surface-cleanup-20260914
Sep 14, 2026
Merged

izadoesdev merged 1 commit into
stagingfrom
codex/billing-surface-cleanup-20260914

Conversation

@izadoesdev

@izadoesdev izadoesdev commented Sep 14, 2026

Copy link
Copy Markdown
Member

Billing exposed unused upgrade/cancellation handlers, loading state, context methods, and duplicate customer/type wrappers. Remove those unused surfaces, read the existing customer value directly in history, and type only the four card fields the payment row renders. Delete the single-consumer payment-method type file. Net reduction: 84 lines across 5 files.

Cancellation confirmation, the dialog's pending guard, feedback, refetch, billing portal, purchase flow, feature gates, and pricing retain their behavior.

Validation: root lint, all 33 type/build tasks, all 27 test tasks, and 70 focused billing tests pass. Five synthetic cancellation/portal scenarios match before and after; six payment-card cases render exactly the same HTML. Independent final diff review found no issues. Checks used inline code and mocks, with no new files or live provider calls.

Scope: dashboard billing internals only. No dependency or file overlap with open RPC billing PR #790.

@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 75bb2951-1b8e-4345-ac29-4869ec8620a6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@vercel

vercel Bot commented Sep 14, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
dashboard Ready Ready Preview Sep 14, 2026 7:43pm UTC
databuddy-status Ready Ready Preview Sep 14, 2026 7:43pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
documentation Skipped Skipped Sep 14, 2026 7:43pm UTC

@greptile-apps

greptile-apps Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR simplifies dashboard billing internals by removing unused hook and context APIs, eliminating duplicate customer and payment-method wrappers, and consuming the existing customer data directly.

  • Removes unused upgrade, cancellation, loading, balance, capability, and check surfaces.
  • Updates billing history to use the canonical customer value.
  • Narrows the payment-method row input to the card fields it renders.
  • Preserves cancellation confirmation, billing portal access, feature gating, and billing-data recovery behavior.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness, security, or repository-rule issues identified.

All removed surfaces have no remaining repository consumers, and the active cancellation, payment-method, history, portal, and feature-access paths retain their prior behavior.

Important Files Changed

Filename Overview
apps/dashboard/app/(main)/billing/hooks/use-billing.ts Removes unused hook state and API members while retaining cancellation, portal, usage, and refetch behavior.
apps/dashboard/components/providers/billing-provider.tsx Removes unconsumed balance and plan-capability context methods without changing active access calculations.
apps/dashboard/app/(main)/billing/history/page.tsx Replaces the duplicate customer alias with the canonical customer value and simplifies subscription-history access.
apps/dashboard/app/(main)/billing/page.tsx Passes payment-card data directly to the single-purpose row while preserving existing empty and fallback rendering.
apps/dashboard/app/(main)/billing/types/billing.ts Deletes the obsolete single-consumer payment-method wrapper types.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  CustomerHook[useCustomer] --> BillingData[useBillingData]
  BillingData --> BillingPage[Billing page]
  BillingData --> HistoryPage[Billing history]
  BillingPage --> Card[PaymentMethodRow card fields]
  BillingHook[useBilling] --> Cancellation[Cancellation confirmation]
  BillingHook --> Portal[Customer portal]
  BillingProvider[Billing provider] --> Access[Feature and usage access]
Loading

Reviews (1): Last reviewed commit: "refactor(dashboard): remove unused billi..." | Re-trigger Greptile

@izadoesdev
izadoesdev merged commit 5b5f42d into staging Sep 14, 2026
16 checks passed
@izadoesdev
izadoesdev deleted the codex/billing-surface-cleanup-20260914 branch September 14, 2026 19:49
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