1 use crate::newtypes::{CommentId, CommunityId, PersonId, PostId};
2 use serde::{Deserialize, Serialize};
4 #[cfg(feature = "full")]
13 mod_ban_from_community,
20 mod_transfer_community,
23 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
24 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
25 #[cfg_attr(feature = "full", diesel(table_name = mod_remove_post))]
26 pub struct ModRemovePost {
28 pub mod_person_id: PersonId,
30 pub reason: Option<String>,
31 pub removed: Option<bool>,
32 pub when_: chrono::NaiveDateTime,
35 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
36 #[cfg_attr(feature = "full", diesel(table_name = mod_remove_post))]
37 pub struct ModRemovePostForm {
38 pub mod_person_id: PersonId,
40 pub reason: Option<String>,
41 pub removed: Option<bool>,
44 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
45 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
46 #[cfg_attr(feature = "full", diesel(table_name = mod_lock_post))]
47 pub struct ModLockPost {
49 pub mod_person_id: PersonId,
51 pub locked: Option<bool>,
52 pub when_: chrono::NaiveDateTime,
55 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
56 #[cfg_attr(feature = "full", diesel(table_name = mod_lock_post))]
57 pub struct ModLockPostForm {
58 pub mod_person_id: PersonId,
60 pub locked: Option<bool>,
63 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
64 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
65 #[cfg_attr(feature = "full", diesel(table_name = mod_sticky_post))]
66 pub struct ModStickyPost {
68 pub mod_person_id: PersonId,
70 pub stickied: Option<bool>,
71 pub when_: chrono::NaiveDateTime,
74 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
75 #[cfg_attr(feature = "full", diesel(table_name = mod_sticky_post))]
76 pub struct ModStickyPostForm {
77 pub mod_person_id: PersonId,
79 pub stickied: Option<bool>,
82 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
83 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
84 #[cfg_attr(feature = "full", diesel(table_name = mod_remove_comment))]
85 pub struct ModRemoveComment {
87 pub mod_person_id: PersonId,
88 pub comment_id: CommentId,
89 pub reason: Option<String>,
90 pub removed: Option<bool>,
91 pub when_: chrono::NaiveDateTime,
94 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
95 #[cfg_attr(feature = "full", diesel(table_name = mod_remove_comment))]
96 pub struct ModRemoveCommentForm {
97 pub mod_person_id: PersonId,
98 pub comment_id: CommentId,
99 pub reason: Option<String>,
100 pub removed: Option<bool>,
103 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
104 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
105 #[cfg_attr(feature = "full", diesel(table_name = mod_remove_community))]
106 pub struct ModRemoveCommunity {
108 pub mod_person_id: PersonId,
109 pub community_id: CommunityId,
110 pub reason: Option<String>,
111 pub removed: Option<bool>,
112 pub expires: Option<chrono::NaiveDateTime>,
113 pub when_: chrono::NaiveDateTime,
116 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
117 #[cfg_attr(feature = "full", diesel(table_name = mod_remove_community))]
118 pub struct ModRemoveCommunityForm {
119 pub mod_person_id: PersonId,
120 pub community_id: CommunityId,
121 pub reason: Option<String>,
122 pub removed: Option<bool>,
123 pub expires: Option<chrono::NaiveDateTime>,
126 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
127 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
128 #[cfg_attr(feature = "full", diesel(table_name = mod_ban_from_community))]
129 pub struct ModBanFromCommunity {
131 pub mod_person_id: PersonId,
132 pub other_person_id: PersonId,
133 pub community_id: CommunityId,
134 pub reason: Option<String>,
135 pub banned: Option<bool>,
136 pub expires: Option<chrono::NaiveDateTime>,
137 pub when_: chrono::NaiveDateTime,
140 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
141 #[cfg_attr(feature = "full", diesel(table_name = mod_ban_from_community))]
142 pub struct ModBanFromCommunityForm {
143 pub mod_person_id: PersonId,
144 pub other_person_id: PersonId,
145 pub community_id: CommunityId,
146 pub reason: Option<String>,
147 pub banned: Option<bool>,
148 pub expires: Option<chrono::NaiveDateTime>,
151 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
152 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
153 #[cfg_attr(feature = "full", diesel(table_name = mod_ban))]
156 pub mod_person_id: PersonId,
157 pub other_person_id: PersonId,
158 pub reason: Option<String>,
159 pub banned: Option<bool>,
160 pub expires: Option<chrono::NaiveDateTime>,
161 pub when_: chrono::NaiveDateTime,
164 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
165 #[cfg_attr(feature = "full", diesel(table_name = mod_hide_community))]
166 pub struct ModHideCommunityForm {
167 pub community_id: CommunityId,
168 pub mod_person_id: PersonId,
169 pub hidden: Option<bool>,
170 pub reason: Option<String>,
172 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
173 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
174 #[cfg_attr(feature = "full", diesel(table_name = mod_hide_community))]
175 pub struct ModHideCommunity {
177 pub community_id: CommunityId,
178 pub mod_person_id: PersonId,
179 pub reason: Option<String>,
180 pub hidden: Option<bool>,
181 pub when_: chrono::NaiveDateTime,
184 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
185 #[cfg_attr(feature = "full", diesel(table_name = mod_ban))]
186 pub struct ModBanForm {
187 pub mod_person_id: PersonId,
188 pub other_person_id: PersonId,
189 pub reason: Option<String>,
190 pub banned: Option<bool>,
191 pub expires: Option<chrono::NaiveDateTime>,
194 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
195 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
196 #[cfg_attr(feature = "full", diesel(table_name = mod_add_community))]
197 pub struct ModAddCommunity {
199 pub mod_person_id: PersonId,
200 pub other_person_id: PersonId,
201 pub community_id: CommunityId,
202 pub removed: Option<bool>,
203 pub when_: chrono::NaiveDateTime,
206 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
207 #[cfg_attr(feature = "full", diesel(table_name = mod_add_community))]
208 pub struct ModAddCommunityForm {
209 pub mod_person_id: PersonId,
210 pub other_person_id: PersonId,
211 pub community_id: CommunityId,
212 pub removed: Option<bool>,
215 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
216 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
217 #[cfg_attr(feature = "full", diesel(table_name = mod_transfer_community))]
218 pub struct ModTransferCommunity {
220 pub mod_person_id: PersonId,
221 pub other_person_id: PersonId,
222 pub community_id: CommunityId,
223 pub removed: Option<bool>,
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,
233 pub removed: Option<bool>,
236 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
237 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
238 #[cfg_attr(feature = "full", diesel(table_name = mod_add))]
241 pub mod_person_id: PersonId,
242 pub other_person_id: PersonId,
243 pub removed: Option<bool>,
244 pub when_: chrono::NaiveDateTime,
247 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
248 #[cfg_attr(feature = "full", diesel(table_name = mod_add))]
249 pub struct ModAddForm {
250 pub mod_person_id: PersonId,
251 pub other_person_id: PersonId,
252 pub removed: Option<bool>,
255 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
256 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
257 #[cfg_attr(feature = "full", diesel(table_name = admin_purge_person))]
258 pub struct AdminPurgePerson {
260 pub admin_person_id: PersonId,
261 pub reason: Option<String>,
262 pub when_: chrono::NaiveDateTime,
265 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
266 #[cfg_attr(feature = "full", diesel(table_name = admin_purge_person))]
267 pub struct AdminPurgePersonForm {
268 pub admin_person_id: PersonId,
269 pub reason: Option<String>,
272 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
273 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
274 #[cfg_attr(feature = "full", diesel(table_name = admin_purge_community))]
275 pub struct AdminPurgeCommunity {
277 pub admin_person_id: PersonId,
278 pub reason: Option<String>,
279 pub when_: chrono::NaiveDateTime,
282 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
283 #[cfg_attr(feature = "full", diesel(table_name = admin_purge_community))]
284 pub struct AdminPurgeCommunityForm {
285 pub admin_person_id: PersonId,
286 pub reason: Option<String>,
289 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
290 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
291 #[cfg_attr(feature = "full", diesel(table_name = admin_purge_post))]
292 pub struct AdminPurgePost {
294 pub admin_person_id: PersonId,
295 pub community_id: CommunityId,
296 pub reason: Option<String>,
297 pub when_: chrono::NaiveDateTime,
300 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
301 #[cfg_attr(feature = "full", diesel(table_name = admin_purge_post))]
302 pub struct AdminPurgePostForm {
303 pub admin_person_id: PersonId,
304 pub community_id: CommunityId,
305 pub reason: Option<String>,
308 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
309 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
310 #[cfg_attr(feature = "full", diesel(table_name = admin_purge_comment))]
311 pub struct AdminPurgeComment {
313 pub admin_person_id: PersonId,
315 pub reason: Option<String>,
316 pub when_: chrono::NaiveDateTime,
319 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
320 #[cfg_attr(feature = "full", diesel(table_name = admin_purge_comment))]
321 pub struct AdminPurgeCommentForm {
322 pub admin_person_id: PersonId,
324 pub reason: Option<String>,