1 use crate::newtypes::{CommentId, CommunityId, PersonId, PostId};
2 #[cfg(feature = "full")]
11 mod_ban_from_community,
18 mod_transfer_community,
20 use serde::{Deserialize, Serialize};
22 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
23 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
24 #[cfg_attr(feature = "full", diesel(table_name = mod_remove_post))]
25 pub struct ModRemovePost {
27 pub mod_person_id: PersonId,
29 pub reason: Option<String>,
30 pub removed: Option<bool>,
31 pub when_: chrono::NaiveDateTime,
34 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
35 #[cfg_attr(feature = "full", diesel(table_name = mod_remove_post))]
36 pub struct ModRemovePostForm {
37 pub mod_person_id: PersonId,
39 pub reason: Option<String>,
40 pub removed: Option<bool>,
43 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
44 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
45 #[cfg_attr(feature = "full", diesel(table_name = mod_lock_post))]
46 pub struct ModLockPost {
48 pub mod_person_id: PersonId,
50 pub locked: Option<bool>,
51 pub when_: chrono::NaiveDateTime,
54 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
55 #[cfg_attr(feature = "full", diesel(table_name = mod_lock_post))]
56 pub struct ModLockPostForm {
57 pub mod_person_id: PersonId,
59 pub locked: Option<bool>,
62 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
63 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
64 #[cfg_attr(feature = "full", diesel(table_name = mod_feature_post))]
65 pub struct ModFeaturePost {
67 pub mod_person_id: PersonId,
70 pub when_: chrono::NaiveDateTime,
71 pub is_featured_community: bool,
74 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
75 #[cfg_attr(feature = "full", diesel(table_name = mod_feature_post))]
76 pub struct ModFeaturePostForm {
77 pub mod_person_id: PersonId,
80 pub is_featured_community: bool,
83 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
84 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
85 #[cfg_attr(feature = "full", diesel(table_name = mod_remove_comment))]
86 pub struct ModRemoveComment {
88 pub mod_person_id: PersonId,
89 pub comment_id: CommentId,
90 pub reason: Option<String>,
91 pub removed: Option<bool>,
92 pub when_: chrono::NaiveDateTime,
95 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
96 #[cfg_attr(feature = "full", diesel(table_name = mod_remove_comment))]
97 pub struct ModRemoveCommentForm {
98 pub mod_person_id: PersonId,
99 pub comment_id: CommentId,
100 pub reason: Option<String>,
101 pub removed: Option<bool>,
104 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
105 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
106 #[cfg_attr(feature = "full", diesel(table_name = mod_remove_community))]
107 pub struct ModRemoveCommunity {
109 pub mod_person_id: PersonId,
110 pub community_id: CommunityId,
111 pub reason: Option<String>,
112 pub removed: Option<bool>,
113 pub expires: Option<chrono::NaiveDateTime>,
114 pub when_: chrono::NaiveDateTime,
117 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
118 #[cfg_attr(feature = "full", diesel(table_name = mod_remove_community))]
119 pub struct ModRemoveCommunityForm {
120 pub mod_person_id: PersonId,
121 pub community_id: CommunityId,
122 pub reason: Option<String>,
123 pub removed: Option<bool>,
124 pub expires: Option<chrono::NaiveDateTime>,
127 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
128 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
129 #[cfg_attr(feature = "full", diesel(table_name = mod_ban_from_community))]
130 pub struct ModBanFromCommunity {
132 pub mod_person_id: PersonId,
133 pub other_person_id: PersonId,
134 pub community_id: CommunityId,
135 pub reason: Option<String>,
136 pub banned: Option<bool>,
137 pub expires: Option<chrono::NaiveDateTime>,
138 pub when_: chrono::NaiveDateTime,
141 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
142 #[cfg_attr(feature = "full", diesel(table_name = mod_ban_from_community))]
143 pub struct ModBanFromCommunityForm {
144 pub mod_person_id: PersonId,
145 pub other_person_id: PersonId,
146 pub community_id: CommunityId,
147 pub reason: Option<String>,
148 pub banned: Option<bool>,
149 pub expires: Option<chrono::NaiveDateTime>,
152 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
153 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
154 #[cfg_attr(feature = "full", diesel(table_name = mod_ban))]
157 pub mod_person_id: PersonId,
158 pub other_person_id: PersonId,
159 pub reason: Option<String>,
160 pub banned: Option<bool>,
161 pub expires: Option<chrono::NaiveDateTime>,
162 pub when_: chrono::NaiveDateTime,
165 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
166 #[cfg_attr(feature = "full", diesel(table_name = mod_hide_community))]
167 pub struct ModHideCommunityForm {
168 pub community_id: CommunityId,
169 pub mod_person_id: PersonId,
170 pub hidden: Option<bool>,
171 pub reason: Option<String>,
173 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
174 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
175 #[cfg_attr(feature = "full", diesel(table_name = mod_hide_community))]
176 pub struct ModHideCommunity {
178 pub community_id: CommunityId,
179 pub mod_person_id: PersonId,
180 pub reason: Option<String>,
181 pub hidden: Option<bool>,
182 pub when_: chrono::NaiveDateTime,
185 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
186 #[cfg_attr(feature = "full", diesel(table_name = mod_ban))]
187 pub struct ModBanForm {
188 pub mod_person_id: PersonId,
189 pub other_person_id: PersonId,
190 pub reason: Option<String>,
191 pub banned: Option<bool>,
192 pub expires: Option<chrono::NaiveDateTime>,
195 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
196 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
197 #[cfg_attr(feature = "full", diesel(table_name = mod_add_community))]
198 pub struct ModAddCommunity {
200 pub mod_person_id: PersonId,
201 pub other_person_id: PersonId,
202 pub community_id: CommunityId,
203 pub removed: Option<bool>,
204 pub when_: chrono::NaiveDateTime,
207 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
208 #[cfg_attr(feature = "full", diesel(table_name = mod_add_community))]
209 pub struct ModAddCommunityForm {
210 pub mod_person_id: PersonId,
211 pub other_person_id: PersonId,
212 pub community_id: CommunityId,
213 pub removed: Option<bool>,
216 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
217 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
218 #[cfg_attr(feature = "full", diesel(table_name = mod_transfer_community))]
219 pub struct ModTransferCommunity {
221 pub mod_person_id: PersonId,
222 pub other_person_id: PersonId,
223 pub community_id: CommunityId,
224 pub removed: Option<bool>,
225 pub when_: chrono::NaiveDateTime,
228 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
229 #[cfg_attr(feature = "full", diesel(table_name = mod_transfer_community))]
230 pub struct ModTransferCommunityForm {
231 pub mod_person_id: PersonId,
232 pub other_person_id: PersonId,
233 pub community_id: CommunityId,
234 pub removed: Option<bool>,
237 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
238 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
239 #[cfg_attr(feature = "full", diesel(table_name = mod_add))]
242 pub mod_person_id: PersonId,
243 pub other_person_id: PersonId,
244 pub removed: Option<bool>,
245 pub when_: chrono::NaiveDateTime,
248 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
249 #[cfg_attr(feature = "full", diesel(table_name = mod_add))]
250 pub struct ModAddForm {
251 pub mod_person_id: PersonId,
252 pub other_person_id: PersonId,
253 pub removed: Option<bool>,
256 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
257 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
258 #[cfg_attr(feature = "full", diesel(table_name = admin_purge_person))]
259 pub struct AdminPurgePerson {
261 pub admin_person_id: PersonId,
262 pub reason: Option<String>,
263 pub when_: chrono::NaiveDateTime,
266 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
267 #[cfg_attr(feature = "full", diesel(table_name = admin_purge_person))]
268 pub struct AdminPurgePersonForm {
269 pub admin_person_id: PersonId,
270 pub reason: Option<String>,
273 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
274 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
275 #[cfg_attr(feature = "full", diesel(table_name = admin_purge_community))]
276 pub struct AdminPurgeCommunity {
278 pub admin_person_id: PersonId,
279 pub reason: Option<String>,
280 pub when_: chrono::NaiveDateTime,
283 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
284 #[cfg_attr(feature = "full", diesel(table_name = admin_purge_community))]
285 pub struct AdminPurgeCommunityForm {
286 pub admin_person_id: PersonId,
287 pub reason: Option<String>,
290 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
291 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
292 #[cfg_attr(feature = "full", diesel(table_name = admin_purge_post))]
293 pub struct AdminPurgePost {
295 pub admin_person_id: PersonId,
296 pub community_id: CommunityId,
297 pub reason: Option<String>,
298 pub when_: chrono::NaiveDateTime,
301 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
302 #[cfg_attr(feature = "full", diesel(table_name = admin_purge_post))]
303 pub struct AdminPurgePostForm {
304 pub admin_person_id: PersonId,
305 pub community_id: CommunityId,
306 pub reason: Option<String>,
309 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
310 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
311 #[cfg_attr(feature = "full", diesel(table_name = admin_purge_comment))]
312 pub struct AdminPurgeComment {
314 pub admin_person_id: PersonId,
316 pub reason: Option<String>,
317 pub when_: chrono::NaiveDateTime,
320 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
321 #[cfg_attr(feature = "full", diesel(table_name = admin_purge_comment))]
322 pub struct AdminPurgeCommentForm {
323 pub admin_person_id: PersonId,
325 pub reason: Option<String>,