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

Function isSubscriptionOrgScoped

apps/sim/lib/billing/core/billing.ts:97–104  ·  view source on GitHub ↗
(sub: { referenceId: string })

Source from the content-addressed store, hash-verified

95 * `isOrgScopedSubscription(sub, userId)` is cheaper and equally correct.
96 */
97export async function isSubscriptionOrgScoped(sub: { referenceId: string }): Promise<boolean> {
98 const rows = await db
99 .select({ id: organization.id })
100 .from(organization)
101 .where(eq(organization.id, sub.referenceId))
102 .limit(1)
103 return rows.length > 0
104}
105
106/**
107 * Aggregate raw pooled stats for all members of an organization in a single

Calls 1

eqFunction · 0.50

Tested by

no test coverage detected