use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};

use super::{CommentId, TextAnchor};

/// A comment extracted from the DOCX review layer.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct Comment {
    /// Stable comment identifier in the normalized model.
    pub id: CommentId,
    /// Original DOCX comment id when available.
    pub imported_id: Option<String>,
    /// Comment author.
    pub author: Option<String>,
    /// Comment creation time.
    pub date: Option<DateTime<Utc>>,
    /// Plain-text comment body.
    pub text: String,
    /// Text anchors associated with this comment.
    pub anchors: Vec<TextAnchor>,
    /// Visible text covered by the resolved anchors when available.
    pub anchored_text: Option<String>,
    /// Resolved state from extended comment metadata when available.
    pub resolved: Option<bool>,
    /// Parent comment id for threaded replies.
    pub parent_id: Option<CommentId>,
    /// Child reply ids for threaded comments.
    pub replies: Vec<CommentId>,
}
