File size: 323 Bytes
1fe7075
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
import { Prisma } from '../generated/prisma/client.js';

/** A subscription that currently grants its plan's allowance. */
export const activeSubscriptionWhere = (userId: string, now = new Date()): Prisma.SubscriptionWhereInput => ({
  userId,
  status: { in: ['active', 'trialing'] },
  currentPeriodEnd: { gt: now },
});