MCPcopy Index your code
hub / github.com/simstudioai/sim / resolvePlanTier

Function resolvePlanTier

apps/sim/lib/billing/client/plan-view.ts:58–62  ·  view source on GitHub ↗
(plan: string | null | undefined)

Source from the content-addressed store, hash-verified

56 * into `pro` / `max` by their credit allocation (>= 25k credits => Max).
57 */
58export function resolvePlanTier(plan: string | null | undefined): PlanTier {
59 if (isEnterprise(plan)) return 'enterprise'
60 if (isFree(plan)) return 'free'
61 return getPlanTierCredits(plan) >= MAX_TIER_CREDITS ? 'max' : 'pro'
62}
63
64/**
65 * Derive the CTA for a single upgrade card given the current plan tier.

Callers 1

derivePlanViewFunction · 0.85

Calls 3

isEnterpriseFunction · 0.90
isFreeFunction · 0.90
getPlanTierCreditsFunction · 0.90

Tested by

no test coverage detected