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_sticky_post))]
65 pub struct ModStickyPost {
67 pub mod_person_id: PersonId,
69 pub stickied: Option<bool>,
70 pub when_: chrono::NaiveDateTime,
73 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
74 #[cfg_attr(feature = "full", diesel(table_name = mod_sticky_post))]
75 pub struct ModStickyPostForm {
76 pub mod_person_id: PersonId,
78 pub stickied: Option<bool>,
81 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
82 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
83 #[cfg_attr(feature = "full", diesel(table_name = mod_remove_comment))]
84 pub struct ModRemoveComment {
86 pub mod_person_id: PersonId,
87 pub comment_id: CommentId,
88 pub reason: Option<String>,
89 pub removed: Option<bool>,
90 pub when_: chrono::NaiveDateTime,
93 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
94 #[cfg_attr(feature = "full", diesel(table_name = mod_remove_comment))]
95 pub struct ModRemoveCommentForm {
96 pub mod_person_id: PersonId,
97 pub comment_id: CommentId,
98 pub reason: Option<String>,
99 pub removed: Option<bool>,
102 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
103 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
104 #[cfg_attr(feature = "full", diesel(table_name = mod_remove_community))]
105 pub struct ModRemoveCommunity {
107 pub mod_person_id: PersonId,
108 pub community_id: CommunityId,
109 pub reason: Option<String>,
110 pub removed: Option<bool>,
111 pub expires: Option<chrono::NaiveDateTime>,
112 pub when_: chrono::NaiveDateTime,
115 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
116 #[cfg_attr(feature = "full", diesel(table_name = mod_remove_community))]
117 pub struct ModRemoveCommunityForm {
118 pub mod_person_id: PersonId,
119 pub community_id: CommunityId,
120 pub reason: Option<String>,
121 pub removed: Option<bool>,
122 pub expires: Option<chrono::NaiveDateTime>,
125 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
126 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
127 #[cfg_attr(feature = "full", diesel(table_name = mod_ban_from_community))]
128 pub struct ModBanFromCommunity {
130 pub mod_person_id: PersonId,
131 pub other_person_id: PersonId,
132 pub community_id: CommunityId,
133 pub reason: Option<String>,
134 pub banned: Option<bool>,
135 pub expires: Option<chrono::NaiveDateTime>,
136 pub when_: chrono::NaiveDateTime,
139 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
140 #[cfg_attr(feature = "full", diesel(table_name = mod_ban_from_community))]
141 pub struct ModBanFromCommunityForm {
142 pub mod_person_id: PersonId,
143 pub other_person_id: PersonId,
144 pub community_id: CommunityId,
145 pub reason: Option<String>,
146 pub banned: Option<bool>,
147 pub expires: Option<chrono::NaiveDateTime>,
150 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
151 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
152 #[cfg_attr(feature = "full", diesel(table_name = mod_ban))]
155 pub mod_person_id: PersonId,
156 pub other_person_id: PersonId,
157 pub reason: Option<String>,
158 pub banned: Option<bool>,
159 pub expires: Option<chrono::NaiveDateTime>,
160 pub when_: chrono::NaiveDateTime,
163 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
164 #[cfg_attr(feature = "full", diesel(table_name = mod_hide_community))]
165 pub struct ModHideCommunityForm {
166 pub community_id: CommunityId,
167 pub mod_person_id: PersonId,
168 pub hidden: Option<bool>,
169 pub reason: Option<String>,
171 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
172 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
173 #[cfg_attr(feature = "full", diesel(table_name = mod_hide_community))]
174 pub struct ModHideCommunity {
176 pub community_id: CommunityId,
177 pub mod_person_id: PersonId,
178 pub reason: Option<String>,
179 pub hidden: Option<bool>,
180 pub when_: chrono::NaiveDateTime,
183 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
184 #[cfg_attr(feature = "full", diesel(table_name = mod_ban))]
185 pub struct ModBanForm {
186 pub mod_person_id: PersonId,
187 pub other_person_id: PersonId,
188 pub reason: Option<String>,
189 pub banned: Option<bool>,
190 pub expires: Option<chrono::NaiveDateTime>,
193 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
194 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
195 #[cfg_attr(feature = "full", diesel(table_name = mod_add_community))]
196 pub struct ModAddCommunity {
198 pub mod_person_id: PersonId,
199 pub other_person_id: PersonId,
200 pub community_id: CommunityId,
201 pub removed: Option<bool>,
202 pub when_: chrono::NaiveDateTime,
205 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
206 #[cfg_attr(feature = "full", diesel(table_name = mod_add_community))]
207 pub struct ModAddCommunityForm {
208 pub mod_person_id: PersonId,
209 pub other_person_id: PersonId,
210 pub community_id: CommunityId,
211 pub removed: Option<bool>,
214 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
215 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
216 #[cfg_attr(feature = "full", diesel(table_name = mod_transfer_community))]
217 pub struct ModTransferCommunity {
219 pub mod_person_id: PersonId,
220 pub other_person_id: PersonId,
221 pub community_id: CommunityId,
222 pub removed: Option<bool>,
223 pub when_: chrono::NaiveDateTime,
226 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
227 #[cfg_attr(feature = "full", diesel(table_name = mod_transfer_community))]
228 pub struct ModTransferCommunityForm {
229 pub mod_person_id: PersonId,
230 pub other_person_id: PersonId,
231 pub community_id: CommunityId,
232 pub removed: Option<bool>,
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,
242 pub removed: Option<bool>,
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>,