-
-
Notifications
You must be signed in to change notification settings - Fork 11
Closed
Labels
billingPhase 3 — Stripe billing integrationPhase 3 — Stripe billing integration
Description
Context
Downstream projects need to enforce per-plan limits (e.g. max scraps, executions/month).
Spec
- New middleware:
requireQuota(resource, action) - Reads quota config from
config.billing.quotas[plan][resource][action] - Checks current usage via
BillingUsageservice - Returns 429
{ type: 'QUOTA_EXCEEDED', resource, action, limit, current, upgradeUrl }if over limit - Org without subscription → treated as
free - Subscription
past_due→ treated asfree
Config format (each project provides its own)
quotas: {
free: { scraps: { create: 3, execute: 100 } },
starter: { scraps: { create: 20, execute: 2000 } },
pro: { scraps: { create: Infinity, execute: Infinity } }
}Acceptance
- Middleware + tests
- Works with any project's quota config
- Depends on: BillingUsage model
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
billingPhase 3 — Stripe billing integrationPhase 3 — Stripe billing integration