2022-05-03 17:44:13 +00:00
|
|
|
use crate::newtypes::{CommentId, CommentReportId, PersonId};
|
2020-12-21 13:38:34 +00:00
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[cfg(feature = "full")]
|
|
|
|
use crate::schema::comment_report;
|
|
|
|
|
2022-09-26 14:09:32 +00:00
|
|
|
#[derive(PartialEq, Eq, Serialize, Deserialize, Debug, Clone)]
|
2022-05-03 17:44:13 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(belongs_to(crate::source::comment::Comment)))]
|
|
|
|
#[cfg_attr(feature = "full", diesel(table_name = comment_report))]
|
2020-12-21 13:38:34 +00:00
|
|
|
pub struct CommentReport {
|
2021-09-28 10:36:17 +00:00
|
|
|
pub id: CommentReportId,
|
2021-03-18 20:25:21 +00:00
|
|
|
pub creator_id: PersonId,
|
|
|
|
pub comment_id: CommentId,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub original_comment_text: String,
|
|
|
|
pub reason: String,
|
|
|
|
pub resolved: bool,
|
2021-03-18 20:25:21 +00:00
|
|
|
pub resolver_id: Option<PersonId>,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub published: chrono::NaiveDateTime,
|
|
|
|
pub updated: Option<chrono::NaiveDateTime>,
|
|
|
|
}
|
|
|
|
|
2022-05-03 17:44:13 +00:00
|
|
|
#[derive(Clone)]
|
|
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(table_name = comment_report))]
|
2020-12-21 13:38:34 +00:00
|
|
|
pub struct CommentReportForm {
|
2021-03-18 20:25:21 +00:00
|
|
|
pub creator_id: PersonId,
|
|
|
|
pub comment_id: CommentId,
|
2020-12-21 13:38:34 +00:00
|
|
|
pub original_comment_text: String,
|
|
|
|
pub reason: String,
|
|
|
|
}
|