feat(customer-portal): plans page with cross-product subscription management - #1
Merged
Merged
Conversation
…agement
End users can now manage their subscriptions self-service from the hosted
customer portal — no admin intervention or app-side Plan Selector needed.
Adds:
- PlansPage component (src/components/customerPortal/plans/PlansPage.tsx)
groups plans by product key (extracted from code prefix: aistack-*,
growth-*, memory-*, etc.) and renders three actions per plan:
* Current plan badge (already subscribed)
* Switch to this plan (within same product → in-place plan change
via PlanUpgradeService, proration handled)
* Add to my account (NEW subscription for a product the customer
doesn't yet have)
Plus per-product Cancel button with browser confirm dialog.
- New /customer-portal/:token/plans route
- New viewPlans navigator in useCustomerPortalNavigation hook
- "Plans & Subscriptions" card in main portal index linking to the page
- 11 translation strings (English base.json — other locales fall back)
Powered by 4 customer-portal-scoped GraphQL ops added to lago-api fork:
- customerPortalAvailablePlans (query)
- changeCustomerPortalSubscriptionPlan (mutation)
- createCustomerPortalSubscription (mutation)
- terminateCustomerPortalSubscription (mutation)
Phase 2 of the ThinkFleet billing integration: Lago portal becomes the
single canonical place for end-user subscription self-service across all
products in the ecosystem.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
rrader26
pushed a commit
that referenced
this pull request
May 22, 2026
- Regenerate src/generated/graphql.tsx against live lago-api so the new customerPortal subscription hooks (Available plans query + change/create/ terminate mutations) resolve at compile time. - Replace window.confirm with WarningDialog (eslint no-alert rule). - Type formatPrice's currency arg as CurrencyEnum instead of `as any`. - Re-format with prettier. Resolves the build failure on the PR #1 merge (build was failing because the generated types hadn't been regenerated yet). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Companion PR: https://github.com/ThinkfleetAI/lago-api (Phase 2A). Adds PlansPage component with current-sub list, per-product Switch/Cancel actions, and Add-a-Product cross-sell. New /plans route + sidebar card. 11 i18n strings. Requires lago-api PR merged first. 🤖 Generated with Claude Code.