Skip to content

Conversation

@roncodes
Copy link
Member

…s columns for both user & company

roncodes and others added 5 commits January 13, 2026 09:13
- Add onboarding_completed_at and onboarding_completed_by_uuid to companies table
- Add fields to Company model fillable and casts
- Add onboarding_completed boolean to Organization resource (for frontend)
- Fixes issue where additional users couldn't access console after org onboarding complete
- Company-level tracking ensures all users see same onboarding state
- verifyEmail() now sets company onboarding fields after successful verification
- Email verification is the final step of basic self-hosted onboarding
- Only sets if onboarding_completed_at is null (prevents overwriting)
- Ensures company onboarding status is consistent across all flows
Issue: First user created during onboarding not tracked in billing system
Root cause: User created BEFORE company exists, so company_uuid is null
Solution: Create company FIRST, then set company_uuid before user creation

Flow before:
1. User::create() - no company_uuid
2. Company created
3. assignCompany() - sets company_uuid after creation

Flow after:
1. Company::create() - company exists first
2. Set company_uuid in attributes
3. User::create() - with company_uuid set
4. assignCompany() - maintains relationship

This ensures ResourceCreatedListener can track the first user properly
since it requires company_uuid to log usage to billing_resource_usage table.

Related to fleetops driver creation fix (same issue, same solution).
@roncodes roncodes merged commit e799c5a into main Jan 14, 2026
1 check passed
@roncodes roncodes deleted the dev-v1.6.34 branch January 14, 2026 07:36
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.

2 participants