Skip to content

feat(plans): "Show in customer portal" toggle (self_serve) - #8

Merged
rrader26 merged 1 commit into
mainfrom
feat/plan-self-serve-toggle
Jul 1, 2026
Merged

feat(plans): "Show in customer portal" toggle (self_serve)#8
rrader26 merged 1 commit into
mainfrom
feat/plan-self-serve-toggle

Conversation

@rrader26

@rrader26 rrader26 commented Jul 1, 2026

Copy link
Copy Markdown

Adds the operator-facing checkbox for the self_serve plan flag — the natural place to control it, since Lago is the master record for plans.

Pairs with lago-api#15 (the self_serve column + customer-portal resolver filter).

What

  • PlanSettingsSection — a "Show in customer portal" SwitchField bound to selfServe, plus selfServe added to the PlanForSettingsSection fragment.
  • CreatePlan EditPlan fragment — fetch selfServe so edit loads the current value.
  • usePlanForm — initial value selfServe ?? true (new plans default visible).
  • serialize — no change needed; selfServe is forwarded via the existing ...otherValues spread, and PlanFormInput = Omit<CreatePlanInput, …> picks it up automatically.

When off: the plan is hidden from the customer-portal self-serve list but stays fully assignable by operators (enterprise / white-label).

⚠️ Requires before it compiles (env-dependent, not done here)

  1. lago-api#15 merged so the GraphQL schema exposes selfServe.
  2. graphql:codegen run to regenerate src/generated/graphql.tsx (adds selfServe to Plan / CreatePlanInput / UpdatePlanInput). The form won't type-check until then.

Labels are literal strings — swap to translate() keys if the i18n lint requires.

🤖 Generated with Claude Code

…n form

Operator-facing checkbox for the `self_serve` plan flag (ThinkfleetAI/lago-api
getlago#15). When off, the plan is hidden from the customer-portal self-serve list but
stays assignable by operators — enterprise / white-label tiers.

- PlanSettingsSection: SwitchField bound to `selfServe` + `selfServe` on the
  PlanForSettingsSection fragment
- CreatePlan EditPlan fragment: fetch `selfServe`
- usePlanForm: initial value `selfServe ?? true` (new plans default visible)
- serialize: already forwarded via the `...otherValues` spread

Requires (env-dependent, not done here): lago-api getlago#15 merged (schema exposes
selfServe) + `graphql:codegen` to regenerate src/generated/graphql.tsx — the
form won't type-check until then. Labels are literal strings (add i18n keys if
lint requires).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rrader26
rrader26 merged commit 59a6f3f into main Jul 1, 2026
3 of 8 checks passed
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.

2 participants