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