feat(plans): first-class self_serve flag to hide plans from the customer portal - #15
Merged
Merged
Conversation
…mer portal Adds a `self_serve` boolean to plans (default true, non-breaking). When false, the plan is excluded from the customer-portal self-serve list (AvailablePlansResolver) but stays fully assignable by operators — for contract-only tiers like enterprise / white-label. Replaces the ad-hoc `hidden_in_portal` metadata approach with a proper, toggleable field. - migration: add_column :plans, :self_serve, :boolean, default: true, null: false - AvailablePlansResolver: base scope now `.where(self_serve: true)` - Plans::CreateService / UpdateService: persist self_serve (editable even when attached to subscriptions — it's not a billing attribute) - REST: permit :self_serve param + expose in V1::PlanSerializer - GraphQL: Plans::Object field + Create/Update input arguments Post-merge / CI must regenerate the checked-in artifacts (env-dependent, not done here): `structure.sql` via `rails db:migrate`, and `schema.graphql` via the GraphQL schema dump task. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jul 1, 2026
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.
What
Adds a
self_serveboolean to plans (defaulttrue, non-breaking). Whenfalse, the plan is hidden from the customer-portal self-serve list (AvailablePlansResolver) but stays fully assignable by operators — for contract-only tiers like enterprise / white-label.This replaces the interim
hidden_in_portalmetadata hack with a proper, toggleable field that thelago-frontadmin can expose as a checkbox.Changes
add_self_serve_to_plans—add_column :plans, :self_serve, :boolean, default: true, null: falseAvailablePlansResolver— base scope now.where(self_serve: true)(portal-only; operator assignment is unaffected)Plans::CreateService/UpdateService— persistself_serve(editable even when attached to subscriptions — it's not a billing attribute):self_serve+ expose inV1::PlanSerializerPlans::Objectfield +Create/Updateinput argumentsNot done here (needs a Ruby/CI env)
These generated artifacts must be regenerated in CI / locally:
db/structure.sql→rails db:migrateschema.graphql→ the GraphQL schema-dump task(I deliberately did not hand-edit those generated files.)
Notes
truekeeps every existing plan self-serve.lago-frontPR adding the admin checkbox, and with the parent app'sprovision-lagosettingself_servefrom its catalog.🤖 Generated with Claude Code