draft: feat: Pricing Implementation, Editable Slots in Status Page by admin, dynamic pricing#9040
Closed
draft: feat: Pricing Implementation, Editable Slots in Status Page by admin, dynamic pricing#9040
Conversation
when on Free plan, view only Cluster size costs, CTA Upgrade to Grwoth Plan Once upgraded, CHC cannot rquset a tier less than detected. but free to change at any time. SCH can change to any tier at any time RMDuck likewise can change to any tier at any time. DATA OVERAGES ALSO CHARGED - add rill_min_slots and chc_cluster_size to postgres export for telemetry - add API endpoint to hit CHC cluster for Cluster info - oka
…Metrics CHC Tiers, in admin/clickhouse.go. need confirmation if this was implemented correctly
8 tasks
User cannot manage slots when CHC is hibernated, auto downgrades to 1 slot as 0 slot is not usable ie free. when user restarts CHC, we start Rill, Full tier list, add sync now button to get current CHC settings.
Contributor
Author
|
v0 feedback:
|
Contributor
Author
|
once confrimed on behavior, will split into smaller PRs |
Contributor
Author
|
…AN_TYPE_GROWTH = 6 - Added BILLING_ISSUE_TYPE_CREDIT_LOW = 8, CREDIT_CRITICAL = 9, CREDIT_EXHAUSTED = 10 - Added BillingCreditInfo message with total/used/remaining credit, expiry, and burn rate - Added credit_info field to GetBillingSubscriptionResponse - Added credit metadata messages (BillingIssueMetadataCreditLow, CreditCritical, CreditExhausted) with oneof entries Backend (biller.go, orb.go, noop.go): - Added FreePlanType and GrowthPlanType constants - Added CreditBalance struct - Added GetCreditBalance() to Biller interface - Orb implementation queries credit grants via Customers.Credits.ListByExternalID, aggregates active grants, calculates burn rate - Noop biller returns nil (no credits) - Updated getPlanType() and getPlanDisplayName() for new plan names (free, growth + mode variants) Database (database.go, postgres.go): - Added BillingIssueTypeCreditLow/Critical/Exhausted constants - Added metadata structs for credit issues - Updated postgres DTO deserialization to handle new issue types - CreditLow is warning level; CreditCritical and CreditExhausted are error level Server (billing.go): - GetBillingSubscription now returns credit_info for free-tier orgs - All DTO conversion functions updated for new plan types and issue types Generated clients: Proto regenerated, TS clients updated via Orval.
…ts): - Added MANAGED_SLOT_RATE_PER_HR = 0.15, CLUSTER_SLOT_RATE_PER_HR = 0.06, RILL_SLOT_RATE_PER_HR = 0.15 - Added STORAGE_RATE_PER_GB_PER_MONTH = 1.0, INCLUDED_STORAGE_GB = 1 - Added MANAGED_SLOT_TIERS, CLUSTER_SLOT_TIERS, RILL_SLOT_TIERS arrays - Legacy SLOT_RATE_PER_HR = 0.06 preserved for Team plan customers ManageSlotsModal (ManageSlotsModal.svelte): - New props: useNewPricing, clusterSlots, currentRillSlots - Managed mode: dynamically uses $0.15/hr (new pricing) or $0.06/hr (legacy) based on plan - New pricing Live Connect: two-section UI — Cluster Slots (read-only info box) + Rill Slots (selectable table starting at 0) - Shows estimated total cost (cluster + rill combined) - Legacy Live Connect path preserved for Team plan customers DeploymentSection (DeploymentSection.svelte): - Detects Free/Growth plans → useNewPricing = true - Derives clusterSlots from rillMinSlots (set by backend CHC sync) - New pricing Live Connect: shows separate "Cluster Slots" (auto-calculated, read-only) and "Rill Slots" (with Manage button) rows - Free plan: shows "Upgrade to Growth" instead of "Upgrade to Team Plan" - Passes new props to ManageSlotsModal That wraps up Phase 4. Phases 1, 2, and 4 are done. Remaining: Phase 3 (flesh out plan components + upgrade flow), Phase 5 (credit banners + hibernation), Phase 6 (migration). Want to continue with one of those, or commit what we have?
…itExhausted, returning "free credit exhausted". StartTrial — when the default plan is FreePlanType: - Skips incrementing trial org count - Skips raising the OnTrial billing issue - Logs "started free plan" instead of "started trial" - Falls through to the existing quota/cleanup logic (subscription + billing issues still cleaned up correctly) UpdateBillingSubscription — when upgrading to Growth: - Checks for CreditExhausted issue before cleanup - After quota update + issue cleanup, wakes all hibernated projects (PrimaryDeploymentID == nil) by calling RedeployProject - Logs the un-hibernate event
…b.F("USD") to the ListByExternalID call — without this, Orb returns credits in all currencies and the result can be ambiguous - Fixed MaximumInitialBalance = 0 case: when Orb doesn't track the original cap (plan-granted credits), falls back to using Balance as the total so the balance still shows correctly instead of being skipped VoidCredits (new): - Lists all active USD credit blocks for the customer - Voids each one via Ledger.NewEntryByExternalID with entry_type: "void" - Called in UpdateBillingSubscription when upgrading to Growth — credits don't carry over per the spec Free plan onboarding email: - RepairOrganizationBilling no longer sends SendTrialStarted when the default plan is FreePlanType — that email references a trial end date which doesn't exist for free plans
- proto/gen: take ours (HEAD) — contains new billing credit/growth types - BillingCTAHandler.ts: merge GrowthPlanDialogTypes (ours) + fetchOrganizationBillingIssues (main) - Payment.svelte: adopt main's pendingSetup pattern, add onFreePlan to hide payment for free-plan orgs - DeploymentSection.svelte: keep ours (CHC Cloud management buttons) - billing.go: remove req.Setup reference removed from proto by main Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
MD confirmed working, CHC confirmed working, SMCH. working,
Contributor
Author
|
closing for rill-slots view |
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.
Pricing implementation: editable slots in Status Page, CHC auto-scaling on hibernation.
rill_min_slotson wake-upFree Plan: 1 slot (upgrade to Growth to customize)
Growth: Variable, managed by admins via Status page
Enterprise: Managed or hidden
docs in #9056
Checklist:
Developed in collaboration with Claude Code