1 use crate::newtypes::{PersonId, PrivateMessageId, PrivateMessageReportId};
2 use serde::{Deserialize, Serialize};
4 #[cfg(feature = "full")]
5 use crate::schema::private_message_report;
7 #[derive(PartialEq, Serialize, Deserialize, Debug, Clone)]
8 #[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
11 belongs_to(crate::source::private_message::PrivateMessage)
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,
21 pub resolver_id: Option<PersonId>,
22 pub published: chrono::NaiveDateTime,
23 pub updated: Option<chrono::NaiveDateTime>,
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,