@@ -135,12 +135,12 @@ export class BillingModesImpl implements BillingModes {
135
135
// 3. Check team memberships/plans
136
136
// UBB overrides wins if there is _any_. But if there is none, use the existing Chargebee subscription.
137
137
const teamsModes = await Promise . all ( teams . map ( ( t ) => this . getBillingModeForTeam ( t , now ) ) ) ;
138
- const hasUbbPaidTeamSeat = teamsModes . some ( ( tm ) => tm . mode === "usage-based" && ! ! tm . paid ) ;
138
+ const hasUbbPaidTeam = teamsModes . some ( ( tm ) => tm . mode === "usage-based" && ! ! tm . paid ) ;
139
139
const hasCbTeam = teamsModes . some ( ( tm ) => tm . mode === "chargebee" ) ;
140
140
const hasCbTeamSeat = cbTeamSubscriptions . length > 0 ;
141
141
142
- if ( hasUbbPaidTeamSeat || hasUbbPersonal ) {
143
- // UBB is greedy: once a user has at least a team seat , they should benefit from it!
142
+ if ( hasUbbPaidTeam || hasUbbPersonal ) {
143
+ // UBB is greedy: once a user has at least a paid team membership , they should benefit from it!
144
144
const result : BillingMode = { mode : "usage-based" } ;
145
145
if ( hasCbTeam ) {
146
146
result . hasChargebeeTeamPlan = true ;
@@ -198,7 +198,7 @@ export class BillingModesImpl implements BillingModes {
198
198
199
199
// 3. Now we're usage-based. We only have to figure out whether we have a plan yet or not.
200
200
const result : BillingMode = { mode : "usage-based" } ;
201
- const customer = await this . stripeSvc . findCustomerByUserId ( team . id ) ;
201
+ const customer = await this . stripeSvc . findCustomerByTeamId ( team . id ) ;
202
202
if ( customer ) {
203
203
const subscription = await this . stripeSvc . findUncancelledSubscriptionByCustomer ( customer . id ) ;
204
204
if ( subscription ) {
0 commit comments