f3_rs/comment.rs
1// Copyright (C) 2023 Aravinth Manivannan <realaravinth@batsense.net>
2// SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>
3//
4// SPDX-License-Identifier: MIT
5
6//! Comments associated to an issue or a pull/merge request within the repository of a forge
7//! (Gitea, GitLab, etc.)
8use serde::{Deserialize, Serialize};
9
10use crate::Reaction;
11
12/// Comments associated to an issue or a pull/merge request within the repository of a forge
13/// (Gitea, GitLab, etc.)
14#[derive(Clone, Debug, Serialize, Deserialize, Default, Eq, PartialEq)]
15pub struct Comment {
16 /// Unique identifier of the issue or pull/merge request containing the comment
17 pub issue_index: usize,
18
19 /// Unique identifier of the comment
20 pub index: usize,
21
22 /// Unique identifier of the user who authored the comment
23 pub poster_id: usize,
24
25 // TODO: add validation for format "date-time"
26 /// Creating time
27 pub created: String,
28
29 // TODO: add validation for format "date-time"
30 /// Last update time
31 pub updated: String,
32
33 /// Multiline content of the comment
34 pub content: String,
35
36 /// Multiline content of the comment
37 pub reactions: Option<Vec<Reaction>>,
38}