mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
## Description Add support for enterprise billing plans. Enterprise billing plans by default get access to everything early adopters do: - Unlimited teams - Unlimited documents They will also get additional features in the future. ## Notes Pending webhook updates to support enterprise onboarding. Rolled back env changes `NEXT_PUBLIC_PROJECT` since it doesn't seem to work.
16 lines
480 B
TypeScript
16 lines
480 B
TypeScript
import type { Subscription } from '.prisma/client';
|
|
import { SubscriptionStatus } from '.prisma/client';
|
|
|
|
/**
|
|
* Returns true if there is a subscription that is active and is one of the provided price IDs.
|
|
*/
|
|
export const subscriptionsContainsActivePlan = (
|
|
subscriptions: Subscription[],
|
|
priceIds: string[],
|
|
) => {
|
|
return subscriptions.some(
|
|
(subscription) =>
|
|
subscription.status === SubscriptionStatus.ACTIVE && priceIds.includes(subscription.priceId),
|
|
);
|
|
};
|