Parent: #25 — Remove all SaaS billing code
⚠️ Largest blast radius — do this one carefully
What to Remove
model/pricing.go — PricingProductType, PricingSubscriptionInterval enums
pricing/pricing.go — entire package (ProductPrices, GetLimitAmount, IncludedAmount, get7DayAverageImpl, getWorkspaceMeterImpl, ProductToBasePriceCents, WorkspaceOverages, ProductTypeToQuotaConfig)
pricing/pricing_test.go — tests for above
- Quota checking functions in
public-graph/graph/resolver.go: IsWithinQuota, SetBillingQuotaExceeded
- Redis billing quota keys in
redis/utils.go: BillingQuotaExceededKey, IsBillingQuotaExceeded, SetBillingQuotaExceeded
Callers (100+ references — most complex removal)
Public Graph Resolver
| Line |
Usage |
| 688 |
IsWithinQuota — PricingProductTypeErrors |
| 1129, 2631, 2981 |
IsWithinQuota — PricingProductTypeSessions |
| 1132 |
SetBillingQuotaExceeded — PricingProductTypeSessions |
| 1618 |
IsWithinQuota function definition |
Private Graph Resolver
| Line |
Usage |
| schema.resolvers.go:6420-6476 |
IncludedAmount, GetLimitAmount, ProductToBasePriceCents calls |
Worker
| Line |
Usage |
| kafka_worker.go:309, 366-374, 398, 473 |
getQuotaExceededByProject, product type case statements |
| worker.go:954 |
IsWithinQuota call |
OTEL
| Line |
Usage |
| otel.go:575, 643, 749, 797 |
getQuotaExceededByProject, product type calls |
Redis
| Line |
Usage |
| utils.go:56, 604, 608 |
Billing quota key functions |
Tests
| File |
Usage |
| public-graph/graph/resolver_test.go:638,641 |
IsWithinQuota tests |
| worker/worker_test.go:848-894 |
Pricing table setup (47 assignments) |
Strategy
IsWithinQuota should be replaced with a function that always returns true (no quotas in self-hosted), then callers can be simplified. The pricing package can be deleted entirely.
Test Plan
🤖 Generated with Claude Code
Parent: #25 — Remove all SaaS billing code
What to Remove
model/pricing.go— PricingProductType, PricingSubscriptionInterval enumspricing/pricing.go— entire package (ProductPrices, GetLimitAmount, IncludedAmount, get7DayAverageImpl, getWorkspaceMeterImpl, ProductToBasePriceCents, WorkspaceOverages, ProductTypeToQuotaConfig)pricing/pricing_test.go— tests for abovepublic-graph/graph/resolver.go:IsWithinQuota,SetBillingQuotaExceededredis/utils.go:BillingQuotaExceededKey,IsBillingQuotaExceeded,SetBillingQuotaExceededCallers (100+ references — most complex removal)
Public Graph Resolver
IsWithinQuota— PricingProductTypeErrorsIsWithinQuota— PricingProductTypeSessionsSetBillingQuotaExceeded— PricingProductTypeSessionsIsWithinQuotafunction definitionPrivate Graph Resolver
IncludedAmount,GetLimitAmount,ProductToBasePriceCentscallsWorker
getQuotaExceededByProject, product type case statementsIsWithinQuotacallOTEL
getQuotaExceededByProject, product type callsRedis
Tests
Strategy
IsWithinQuotashould be replaced with a function that always returnstrue(no quotas in self-hosted), then callers can be simplified. The pricing package can be deleted entirely.Test Plan
IsWithinQuota→ always trueSetBillingQuotaExceededcalls🤖 Generated with Claude Code