Add subscription tier lookup helper to resolve plan from Stripe price ID #822

Open
opened 2026-04-11 20:33:19 -04:00 by pook · 0 comments
Owner

Create src/billing/resolve-tier.ts with a resolvePlanFromPriceId(priceId: string) function that maps Stripe price IDs to plan names (free, pro, enterprise) using environment-configured mappings (STRIPE_PRO_PRICE_ID, etc). Return 'free' as default for unrecognized price IDs. Export a getUserPlan(userId) function that combines the subscription status check with price-to-tier resolution. Add unit tests with mock price IDs confirming correct tier mapping.


Generated by CEO Planner (priority: 3)

Create src/billing/resolve-tier.ts with a resolvePlanFromPriceId(priceId: string) function that maps Stripe price IDs to plan names (free, pro, enterprise) using environment-configured mappings (STRIPE_PRO_PRICE_ID, etc). Return 'free' as default for unrecognized price IDs. Export a getUserPlan(userId) function that combines the subscription status check with price-to-tier resolution. Add unit tests with mock price IDs confirming correct tier mapping. --- *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#822
No description provided.