add rest of tier types

This commit is contained in:
miloschwartz
2026-02-09 17:52:28 -08:00
committed by Owen
parent 86d089024e
commit 50bc8d3e9c
3 changed files with 15 additions and 14 deletions

View File

@@ -13,12 +13,13 @@
import { build } from "@server/build";
import { db, customers, subscriptions } from "@server/db";
import { Tier } from "@server/types/Tiers";
import { eq, and, ne } from "drizzle-orm";
export async function getOrgTierData(
orgId: string
): Promise<{ tier: "tier1" | "tier2" | "tier3" | null; active: boolean }> {
let tier: "tier1" | "tier2" | "tier3" | null = null;
): Promise<{ tier: Tier | null; active: boolean }> {
let tier: Tier | null = null;
let active = false;
if (build !== "saas") {

View File

@@ -20,8 +20,9 @@ import {
getScaleFeaturePriceSet,
} from "@server/lib/billing/features";
import Stripe from "stripe";
import { Tier } from "@server/types/Tiers";
export type SubscriptionType = "tier1" | "tier2" | "tier3" | "license";
export type SubscriptionType = Tier | "license";
export function getSubType(fullSubscription: Stripe.Response<Stripe.Subscription>): SubscriptionType | null {
// Determine subscription type by checking subscription items