1 use crate::newtypes::{DbUrl, PersonId, PostId, PostReportId};
2 use serde::{Deserialize, Serialize};
4 #[cfg(feature = "full")]
5 use crate::schema::post_report;
7 #[derive(PartialEq, Serialize, Deserialize, Debug, Clone)]
8 #[cfg_attr(feature = "full", derive(Identifiable, Queryable, Associations))]
9 #[cfg_attr(feature = "full", belongs_to(crate::source::post::Post))]
10 #[cfg_attr(feature = "full", table_name = "post_report")]
11 pub struct PostReport {
13 pub creator_id: PersonId,
15 pub original_post_name: String,
16 pub original_post_url: Option<DbUrl>,
17 pub original_post_body: Option<String>,
20 pub resolver_id: Option<PersonId>,
21 pub published: chrono::NaiveDateTime,
22 pub updated: Option<chrono::NaiveDateTime>,
26 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
27 #[cfg_attr(feature = "full", table_name = "post_report")]
28 pub struct PostReportForm {
29 pub creator_id: PersonId,
31 pub original_post_name: String,
32 pub original_post_url: Option<DbUrl>,
33 pub original_post_body: Option<String>,