1 use crate::newtypes::{CommentId, PersonId, PersonMentionId};
2 #[cfg(feature = "full")]
3 use crate::schema::person_mention;
4 use serde::{Deserialize, Serialize};
5 #[cfg(feature = "full")]
8 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
9 #[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS))]
10 #[cfg_attr(feature = "full", diesel(belongs_to(crate::source::comment::Comment)))]
11 #[cfg_attr(feature = "full", diesel(table_name = person_mention))]
12 #[cfg_attr(feature = "full", ts(export))]
14 pub struct PersonMention {
15 pub id: PersonMentionId,
16 pub recipient_id: PersonId,
17 pub comment_id: CommentId,
19 pub published: chrono::NaiveDateTime,
22 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
23 #[cfg_attr(feature = "full", diesel(table_name = person_mention))]
24 pub struct PersonMentionInsertForm {
25 pub recipient_id: PersonId,
26 pub comment_id: CommentId,
27 pub read: Option<bool>,
30 #[cfg_attr(feature = "full", derive(AsChangeset))]
31 #[cfg_attr(feature = "full", diesel(table_name = person_mention))]
32 pub struct PersonMentionUpdateForm {
33 pub read: Option<bool>,