1 use crate::newtypes::{CommentId, PersonId, PersonMentionId};
2 use serde::{Deserialize, Serialize};
4 #[cfg(feature = "full")]
5 use crate::schema::person_mention;
7 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
8 #[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
9 #[cfg_attr(feature = "full", diesel(belongs_to(crate::source::comment::Comment)))]
10 #[cfg_attr(feature = "full", diesel(table_name = person_mention))]
11 pub struct PersonMention {
12 pub id: PersonMentionId,
13 pub recipient_id: PersonId,
14 pub comment_id: CommentId,
16 pub published: chrono::NaiveDateTime,
19 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
20 #[cfg_attr(feature = "full", diesel(table_name = person_mention))]
21 pub struct PersonMentionForm {
22 pub recipient_id: PersonId,
23 pub comment_id: CommentId,
24 pub read: Option<bool>,