complete loading single items

This commit is contained in:
Thomas Peetz
2026-05-21 13:43:53 +02:00
committed by Thomas Peetz
parent 87c6fb7071
commit d862476097
38 changed files with 431 additions and 156 deletions
+25 -1
View File
@@ -1,3 +1,5 @@
from datetime import datetime
from pydantic import BaseModel
from src.db.models.admin import Profile
@@ -5,8 +7,30 @@ from src.db.models.admin import Profile
class ProfileResponse(BaseModel):
id: str
username: str
created_date: datetime
last_modified_date: datetime
version: int
first_name: str
last_name: str
user_name: str
email: str
password: str
enabled: bool
def to_response(profile: Profile) -> ProfileResponse:
response: ProfileResponse = ProfileResponse(
id=profile.id,
created_date=profile.created_date,
last_modified_date=profile.last_modified_date,
version=profile.version,
first_name=profile.first_name,
last_name=profile.last_name,
user_name=profile.user_name,
email=profile.email,
password=profile.password,
enabled=profile.enabled
)
return response
class ProfileModel(BaseModel):
username: str