Skip to content

fix(admin): default trial org plan to enterprise when created from admin dashboard#3812

Open
kilo-code-bot[bot] wants to merge 1 commit into
mainfrom
fix/admin-trial-default-plan-enterprise
Open

fix(admin): default trial org plan to enterprise when created from admin dashboard#3812
kilo-code-bot[bot] wants to merge 1 commit into
mainfrom
fix/admin-trial-default-plan-enterprise

Conversation

@kilo-code-bot

@kilo-code-bot kilo-code-bot Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • When an admin manually creates a trial org from the trials dashboard, the org plan was defaulting to teams (the DB schema default) because no plan was passed to createOrganization.
  • This change explicitly passes 'enterprise' as the plan in the admin router's create mutation, so orgs started manually from the trials dashboard are created with the enterprise plan.

Verification

  1. Navigate to the admin trials dashboard (/admin/organizations/trials)
  2. Click "Create Org Trial" and enter an org name
  3. Verify the newly created org has plan enterprise (check via the org admin page or DB)

Visual Changes

N/A

Reviewer Notes

The DB schema default for plan remains 'teams' — this change only affects the admin-initiated trial creation path. All other org creation flows (e.g., self-serve signup) are unaffected.


Built for Alex Gold by Kilo for Slack

@kilo-code-bot

kilo-code-bot Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Executive Summary

The fix correctly passes 'enterprise' as the plan for admin-initiated trial orgs, but the create mutation has no tests and the positional-undefined call site makes the intent opaque.

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
apps/web/src/routers/organizations/organization-admin-router.ts 177–183 The create mutation has no test coverage. The new behavior (orgs created with enterprise plan instead of the schema default teams) is entirely untested. A test that calls organizations.admin.create, then reads the org from the DB and asserts plan === 'enterprise', would confirm this fix and guard against regressions.

SUGGESTION

File Line Issue
apps/web/src/routers/organizations/organization-admin-router.ts 177–183 Positional undefined arguments (undefined, true, undefined, 'enterprise') are fragile — a future parameter insertion could silently shift the plan to the wrong slot. Consider leaving a comment mapping the args to parameter names, or extracting the options into named variables, to make the intent obvious to future readers. This is a style concern only and does not block merge.
Other Observations (not in diff)
  • apps/web/src/lib/organizations/organizations.ts:211 — The logic if (!userId || !addUserAsOwner) means that passing userId=undefined with addUserAsOwner=true still skips adding a member. This is the correct existing behaviour for the admin path (no user is attached at creation time), but the addUserAsOwner: true argument passed in this PR is effectively a no-op. Passing false (or undefined to take the default) would be more honest, though this does not change runtime behaviour.
Files Reviewed (1 file)
  • apps/web/src/routers/organizations/organization-admin-router.ts — 1 warning, 1 suggestion

Fix these issues in Kilo Cloud


Reviewed by claude-4.6-sonnet-20260217 · 686,183 tokens

Review guidance: REVIEW.md from base branch main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants