diff --git a/chain_service/dependencies/progress_action_service_factory.py b/chain_service/dependencies/progress_action_service_factory.py index 1432f6d..f213391 100644 --- a/chain_service/dependencies/progress_action_service_factory.py +++ b/chain_service/dependencies/progress_action_service_factory.py @@ -1,11 +1,14 @@ +from .planfix_client import PlanfixClientDependency from chain_service.services.progress_action.factory import ProgressActionServiceFactory from fastapi import Depends from typing import Annotated -def get_progress_action_service_factory() -> ProgressActionServiceFactory: - return ProgressActionServiceFactory() +def get_progress_action_service_factory( + planfix_client: PlanfixClientDependency, +) -> ProgressActionServiceFactory: + return ProgressActionServiceFactory(planfix_client=planfix_client) ProgressActionServiceFactoryDependency = Annotated[ diff --git a/chain_service/services/progress_action/factory.py b/chain_service/services/progress_action/factory.py index e6d6683..dc2ac1d 100644 --- a/chain_service/services/progress_action/factory.py +++ b/chain_service/services/progress_action/factory.py @@ -4,9 +4,14 @@ from .base import BaseProgressActionService from .wait_progress_action import WaitProgressActionService from .comment_progress_action import CommentProgressActionService +from planfix_client import PlanfixClient + class ProgressActionServiceFactory: + def __init__(self, planfix_client: PlanfixClient): + self.planfix_client = planfix_client + def __call__( self, progress_action: BaseProgressAction ) -> BaseProgressActionService: @@ -17,4 +22,4 @@ class ProgressActionServiceFactory: return WaitProgressActionService() case "comment": - return CommentProgressActionService() + return CommentProgressActionService(planfix_client=self.planfix_client)