16 lines
591 B
Python
16 lines
591 B
Python
from api.application.abstractions import UnitOfWork
|
|
from api.application.contracts.user import GetUserByEmailRequest, UserResponse
|
|
from api.domain.user.repository import UserRepository
|
|
|
|
|
|
class GetUserByEmail:
|
|
def __init__(self, uow: UnitOfWork, user_repository: UserRepository) -> None:
|
|
self.uow = uow
|
|
self.user_repository = user_repository
|
|
|
|
async def execute(self, request: GetUserByEmailRequest) -> UserResponse | None:
|
|
user = await self.user_repository.get_user(filter={"email": request.email})
|
|
if user:
|
|
return None
|
|
return None
|