1 use crate::newtypes::{CommentId, CommentReplyId, PersonId};
2 use serde::{Deserialize, Serialize};
4 #[cfg(feature = "full")]
5 use crate::schema::comment_reply;
7 #[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
8 #[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
9 #[cfg_attr(feature = "full", belongs_to(crate::source::comment::Comment))]
10 #[cfg_attr(feature = "full", table_name = "comment_reply")]
11 /// This table keeps a list of replies to comments and posts.
12 pub struct CommentReply {
13 pub id: CommentReplyId,
14 pub recipient_id: PersonId,
15 pub comment_id: CommentId,
17 pub published: chrono::NaiveDateTime,
20 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
21 #[cfg_attr(feature = "full", table_name = "comment_reply")]
22 pub struct CommentReplyForm {
23 pub recipient_id: PersonId,
24 pub comment_id: CommentId,
25 pub read: Option<bool>,