chain-service/chain_service/services/progress_action/factory.py
2024-02-28 18:09:12 +07:00

21 lines
594 B
Python

from chain_service.database.models.progress_chain import BaseProgressAction
from .base import BaseProgressActionService
from .wait_progress_action import WaitProgressActionService
from .comment_progress_action import CommentProgressActionService
class ProgressActionServiceFactory:
def __call__(
self, progress_action: BaseProgressAction
) -> BaseProgressActionService:
match progress_action.action_type:
case "wait":
return WaitProgressActionService()
case "comment":
return CommentProgressActionService()