2024-03-31 04:18:41 +03:00
|
|
|
from typing import Annotated
|
|
|
|
|
|
|
|
from fastapi import Depends
|
|
|
|
|
|
|
|
from api.application.abstractions.uow import UnitOfWork
|
|
|
|
from api.application.usecase.create_user import CreateUser
|
|
|
|
from api.domain.user.repository import UserRepository
|
2024-03-31 21:07:59 +03:00
|
|
|
from api.infrastructure.dependencies.stub import Stub
|
2024-03-31 04:18:41 +03:00
|
|
|
|
|
|
|
|
|
|
|
def provide_create_user(
|
2024-03-31 21:07:59 +03:00
|
|
|
user_repository: Annotated[UserRepository, Depends(Stub(UserRepository))],
|
2024-03-31 04:18:41 +03:00
|
|
|
uow: Annotated[UnitOfWork, Depends()],
|
|
|
|
) -> CreateUser:
|
|
|
|
return CreateUser(uow=uow, user_repository=user_repository)
|