feat: Adds admin UI for active user billing + adds a minseats option#27929
feat: Adds admin UI for active user billing + adds a minseats option#27929sean-brydon wants to merge 3 commits intomainfrom
Conversation
|
Sean Brydon seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
| ); | ||
|
|
||
| const billingInfo = await this.deps.billingPeriodService.getBillingPeriodInfo(team.id); | ||
| const billedCount = Math.max(activeUserCount, billingInfo.minSeats ?? 0); |
There was a problem hiding this comment.
Hit min seats if active count is below. If not set minSeats to 0 so we use activeUserCount
There was a problem hiding this comment.
2 issues found across 19 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="packages/features/ee/organizations/lib/service/onboarding/BaseOnboardingService.ts">
<violation number="1" location="packages/features/ee/organizations/lib/service/onboarding/BaseOnboardingService.ts:134">
P2: `billingMode`/`minSeats` are only saved for new onboarding records. When resuming an onboarding (`input.onboardingId`), the update payload omits these fields, so any changes to billing mode or min seats are silently dropped. Add these fields to the update payload so the resume flow persists them.</violation>
</file>
<file name="packages/features/ee/billing/service/seatBillingStrategy/ActiveUserBillingStrategy.ts">
<violation number="1" location="packages/features/ee/billing/service/seatBillingStrategy/ActiveUserBillingStrategy.ts:50">
P2: Move the `subscriptionItem` guard before the new `getBillingPeriodInfo` call to avoid an unnecessary async operation when the subscription has no items. Per the project's early-return convention, guard checks should precede any work that depends on those guards passing.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| pricePerSeat: input.pricePerSeat, | ||
| billingPeriod: input.billingPeriod, | ||
| billingMode: input.billingMode, | ||
| minSeats: input.minSeats, |
There was a problem hiding this comment.
P2: billingMode/minSeats are only saved for new onboarding records. When resuming an onboarding (input.onboardingId), the update payload omits these fields, so any changes to billing mode or min seats are silently dropped. Add these fields to the update payload so the resume flow persists them.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/features/ee/organizations/lib/service/onboarding/BaseOnboardingService.ts, line 134:
<comment>`billingMode`/`minSeats` are only saved for new onboarding records. When resuming an onboarding (`input.onboardingId`), the update payload omits these fields, so any changes to billing mode or min seats are silently dropped. Add these fields to the update payload so the resume flow persists them.</comment>
<file context>
@@ -130,6 +130,8 @@ export abstract class BaseOnboardingService implements IOrganizationOnboardingSe
pricePerSeat: input.pricePerSeat,
billingPeriod: input.billingPeriod,
+ billingMode: input.billingMode,
+ minSeats: input.minSeats,
createdByUserId: this.user.id,
logo: processedAssets.logo ?? null,
</file context>
| periodEnd | ||
| ); | ||
|
|
||
| const billingInfo = await this.deps.billingPeriodService.getBillingPeriodInfo(team.id); |
There was a problem hiding this comment.
P2: Move the subscriptionItem guard before the new getBillingPeriodInfo call to avoid an unnecessary async operation when the subscription has no items. Per the project's early-return convention, guard checks should precede any work that depends on those guards passing.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/features/ee/billing/service/seatBillingStrategy/ActiveUserBillingStrategy.ts, line 50:
<comment>Move the `subscriptionItem` guard before the new `getBillingPeriodInfo` call to avoid an unnecessary async operation when the subscription has no items. Per the project's early-return convention, guard checks should precede any work that depends on those guards passing.</comment>
<file context>
@@ -45,6 +47,9 @@ export class ActiveUserBillingStrategy extends BaseSeatBillingStrategy {
periodEnd
);
+ const billingInfo = await this.deps.billingPeriodService.getBillingPeriodInfo(team.id);
+ const billedCount = Math.max(activeUserCount, billingInfo.minSeats ?? 0);
+
</file context>
Devin AI is addressing Cubic AI's review feedbackA Devin session has been created to address the issues identified by Cubic AI. |
|
Reviewed both Cubic AI findings. Neither meets the 9/10 confidence threshold for automated fixes:
No changes pushed. |
How to test
invoice.upcomingis firedSummary by cubic
Adds admin controls to select billing mode (Seats or Active Users) during org creation and introduces a minSeats floor for Active Users billing. The floor is applied across onboarding, checkout/handover, billing info, and invoice updates.
New Features
Migration
Written for commit e95645c. Summary will update on new commits.