feat: add reset password

This commit is contained in:
2026-05-19 15:23:22 +03:00
parent bd1faffbb0
commit 9c2190737a
13 changed files with 430 additions and 6 deletions

View File

@@ -122,3 +122,21 @@ class UserRepository(IUserRepository):
except SQLAlchemyError as exception:
self._logger.exception(str(exception))
raise InternalException(message=f'Database error: {str(exception)}')
async def get_user_by_email(self, email: str) -> UserEntity | None:
try:
stmt = (
select(UserModel)
.where(
UserModel.email == email,
UserModel.is_deleted.is_(False),
)
)
result = await self._session.execute(stmt)
user: UserModel | None = result.scalar_one_or_none()
if user is None:
return None
return self._to_entity(user)
except SQLAlchemyError as exception:
self._logger.exception(str(exception))
raise InternalException(message=f'Database error: {str(exception)}')