1 use crate::newtypes::{DbUrl, PersonId, PostId, PostReportId};
2 #[cfg(feature = "full")]
3 use crate::schema::post_report;
4 use serde::{Deserialize, Serialize};
6 #[derive(PartialEq, Eq, Serialize, Deserialize, Debug, Clone)]
7 #[cfg_attr(feature = "full", derive(Identifiable, Queryable, Associations))]
8 #[cfg_attr(feature = "full", diesel(belongs_to(crate::source::post::Post)))] // Is this the right assoc?
9 #[cfg_attr(feature = "full", diesel(table_name = post_report))]
10 pub struct PostReport {
12 pub creator_id: PersonId,
14 pub original_post_name: String,
15 pub original_post_url: Option<DbUrl>,
16 pub original_post_body: Option<String>,
19 pub resolver_id: Option<PersonId>,
20 pub published: chrono::NaiveDateTime,
21 pub updated: Option<chrono::NaiveDateTime>,
25 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
26 #[cfg_attr(feature = "full", diesel(table_name = post_report))]
27 pub struct PostReportForm {
28 pub creator_id: PersonId,
30 pub original_post_name: String,
31 pub original_post_url: Option<DbUrl>,
32 pub original_post_body: Option<String>,