from typing import Optional, List, Any
from datetime import datetime

from ....core.interfaces.dto import Dto
from ....core.interfaces.core import Core
from ....enums.touch.notices import NoticeType

from .action import NoticeAction, NoticeActionDto


class Notice[Properties: Any](Core[Properties]):
  type: NoticeType

  title: str
  subtitle: Optional[str]

  content: str
  category: Optional[str]

  visited: Optional[bool]
  visited_at: Optional[datetime]
  visited_by: Optional[str]
  visited_in: Optional[str]

  thumbnail: Optional[str]
  attachments: Optional[List[str]]

  actions: Optional[List[NoticeAction]]


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


class NoticeDto[Properties: Any](Dto[Properties]):
  type: NoticeType

  title: str
  subtitle: Optional[str]

  content: str
  category: Optional[str]

  visited: Optional[bool]
  visited_at: Optional[datetime]
  visited_by: Optional[str]
  visited_in: Optional[str]

  thumbnail: Optional[str]
  attachments: Optional[List[str]]

  actions: Optional[List[NoticeActionDto]]
