From 8545a123abdc123da273d6996de35c795d1397cd Mon Sep 17 00:00:00 2001 From: chihlasm Date: Tue, 24 Feb 2026 03:34:55 -0500 Subject: [PATCH] fix: make account_id and account_role nullable in User type and schema The User model has account_id as Optional[UUID] but the frontend type and backend schema declared it non-nullable. Solo users without a team have no account, so both must allow null. Co-Authored-By: Claude Opus 4.6 --- backend/app/schemas/user.py | 4 ++-- frontend/src/types/user.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/app/schemas/user.py b/backend/app/schemas/user.py index b8983cb6..5b580e67 100644 --- a/backend/app/schemas/user.py +++ b/backend/app/schemas/user.py @@ -40,8 +40,8 @@ class UserLogin(BaseModel): class UserResponse(UserBase): id: UUID role: str = "engineer" - account_id: UUID - account_role: str + account_id: Optional[UUID] = None + account_role: Optional[str] = None is_super_admin: bool = False is_active: bool = True must_change_password: bool = False diff --git a/frontend/src/types/user.ts b/frontend/src/types/user.ts index 3a4adb15..f8b02582 100644 --- a/frontend/src/types/user.ts +++ b/frontend/src/types/user.ts @@ -8,8 +8,8 @@ export interface User { is_super_admin: boolean is_active: boolean must_change_password: boolean - account_id: string - account_role: 'owner' | 'engineer' | 'viewer' + account_id: string | null + account_role: 'owner' | 'engineer' | 'viewer' | null created_at: string last_login: string | null }