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>,
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,
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>,
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>,
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>,
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>,
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 when_: chrono::NaiveDateTime,
181 pub reason: Option<String>,
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,
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 when_: chrono::NaiveDateTime,
227 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
228 #[cfg_attr(feature = "full", diesel(table_name = mod_transfer_community))]
229 pub struct ModTransferCommunityForm {
230 pub mod_person_id: PersonId,
231 pub other_person_id: PersonId,
232 pub community_id: CommunityId,
235 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
236 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
237 #[cfg_attr(feature = "full", diesel(table_name = mod_add))]
240 pub mod_person_id: PersonId,
241 pub other_person_id: PersonId,
243 pub when_: chrono::NaiveDateTime,
246 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
247 #[cfg_attr(feature = "full", diesel(table_name = mod_add))]
248 pub struct ModAddForm {
249 pub mod_person_id: PersonId,
250 pub other_person_id: PersonId,
251 pub removed: Option<bool>,
254 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
255 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
256 #[cfg_attr(feature = "full", diesel(table_name = admin_purge_person))]
257 pub struct AdminPurgePerson {
259 pub admin_person_id: PersonId,
260 pub reason: Option<String>,
261 pub when_: chrono::NaiveDateTime,
264 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
265 #[cfg_attr(feature = "full", diesel(table_name = admin_purge_person))]
266 pub struct AdminPurgePersonForm {
267 pub admin_person_id: PersonId,
268 pub reason: Option<String>,
271 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
272 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
273 #[cfg_attr(feature = "full", diesel(table_name = admin_purge_community))]
274 pub struct AdminPurgeCommunity {
276 pub admin_person_id: PersonId,
277 pub reason: Option<String>,
278 pub when_: chrono::NaiveDateTime,
281 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
282 #[cfg_attr(feature = "full", diesel(table_name = admin_purge_community))]
283 pub struct AdminPurgeCommunityForm {
284 pub admin_person_id: PersonId,
285 pub reason: Option<String>,
288 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
289 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
290 #[cfg_attr(feature = "full", diesel(table_name = admin_purge_post))]
291 pub struct AdminPurgePost {
293 pub admin_person_id: PersonId,
294 pub community_id: CommunityId,
295 pub reason: Option<String>,
296 pub when_: chrono::NaiveDateTime,
299 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
300 #[cfg_attr(feature = "full", diesel(table_name = admin_purge_post))]
301 pub struct AdminPurgePostForm {
302 pub admin_person_id: PersonId,
303 pub community_id: CommunityId,
304 pub reason: Option<String>,
307 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
308 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
309 #[cfg_attr(feature = "full", diesel(table_name = admin_purge_comment))]
310 pub struct AdminPurgeComment {
312 pub admin_person_id: PersonId,
314 pub reason: Option<String>,
315 pub when_: chrono::NaiveDateTime,
318 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
319 #[cfg_attr(feature = "full", diesel(table_name = admin_purge_comment))]
320 pub struct AdminPurgeCommentForm {
321 pub admin_person_id: PersonId,
323 pub reason: Option<String>,