from typing import Optional, Any

from .....core.interfaces.dto import Dto
from .....core.interfaces.core import Core
from .....enums.touch.pushes import PushUrgency

from .content import PusHistoryContent, PusHistoryContentDto


class PusHistory[T: Any, Properties: Any](Core[Properties]):
  to: str  # Push ID
  # from: Optional[str] # Mongo ID

  topic: Optional[str]
  urgency: Optional[PushUrgency]

  ttl: Optional[int]
  timeout: Optional[int]

  content: PusHistoryContent[T]

  status: int


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


class PusHistoryDto[T: Any, Properties: Any](Dto[Properties]):
  to: str  # Push ID
  # from: Optional[str] # Mongo ID

  topic: Optional[str]
  urgency: Optional[PushUrgency]

  ttl: Optional[int]
  timeout: Optional[int]

  content: PusHistoryContentDto[T]

  status: int


class PusHistorySendDto[T: Any, Properties: Any](Dto[Properties]):
  to: str  # Push ID
  # from: Optional[str] # Mongo ID

  topic: Optional[str]
  urgency: Optional[PushUrgency]

  ttl: Optional[int]
  timeout: Optional[int]

  content: PusHistoryContentDto[T]

  status: Optional[int]
