Skip to content

feat(dashboard-api): management route for the projected billing profile - #3672

Draft
michalsuba-e2b wants to merge 1 commit into
e2b-dev:mainfrom
michalsuba-e2b:michal/team-billing-profile
Draft

michalsuba-e2b wants to merge 1 commit into
e2b-dev:mainfrom
michalsuba-e2b:michal/team-billing-profile

Conversation

@michalsuba-e2b

@michalsuba-e2b michalsuba-e2b commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Receiving side of EN-3221: teams born on global billing have no billing state on their control plane, which breaks regional readers (EN-3220 — bot-detection drops them entirely; the LaunchDarkly tier context and tier labels read a base_v1 that never updates). This adds the plane-side endpoint and tables the global plane pushes the profile into; the belt sender is https://github.com/e2b-dev/belt/pull/4397.

Current state:

  • PUT /v1/management/projects/{projectID}/billing-profile (AdminJWTAuth), body {revision, has_payment_method, enterprise, plan?, decided_at?} — exact ManagementUpsertProjectLimits semantics: ledger-fenced (projection.billing_profiles), values written in the same transaction (public.team_billing_profiles), stale deliveries answered 204, team cache invalidated after commit (failed eviction logged, not returned — the limits convention).
  • Migration adds the ledger + public.team_billing_profiles (has_payment_method, enterprise, plan nullable — a team without a row is unknown, never defaulted). No touch of project_limits, team_limits, or the auth path. By the mirroring convention the canonical copies of the migration and spec change live in belt go/oss/...; the belt PR carries them — whichever lands second is a no-op diff.
  • Tests: write/advance, stale-revision drop (duplicate + older), invalid/missing project, committed-write-despite-failed-cache-eviction — against the real test DB, 4/4 green locally.
  • Spec/sqlc regenerated (make generate in packages/db and packages/dashboard-api); api.gen.go churn is the generator's.

Draft until the belt sender PR is up and the contract has a billing-owner nod.

Sponsor: @michalsuba-e2b

🤖 Generated with Claude Code

PUT /v1/management/projects/{projectID}/billing-profile stores the global
billing plane's answer per project: has_payment_method, enterprise, plan.
Same ledger-fenced delivery as project limits (projection.billing_profiles,
revision advances only forward, values written in the same transaction).
Receiver for e2b-dev/belt EN-3221; regional readers (bot-detection payment
signal, LD tier context, tier labels) switch to public.team_billing_profiles.

EN-3221

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cla-bot cla-bot Bot added the cla-signed label Oct 7, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant