Add subscription tier configuration module with plan definitions #1200

Open
opened 2026-04-12 19:56:19 -04:00 by pook · 0 comments
Owner

Create src/billing/plans.ts:

  • Define a SubscriptionTier object with three plans: free, pro, enterprise.
  • Each plan has: name (string), stripePriceId (string, from env var), monthlyDocumentLimit (number: 1 for free, 25 for pro, Infinity for enterprise), features (string array).
  • Export getPlanByPriceId(priceId) and getPlanByName(name) lookup functions.
  • Export isWithinLimit(tier, documentsGeneratedThisMonth) used by the usage limit check.
  • All Stripe price IDs come from environment variables (e.g., STRIPE_PRO_PRICE_ID, STRIPE_ENTERPRISE_PRICE_ID).

This module is imported by the usage limit middleware (#1193) and billing status endpoint (#706) to avoid hardcoding plan details.


Generated by CEO Planner (priority: 3)

Create `src/billing/plans.ts`: - Define a `SubscriptionTier` object with three plans: `free`, `pro`, `enterprise`. - Each plan has: `name` (string), `stripePriceId` (string, from env var), `monthlyDocumentLimit` (number: 1 for free, 25 for pro, Infinity for enterprise), `features` (string array). - Export `getPlanByPriceId(priceId)` and `getPlanByName(name)` lookup functions. - Export `isWithinLimit(tier, documentsGeneratedThisMonth)` used by the usage limit check. - All Stripe price IDs come from environment variables (e.g., `STRIPE_PRO_PRICE_ID`, `STRIPE_ENTERPRISE_PRICE_ID`). This module is imported by the usage limit middleware (#1193) and billing status endpoint (#706) to avoid hardcoding plan details. --- *Generated by CEO Planner (priority: 3)*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pook/compliancebot#1200
No description provided.