1 use crate::newtypes::{CommentId, CommentReportId, PersonId};
2 #[cfg(feature = "full")]
3 use crate::schema::comment_report;
4 use serde::{Deserialize, Serialize};
5 use serde_with::skip_serializing_none;
6 #[cfg(feature = "full")]
9 #[skip_serializing_none]
10 #[derive(PartialEq, Eq, Serialize, Deserialize, Debug, Clone)]
11 #[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS))]
12 #[cfg_attr(feature = "full", diesel(belongs_to(crate::source::comment::Comment)))]
13 #[cfg_attr(feature = "full", diesel(table_name = comment_report))]
14 #[cfg_attr(feature = "full", ts(export))]
16 pub struct CommentReport {
17 pub id: CommentReportId,
18 pub creator_id: PersonId,
19 pub comment_id: CommentId,
20 pub original_comment_text: String,
23 pub resolver_id: Option<PersonId>,
24 pub published: chrono::NaiveDateTime,
25 pub updated: Option<chrono::NaiveDateTime>,
29 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
30 #[cfg_attr(feature = "full", diesel(table_name = comment_report))]
31 pub struct CommentReportForm {
32 pub creator_id: PersonId,
33 pub comment_id: CommentId,
34 pub original_comment_text: String,