diff --git a/components/server/ee/src/billing/billing-mode.spec.db.ts b/components/server/ee/src/billing/billing-mode.spec.db.ts index e770620a09d3dc..be9252029afb90 100644 --- a/components/server/ee/src/billing/billing-mode.spec.db.ts +++ b/components/server/ee/src/billing/billing-mode.spec.db.ts @@ -281,6 +281,18 @@ class BillingModeSpec { }, }, // user: usage-based + { + name: "user: stripe free, chargebee FREE (old)", + subject: user(), + config: { + enablePayment: true, + usageBasedPricingEnabled: true, + subscriptions: [subscription(Plans.FREE)], + }, + expectation: { + mode: "usage-based", + }, + }, { name: "user: stripe free, chargebee paid personal (inactive) + team seat (inactive)", subject: user(), diff --git a/components/server/ee/src/billing/billing-mode.ts b/components/server/ee/src/billing/billing-mode.ts index 459c3135119e17..f92c0e510fa098 100644 --- a/components/server/ee/src/billing/billing-mode.ts +++ b/components/server/ee/src/billing/billing-mode.ts @@ -127,7 +127,11 @@ export class BillingModesImpl implements BillingModes { const cbSubscriptions = await this.subscriptionSvc.getActivePaidSubscription(user.id, now); const cbTeamSubscriptions = cbSubscriptions.filter((s) => isOldTeamSubscription(s)); const cbPersonalSubscriptions = cbSubscriptions.filter( - (s) => isPersonalSubscription(s) && s.planId !== Plans.FREE_OPEN_SOURCE.chargebeeId, + (s) => + isPersonalSubscription(s) && + ![Plans.FREE_OPEN_SOURCE.chargebeeId, Plans.FREE.chargebeeId, Plans.FREE_50.chargebeeId].includes( + s.planId!, + ), ); const cbOwnedTeamSubscriptions = ( await this.teamSubscriptionDb.findTeamSubscriptions({ userId: user.id })