1 use crate::newtypes::{CommentId, CommentReportId, PersonId};
2 use serde::{Deserialize, Serialize};
4 #[cfg(feature = "full")]
5 use crate::schema::comment_report;
7 #[derive(PartialEq, Serialize, Deserialize, Debug, Clone)]
8 #[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
9 #[cfg_attr(feature = "full", belongs_to(crate::source::comment::Comment))]
10 #[cfg_attr(feature = "full", table_name = "comment_report")]
11 pub struct CommentReport {
12 pub id: CommentReportId,
13 pub creator_id: PersonId,
14 pub comment_id: CommentId,
15 pub original_comment_text: String,
18 pub resolver_id: Option<PersonId>,
19 pub published: chrono::NaiveDateTime,
20 pub updated: Option<chrono::NaiveDateTime>,
24 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
25 #[cfg_attr(feature = "full", table_name = "comment_report")]
26 pub struct CommentReportForm {
27 pub creator_id: PersonId,
28 pub comment_id: CommentId,
29 pub original_comment_text: String,