]> Untitled Git - lemmy.git/blob - crates/db_schema/src/source/comment_report.rs
Clean up reporting (#1776)
[lemmy.git] / crates / db_schema / src / source / comment_report.rs
1 use crate::{
2   schema::comment_report,
3   source::comment::Comment,
4   CommentId,
5   CommentReportId,
6   PersonId,
7 };
8 use serde::{Deserialize, Serialize};
9
10 #[derive(
11   Identifiable, Queryable, Associations, PartialEq, Serialize, Deserialize, Debug, Clone,
12 )]
13 #[belongs_to(Comment)]
14 #[table_name = "comment_report"]
15 pub struct CommentReport {
16   pub id: CommentReportId,
17   pub creator_id: PersonId,
18   pub comment_id: CommentId,
19   pub original_comment_text: String,
20   pub reason: String,
21   pub resolved: bool,
22   pub resolver_id: Option<PersonId>,
23   pub published: chrono::NaiveDateTime,
24   pub updated: Option<chrono::NaiveDateTime>,
25 }
26
27 #[derive(Insertable, AsChangeset, Clone)]
28 #[table_name = "comment_report"]
29 pub struct CommentReportForm {
30   pub creator_id: PersonId,
31   pub comment_id: CommentId,
32   pub original_comment_text: String,
33   pub reason: String,
34 }