Initial commit

This commit is contained in:
2025-12-31 00:52:08 +03:00
parent d4898869fa
commit d7072f88fc
4 changed files with 67 additions and 17 deletions
@@ -0,0 +1,19 @@
from trudex.domain.schemas import User as DomainUser
from trudex.infrastructure.database.models import User as UserModel
class UserDTO:
def __init__(self, model: UserModel) -> None:
self.model: UserModel = model
def to_domain(self) -> DomainUser:
return DomainUser(
id=self.model.id,
username=self.model.username,
first_name=self.model.first_name,
last_name=self.model.last_name,
group=self.model.group,
is_admin=self.model.is_admin,
created_at=self.model.created_at,
updated_at=self.model.updated_at,
)