from typing import Optional, Any

from ....core.enums.state import State
from ....core.interfaces.dto import Dto
from ....core.interfaces.core import Core
from ....enums.general.activities import ActivityType


class Activity[T: Any, M: Any, Properties: Any](Core[Properties]):
  type: ActivityType
  state: Optional[State]
  source: Optional[str]

  message: str
  details: Optional[T]
  metadata: Optional[M]


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


class ActivityDto[T: Any, M: Any, Properties: Any](Dto[Properties]):
  type: ActivityType
  state: Optional[State]
  source: Optional[str]

  message: str
  details: Optional[T]
  metadata: Optional[M]
