33from dataclasses import dataclass , field
44from datetime import date , datetime
55from typing import Optional
6- from uuid import UUID , uuid4
76
87
98@dataclass
109class UserProfile :
1110 """User profile containing personal information."""
1211
13- user_id : UUID
12+ user_id : int
1413 first_name : Optional [str ] = None
1514 last_name : Optional [str ] = None
1615 display_name : Optional [str ] = None
@@ -25,7 +24,7 @@ class UserProfile:
2524class UserSettings :
2625 """User preferences and settings."""
2726
28- user_id : UUID
27+ user_id : int
2928 preferences : dict = field (default_factory = dict )
3029 created_at : Optional [str ] = None
3130 updated_at : Optional [str ] = None
@@ -35,7 +34,7 @@ class UserSettings:
3534class UserSecurity :
3635 """User security configuration and state."""
3736
38- user_id : UUID
37+ user_id : int
3938 failed_login_attempts : int = 0
4039 locked_until : Optional [datetime ] = None
4140 password_changed_at : Optional [datetime ] = None
@@ -46,11 +45,11 @@ class UserSecurity:
4645 updated_at : Optional [str ] = None
4746
4847
49- @dataclass
48+ @dataclass ( kw_only = True )
5049class User :
5150 """Core user identity and authentication aggregate root."""
5251
53- id : UUID
52+ id : int | None = None
5453 email : str
5554 password_hash : str
5655
@@ -77,7 +76,7 @@ def create(
7776 auth_provider : str = "local" ,
7877 ) -> User :
7978 return cls (
80- id = uuid4 () ,
79+ id = None ,
8180 email = email ,
8281 password_hash = password_hash ,
8382 username = username ,
0 commit comments