"""DTOs for comment use cases. This module defines Data Transfer Objects used for communication between application layer comment use cases and presentation layer. """ from dataclasses import dataclass from datetime import datetime from uuid import UUID @dataclass(frozen=True) class CreateCommentDTO: """DTO for creating a comment. Carries comment creation data from API to use case. Attributes: post_id: UUID of the post to comment on. author_id: Identifier of the comment author. content: Comment content string (Markdown supported). parent_id: Optional UUID of parent comment for replies. """ post_id: UUID author_id: str content: str parent_id: UUID | None = None @dataclass(frozen=True) class CommentResponseDTO: """DTO for comment response. Carries complete comment data for API responses. Attributes: id: Unique comment identifier. post_id: UUID of the parent post. author_id: Comment author identifier. content: Comment content string. parent_id: Optional UUID of parent comment. like_count: Number of likes on this comment. created_at: Creation timestamp. updated_at: Last update timestamp. """ id: UUID post_id: UUID author_id: str content: str parent_id: UUID | None = None like_count: int = 0 created_at: datetime | None = None updated_at: datetime | None = None