Skip to main content

docx_review_core/model/
comment.rs

1use chrono::{DateTime, Utc};
2use serde::{Deserialize, Serialize};
3
4use super::{CommentId, TextAnchor};
5
6/// A comment extracted from the DOCX review layer.
7#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
8#[non_exhaustive]
9pub struct Comment {
10    /// Stable comment identifier in the normalized model.
11    pub id: CommentId,
12    /// Original DOCX comment id when available.
13    pub imported_id: Option<String>,
14    /// Comment author.
15    pub author: Option<String>,
16    /// Comment creation time.
17    pub date: Option<DateTime<Utc>>,
18    /// Plain-text comment body.
19    pub text: String,
20    /// Text anchors associated with this comment.
21    pub anchors: Vec<TextAnchor>,
22    /// Visible text covered by the resolved anchors when available.
23    pub anchored_text: Option<String>,
24    /// Resolved state from extended comment metadata when available.
25    pub resolved: Option<bool>,
26    /// Parent comment id for threaded replies.
27    pub parent_id: Option<CommentId>,
28    /// Child reply ids for threaded comments.
29    pub replies: Vec<CommentId>,
30}