from typing import Optional, List, Any

from ....core.interfaces.dto import Dto
from ....core.interfaces.core import Core
from ....enums.general.workflows import WorkflowStatus


from .token import WorkflowToken, WorkflowTokenDto


class Workflow[D: Any, V: Any, Properties: Any](Core[Properties]):
  name: str

  status: WorkflowStatus
  tokens: List[WorkflowToken[V]]

  data: Optional[D]


# ----------------------------------------
# Data Transfer Object Interface
# ----------------------------------------


class WorkflowDto[D: Any, V: Any, Properties: Any](Dto[Properties]):
  name: str

  status: WorkflowStatus
  tokens: List[WorkflowTokenDto[V]]

  data: Optional[D]
