from typing import Optional, List, Any

from ....core.enums.state import State
from ....core.interfaces.dto import Dto
from ....core.interfaces.core import Core
from ....enums.content.notes import NoteType
from ....core.interfaces.reaction import Reaction


class Note[Properties: Any](Core[Properties]):
  type: NoteType

  state: Optional[State]
  status: Optional[str]

  content: str

  level: Optional[int]  # Depth in a thread for nested

  parent: Optional[str]  # Comment ID
  relation: Optional[str]  # Post or Ticket ID
  visibility: Optional[str]  # Example: 'public', 'private', 'internal'

  loves: Optional[int]
  likes: Optional[int]
  dislikes: Optional[int]

  mentions: Optional[List[str]]  # User ID's
  attachments: Optional[List[str]]  # File ID's

  reactions: Optional[List[Reaction]]


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


class NoteDto[Properties: Any](Dto[Properties]):
  type: NoteType

  state: Optional[State]
  status: Optional[str]

  content: str

  level: Optional[int]  # Depth in a thread for nested

  parent: Optional[str]  # Comment ID
  relation: Optional[str]  # Post or Ticket ID
  visibility: Optional[str]  # Example: 'public', 'private', 'internal'

  loves: Optional[int]
  likes: Optional[int]
  dislikes: Optional[int]

  mentions: Optional[List[str]]  # User ID's
  attachments: Optional[List[str]]  # File ID's

  reactions: Optional[List[Reaction]]
