chain-service/chain_service/services/progress_action/comment_progress_action.py
2024-02-28 18:45:04 +07:00

27 lines
739 B
Python

from .base import BaseProgressActionService
from chain_service.database.models.progress_chain import (
CommentProgressAction,
ProgressChain,
)
from planfix_client import PlanfixClient
class CommentProgressActionService(BaseProgressActionService):
def __init__(
self,
planfix_client: PlanfixClient,
progress_chain: ProgressChain,
progress_action: CommentProgressAction,
):
self.planfix_client = planfix_client
self.progress_chain = progress_chain
self.progress_action = progress_action
async def process(self):
await self.planfix_client.create_comment(
task_id=self.progress_chain.task_id, description=self.progress_action.text
)