from src.schemas.users import UserRequestADD, User, UserAdd from src.services.base import BaseService from src.utils.auth_manager import AuthManger class AuthService(BaseService): async def registration(self, cred: UserRequestADD) -> User: hashed_pass = AuthManger.get_password_hash(cred.password) user_to_insert = UserAdd( username=cred.username, email=cred.email, hashed_password=hashed_pass, is_active=True, is_superuser=False, ) result = await self.session.user.create_one(user_to_insert) print(result) await self.session.commit() return User.model_validate(result)