Separate self-managed plans from billing subscriptions #412
No reviewers
Labels
No labels
Compat/Breaking
Component/Enclave-Builder
Component/Infrastructure
Deploy/BYOC
Deploy/Full-managed
Deploy/Self-hosted
Interface/API
Interface/CLI
Interface/Git
Interface/Web
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority/Critical
Priority/High
Priority/Low
Priority/Medium
Reviewed/Confirmed
Reviewed/Duplicate
Reviewed/Invalid
Reviewed/Won't Fix
Status/Abandoned
Status/Blocked
Status/Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
public/platform!412
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/admin-unlimited-enclaves"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
self_managed_plansas the sole operational authority for BYOC/self-managed enclave capacity while retaining subscription rows as billing/provider historyNULLas unlimited capacity,0as disabled, and positive values as exact finite quotas; self-managed reservations are atomic and are not overridden by the generic fully managed resource capCapacity semantics
enclave_limit IS NULL: unlimitedenclave_limit = 0: disabledenclave_limit > 0: exact finite quotaTest plan
cargo +1.96.1 check -p api -p meteringcargo +1.96.1 test -p api --no-fail-fast— 199 passedPADDLE_API_KEY= PADDLE_API_URL= cargo +1.96.1 test -p metering --no-fail-fast— 44 passedPOSTGRES_CONTAINER=postgres-test ./tests/e2e/test_admin_self_managed_plan.sh— passed on a fresh migrated databaseDB_CONTAINER=postgres-test ./tests/e2e/test_paddle_subscriptions.sh— passed, including stale/equal-time events, payment-failure ordering, replacement authority, rolling reconciliation, and canonical BYOC teardownnpm testinfrontend/— 56 passed--configLoader runner --outDir /tmp/caution-frontend-build— passedgit diff --check origin/main— passedOperational notes
--confirmis supplied and requires explicit operator identity, reason, capacity, and expiration policy.--detach-paddle; active provider/legacy billing projections are closed before authority is transferred.053fails closed if an older deployment still has an unreconciled live Paddle tier intent whose exact provider payload cannot be reconstructed.retryor terminal-state-fencedresolveactions.Operator usage after deployment
--never-expireswith--expires-at <finite-RFC3339-timestamp>.--confirmappended.enterprise_unlimited,enterprise,active, andunlimited.The command is deliberately fail-closed. It will not convert a legacy/Paddle subscription or operate when it finds Paddle identifiers, pending provider changes, or metered subscription history. Reconcile/cancel those states first, then repeat the dry-run. This avoids detaching provider billing or allowing stale billing writers/webhooks to overwrite the enterprise contract.
Implementation note: the existing integer capacity gate is preserved by storing PostgreSQL
INTEGERmax (2147483647) as the practical-unlimited sentinel. The API recognizes “unlimited” only when the row is an enterpriseenterprise_unlimitedentitlement with that stored sentinel. Expired contracts are returned/displayed as expired and remain blocked by the deployment gate.Closing in favor of #444
Billing happens through the subscriptions_ledger
Pull request closed