(plan: string | null | undefined)
| 76 | * Looks up from CREDIT_TIERS for exact mapping, with legacy plan fallbacks. |
| 77 | */ |
| 78 | export 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. |
no test coverage detected