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 ....core.interfaces.reaction import Reaction
from ....enums.general.comments import CommentStatus


class Comment[Properties: Any](Core[Properties]):
  type: Optional[str]  # Comment type: comment, review, feedback, etc.

  post: Optional[str]  # Post ID
  ticket: Optional[str]  # Ticket ID

  content: str

  level: Optional[int]  # Depth of the comment in a thread for nested comments

  parent: Optional[str]  # Comment ID

  state: Optional[State]
  status: Optional[CommentStatus]
  visibility: Optional[str]  # Example: 'public', 'private', 'internal'

  rate: Optional[float]
  votes: Optional[int]
  rating: Optional[float]

  views: Optional[int]
  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 CommentDto[Properties: Any](Dto[Properties]):
  type: Optional[str]  # Comment type: comment, review, feedback, etc.

  post: Optional[str]  # Post ID
  ticket: Optional[str]  # Ticket ID

  content: str

  level: Optional[int]  # Depth of the comment in a thread for nested comments

  parent: Optional[str]  # Comment ID

  state: Optional[State]
  status: Optional[CommentStatus]
  visibility: Optional[str]  # Example: 'public', 'private', 'internal'

  rate: Optional[float]
  votes: Optional[int]
  rating: Optional[float]

  views: Optional[int]
  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]]
