service_man/api/infrastructure/dependencies/usecases.py

18 lines
714 B
Python

from typing import Annotated
from fastapi import Depends
from api.application.abstractions.uow import UnitOfWork
from api.application.protocols.password_hasher import PasswordHasher
from api.application.usecase.auth.create_user import CreateUser
from api.domain.user.repository import UserRepository
from api.infrastructure.dependencies.stub import Stub
def provide_create_user(
user_repository: Annotated[UserRepository, Depends(Stub(UserRepository))],
uow: Annotated[UnitOfWork, Depends(Stub(UnitOfWork))],
password_hasher: Annotated[PasswordHasher, Depends(Stub(PasswordHasher))],
) -> CreateUser:
return CreateUser(uow=uow, user_repository=user_repository, password_hasher=password_hasher)