1 use crate::newtypes::{CommentId, CommunityId, PersonId, PostId};
2 use serde::{Deserialize, Serialize};
4 #[cfg(feature = "full")]
9 mod_ban_from_community,
16 mod_transfer_community,
19 #[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
20 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
21 #[cfg_attr(feature = "full", table_name = "mod_remove_post")]
22 pub struct ModRemovePost {
24 pub mod_person_id: PersonId,
26 pub reason: Option<String>,
27 pub removed: Option<bool>,
28 pub when_: chrono::NaiveDateTime,
31 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
32 #[cfg_attr(feature = "full", table_name = "mod_remove_post")]
33 pub struct ModRemovePostForm {
34 pub mod_person_id: PersonId,
36 pub reason: Option<String>,
37 pub removed: Option<bool>,
40 #[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
41 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
42 #[cfg_attr(feature = "full", table_name = "mod_lock_post")]
43 pub struct ModLockPost {
45 pub mod_person_id: PersonId,
47 pub locked: Option<bool>,
48 pub when_: chrono::NaiveDateTime,
51 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
52 #[cfg_attr(feature = "full", table_name = "mod_lock_post")]
53 pub struct ModLockPostForm {
54 pub mod_person_id: PersonId,
56 pub locked: Option<bool>,
59 #[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
60 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
61 #[cfg_attr(feature = "full", table_name = "mod_sticky_post")]
62 pub struct ModStickyPost {
64 pub mod_person_id: PersonId,
66 pub stickied: Option<bool>,
67 pub when_: chrono::NaiveDateTime,
70 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
71 #[cfg_attr(feature = "full", table_name = "mod_sticky_post")]
72 pub struct ModStickyPostForm {
73 pub mod_person_id: PersonId,
75 pub stickied: Option<bool>,
78 #[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
79 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
80 #[cfg_attr(feature = "full", table_name = "mod_remove_comment")]
81 pub struct ModRemoveComment {
83 pub mod_person_id: PersonId,
84 pub comment_id: CommentId,
85 pub reason: Option<String>,
86 pub removed: Option<bool>,
87 pub when_: chrono::NaiveDateTime,
90 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
91 #[cfg_attr(feature = "full", table_name = "mod_remove_comment")]
92 pub struct ModRemoveCommentForm {
93 pub mod_person_id: PersonId,
94 pub comment_id: CommentId,
95 pub reason: Option<String>,
96 pub removed: Option<bool>,
99 #[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
100 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
101 #[cfg_attr(feature = "full", table_name = "mod_remove_community")]
102 pub struct ModRemoveCommunity {
104 pub mod_person_id: PersonId,
105 pub community_id: CommunityId,
106 pub reason: Option<String>,
107 pub removed: Option<bool>,
108 pub expires: Option<chrono::NaiveDateTime>,
109 pub when_: chrono::NaiveDateTime,
112 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
113 #[cfg_attr(feature = "full", table_name = "mod_remove_community")]
114 pub struct ModRemoveCommunityForm {
115 pub mod_person_id: PersonId,
116 pub community_id: CommunityId,
117 pub reason: Option<String>,
118 pub removed: Option<bool>,
119 pub expires: Option<chrono::NaiveDateTime>,
122 #[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
123 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
124 #[cfg_attr(feature = "full", table_name = "mod_ban_from_community")]
125 pub struct ModBanFromCommunity {
127 pub mod_person_id: PersonId,
128 pub other_person_id: PersonId,
129 pub community_id: CommunityId,
130 pub reason: Option<String>,
131 pub banned: Option<bool>,
132 pub expires: Option<chrono::NaiveDateTime>,
133 pub when_: chrono::NaiveDateTime,
136 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
137 #[cfg_attr(feature = "full", table_name = "mod_ban_from_community")]
138 pub struct ModBanFromCommunityForm {
139 pub mod_person_id: PersonId,
140 pub other_person_id: PersonId,
141 pub community_id: CommunityId,
142 pub reason: Option<String>,
143 pub banned: Option<bool>,
144 pub expires: Option<chrono::NaiveDateTime>,
147 #[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
148 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
149 #[cfg_attr(feature = "full", table_name = "mod_ban")]
152 pub mod_person_id: PersonId,
153 pub other_person_id: PersonId,
154 pub reason: Option<String>,
155 pub banned: Option<bool>,
156 pub expires: Option<chrono::NaiveDateTime>,
157 pub when_: chrono::NaiveDateTime,
160 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
161 #[cfg_attr(feature = "full", table_name = "mod_hide_community")]
162 pub struct ModHideCommunityForm {
163 pub community_id: CommunityId,
164 pub mod_person_id: PersonId,
165 pub hidden: Option<bool>,
166 pub reason: Option<String>,
168 #[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
169 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
170 #[cfg_attr(feature = "full", table_name = "mod_hide_community")]
171 pub struct ModHideCommunity {
173 pub community_id: CommunityId,
174 pub mod_person_id: PersonId,
175 pub reason: Option<String>,
176 pub hidden: Option<bool>,
177 pub when_: chrono::NaiveDateTime,
180 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
181 #[cfg_attr(feature = "full", table_name = "mod_ban")]
182 pub struct ModBanForm {
183 pub mod_person_id: PersonId,
184 pub other_person_id: PersonId,
185 pub reason: Option<String>,
186 pub banned: Option<bool>,
187 pub expires: Option<chrono::NaiveDateTime>,
190 #[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
191 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
192 #[cfg_attr(feature = "full", table_name = "mod_add_community")]
193 pub struct ModAddCommunity {
195 pub mod_person_id: PersonId,
196 pub other_person_id: PersonId,
197 pub community_id: CommunityId,
198 pub removed: Option<bool>,
199 pub when_: chrono::NaiveDateTime,
202 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
203 #[cfg_attr(feature = "full", table_name = "mod_add_community")]
204 pub struct ModAddCommunityForm {
205 pub mod_person_id: PersonId,
206 pub other_person_id: PersonId,
207 pub community_id: CommunityId,
208 pub removed: Option<bool>,
211 #[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
212 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
213 #[cfg_attr(feature = "full", table_name = "mod_transfer_community")]
214 pub struct ModTransferCommunity {
216 pub mod_person_id: PersonId,
217 pub other_person_id: PersonId,
218 pub community_id: CommunityId,
219 pub removed: Option<bool>,
220 pub when_: chrono::NaiveDateTime,
223 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
224 #[cfg_attr(feature = "full", table_name = "mod_transfer_community")]
225 pub struct ModTransferCommunityForm {
226 pub mod_person_id: PersonId,
227 pub other_person_id: PersonId,
228 pub community_id: CommunityId,
229 pub removed: Option<bool>,
232 #[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
233 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
234 #[cfg_attr(feature = "full", table_name = "mod_add")]
237 pub mod_person_id: PersonId,
238 pub other_person_id: PersonId,
239 pub removed: Option<bool>,
240 pub when_: chrono::NaiveDateTime,
243 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
244 #[cfg_attr(feature = "full", table_name = "mod_add")]
245 pub struct ModAddForm {
246 pub mod_person_id: PersonId,
247 pub other_person_id: PersonId,
248 pub removed: Option<bool>,