1 use crate::newtypes::{DbUrl, PersonId, PrivateMessageId};
2 use serde::{Deserialize, Serialize};
4 #[cfg(feature = "full")]
5 use crate::schema::private_message;
7 #[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
8 #[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
9 #[cfg_attr(feature = "full", table_name = "private_message")]
10 pub struct PrivateMessage {
11 pub id: PrivateMessageId,
12 pub creator_id: PersonId,
13 pub recipient_id: PersonId,
17 pub published: chrono::NaiveDateTime,
18 pub updated: Option<chrono::NaiveDateTime>,
24 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
25 #[cfg_attr(feature = "full", table_name = "private_message")]
26 pub struct PrivateMessageForm {
27 pub creator_id: PersonId,
28 pub recipient_id: PersonId,
30 pub deleted: Option<bool>,
31 pub read: Option<bool>,
32 pub published: Option<chrono::NaiveDateTime>,
33 pub updated: Option<chrono::NaiveDateTime>,
34 pub ap_id: Option<DbUrl>,
35 pub local: Option<bool>,