From 148ea1db10edc62cf04b3698de6a6ac5d67a21db Mon Sep 17 00:00:00 2001 From: Robert Date: Wed, 28 Feb 2024 18:45:04 +0700 Subject: [PATCH] comment creation logic --- .../progress_action/comment_progress_action.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/chain_service/services/progress_action/comment_progress_action.py b/chain_service/services/progress_action/comment_progress_action.py index e51bb70..2f26f82 100644 --- a/chain_service/services/progress_action/comment_progress_action.py +++ b/chain_service/services/progress_action/comment_progress_action.py @@ -1,7 +1,7 @@ from .base import BaseProgressActionService from chain_service.database.models.progress_chain import ( - BaseProgressAction, + CommentProgressAction, ProgressChain, ) @@ -14,10 +14,13 @@ class CommentProgressActionService(BaseProgressActionService): self, planfix_client: PlanfixClient, progress_chain: ProgressChain, - progress_action: BaseProgressAction, + progress_action: CommentProgressAction, ): self.planfix_client = planfix_client - super().__init__(progress_chain, progress_action) + self.progress_chain = progress_chain + self.progress_action = progress_action async def process(self): - print("Comment service", self.progress_action, self.planfix_client) + await self.planfix_client.create_comment( + task_id=self.progress_chain.task_id, description=self.progress_action.text + )