1 use crate::newtypes::{CommentId, CommentReplyId, PersonId};
2 #[cfg(feature = "full")]
3 use crate::schema::comment_reply;
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 = comment_reply))]
12 #[cfg_attr(feature = "full", ts(export))]
14 pub struct CommentReply {
15 pub id: CommentReplyId,
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 = comment_reply))]
24 pub struct CommentReplyInsertForm {
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 = comment_reply))]
32 pub struct CommentReplyUpdateForm {
33 pub read: Option<bool>,