]> Untitled Git - lemmy.git/blob - crates/db_schema/src/source/private_message_report.rs
Allow filtering out of deleted and removed comments when getting person details ...
[lemmy.git] / crates / db_schema / src / source / private_message_report.rs
1 use crate::newtypes::{PersonId, PrivateMessageId, PrivateMessageReportId};
2 use serde::{Deserialize, Serialize};
3
4 #[cfg(feature = "full")]
5 use crate::schema::private_message_report;
6
7 #[derive(PartialEq, Serialize, Deserialize, Debug, Clone)]
8 #[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
9 #[cfg_attr(
10   feature = "full",
11   belongs_to(crate::source::private_message::PrivateMessage)
12 )]
13 #[cfg_attr(feature = "full", table_name = "private_message_report")]
14 pub struct PrivateMessageReport {
15   pub id: PrivateMessageReportId,
16   pub creator_id: PersonId,
17   pub private_message_id: PrivateMessageId,
18   pub original_pm_text: String,
19   pub reason: String,
20   pub resolved: bool,
21   pub resolver_id: Option<PersonId>,
22   pub published: chrono::NaiveDateTime,
23   pub updated: Option<chrono::NaiveDateTime>,
24 }
25
26 #[derive(Clone)]
27 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
28 #[cfg_attr(feature = "full", table_name = "private_message_report")]
29 pub struct PrivateMessageReportForm {
30   pub creator_id: PersonId,
31   pub private_message_id: PrivateMessageId,
32   pub original_pm_text: String,
33   pub reason: String,
34 }