MCPcopy
hub / github.com/simstudioai/sim / getPlanTierDollars

Function getPlanTierDollars

apps/sim/lib/billing/plan-helpers.ts:78–86  ·  view source on GitHub ↗
(plan: string | null | undefined)

Source from the content-addressed store, hash-verified

76 * Looks up from CREDIT_TIERS for exact mapping, with legacy plan fallbacks.
77 */
78export function getPlanTierDollars(plan: string | null | undefined): number {
79 if (!plan) return 0
80 const credits = getPlanTierCredits(plan)
81 const tier = CREDIT_TIERS.find((t) => t.credits === credits)
82 if (tier) return tier.dollars
83 if (plan === 'pro') return DEFAULT_PRO_TIER_COST_LIMIT
84 if (plan === 'team') return DEFAULT_TEAM_TIER_COST_LIMIT
85 return 0
86}
87
88/**
89 * Return the broad plan category regardless of tier suffix.

Callers 9

computeOrgOverageAmountFunction · 0.90
getUserUsageDataFunction · 0.90
checkUsageStatusFunction · 0.90
applyOrgRefreshFunction · 0.90
BillingFunction · 0.90

Calls 1

getPlanTierCreditsFunction · 0.85

Tested by

no test coverage detected