Skip to content

feat(billing): move plan writes to AdminService and add ListAllPlans - #1830

Draft
rohilsurana wants to merge 6 commits into
mainfrom
feat/billing-plan-api
Draft

feat(billing): move plan writes to AdminService and add ListAllPlans#1830
rohilsurana wants to merge 6 commits into
mainfrom
feat/billing-plan-api

Conversation

@rohilsurana

Copy link
Copy Markdown
Member

What

Wire the frontier side of the plan admin APIs from raystack/proton#496.

  • Move CreatePlan and UpdatePlan to AdminService (super user only). They were on FrontierService before.
  • Add ListAllPlans on AdminService. It lists every plan, including disabled ones. An empty state returns all plans; a set state filters to it.
  • CreatePlan now carries the plan state. UpdatePlan is implemented (it returned Unimplemented before) and does a full write of a plan's own fields (title, description, credits, trial days, state, metadata). A plan's products are still managed through CreatePlan's upsert.
  • ListPlans and GetPlan stay on FrontierService and are unchanged.

How

  • Pin proton to the branch commit that carries these proto changes and regenerate.
  • The same ConnectHandler serves both services, so the existing CreatePlan method now satisfies AdminService. UpdatePlan and ListAllPlans are added to it.
  • The authz interceptor gates the three AdminService plan RPCs behind IsSuperUser, and the old FrontierService plan entries are removed. Any endpoint not listed is denied by default, so these entries are required.
  • ListAllPlans passes a plan.StateAll sentinel to the repository so an empty state lists plans in every state. The repository still defaults an empty state to active for ListPlans, which lists active plans only.

Depends on

Testing

  • New handler tests for UpdatePlan and ListAllPlans. Existing plan handler and service tests pass.
  • The e2e billing tests now call CreatePlan on the admin client.
  • build, vet, gofmt, and golangci-lint are green.

@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
frontier Ready Ready Preview Jul 31, 2026 10:27am

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 3c3ea305-cee3-4b06-99e7-6283abf0b52e

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.

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