( organizationId: string )
| 188 | * blocked consistently with accept-time provisioning. |
| 189 | */ |
| 190 | export async function getInvitePlanCategoryForOrganization( |
| 191 | organizationId: string |
| 192 | ): Promise<PlanCategory> { |
| 193 | try { |
| 194 | const orgSub = await getOrganizationSubscription(organizationId) |
| 195 | if (!orgSub || !hasUsableSubscriptionStatus(orgSub.status)) return 'free' |
| 196 | return getPlanType(orgSub.plan) |
| 197 | } catch (error) { |
| 198 | logger.error('Failed to resolve organization subscription for invite policy', { |
| 199 | organizationId, |
| 200 | error, |
| 201 | }) |
| 202 | return 'free' |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | /** |
| 207 | * Resolve the invite-governing plan category for a single billed account |
no test coverage detected