1 use crate::newtypes::{PersonId, PrivateMessageId, PrivateMessageReportId};
2 #[cfg(feature = "full")]
3 use crate::schema::private_message_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))]
14 diesel(belongs_to(crate::source::private_message::PrivateMessage))
16 #[cfg_attr(feature = "full", diesel(table_name = private_message_report))]
17 #[cfg_attr(feature = "full", ts(export))]
18 /// The private message report.
19 pub struct PrivateMessageReport {
20 pub id: PrivateMessageReportId,
21 pub creator_id: PersonId,
22 pub private_message_id: PrivateMessageId,
23 /// The original text.
24 pub original_pm_text: String,
27 pub resolver_id: Option<PersonId>,
28 pub published: chrono::NaiveDateTime,
29 pub updated: Option<chrono::NaiveDateTime>,
33 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
34 #[cfg_attr(feature = "full", diesel(table_name = private_message_report))]
35 pub struct PrivateMessageReportForm {
36 pub creator_id: PersonId,
37 pub private_message_id: PrivateMessageId,
38 pub original_pm_text: String,