2 newtypes::{CommentId, CommunityId, PersonId, PostId},
7 mod_ban_from_community,
14 mod_transfer_community,
17 use serde::{Deserialize, Serialize};
19 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
20 #[table_name = "mod_remove_post"]
21 pub struct ModRemovePost {
23 pub mod_person_id: PersonId,
25 pub reason: Option<String>,
26 pub removed: Option<bool>,
27 pub when_: chrono::NaiveDateTime,
30 #[derive(Insertable, AsChangeset)]
31 #[table_name = "mod_remove_post"]
32 pub struct ModRemovePostForm {
33 pub mod_person_id: PersonId,
35 pub reason: Option<String>,
36 pub removed: Option<bool>,
39 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
40 #[table_name = "mod_lock_post"]
41 pub struct ModLockPost {
43 pub mod_person_id: PersonId,
45 pub locked: Option<bool>,
46 pub when_: chrono::NaiveDateTime,
49 #[derive(Insertable, AsChangeset)]
50 #[table_name = "mod_lock_post"]
51 pub struct ModLockPostForm {
52 pub mod_person_id: PersonId,
54 pub locked: Option<bool>,
57 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
58 #[table_name = "mod_sticky_post"]
59 pub struct ModStickyPost {
61 pub mod_person_id: PersonId,
63 pub stickied: Option<bool>,
64 pub when_: chrono::NaiveDateTime,
67 #[derive(Insertable, AsChangeset)]
68 #[table_name = "mod_sticky_post"]
69 pub struct ModStickyPostForm {
70 pub mod_person_id: PersonId,
72 pub stickied: Option<bool>,
75 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
76 #[table_name = "mod_remove_comment"]
77 pub struct ModRemoveComment {
79 pub mod_person_id: PersonId,
80 pub comment_id: CommentId,
81 pub reason: Option<String>,
82 pub removed: Option<bool>,
83 pub when_: chrono::NaiveDateTime,
86 #[derive(Insertable, AsChangeset)]
87 #[table_name = "mod_remove_comment"]
88 pub struct ModRemoveCommentForm {
89 pub mod_person_id: PersonId,
90 pub comment_id: CommentId,
91 pub reason: Option<String>,
92 pub removed: Option<bool>,
95 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
96 #[table_name = "mod_remove_community"]
97 pub struct ModRemoveCommunity {
99 pub mod_person_id: PersonId,
100 pub community_id: CommunityId,
101 pub reason: Option<String>,
102 pub removed: Option<bool>,
103 pub expires: Option<chrono::NaiveDateTime>,
104 pub when_: chrono::NaiveDateTime,
107 #[derive(Insertable, AsChangeset)]
108 #[table_name = "mod_remove_community"]
109 pub struct ModRemoveCommunityForm {
110 pub mod_person_id: PersonId,
111 pub community_id: CommunityId,
112 pub reason: Option<String>,
113 pub removed: Option<bool>,
114 pub expires: Option<chrono::NaiveDateTime>,
117 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
118 #[table_name = "mod_ban_from_community"]
119 pub struct ModBanFromCommunity {
121 pub mod_person_id: PersonId,
122 pub other_person_id: PersonId,
123 pub community_id: CommunityId,
124 pub reason: Option<String>,
125 pub banned: Option<bool>,
126 pub expires: Option<chrono::NaiveDateTime>,
127 pub when_: chrono::NaiveDateTime,
130 #[derive(Insertable, AsChangeset)]
131 #[table_name = "mod_ban_from_community"]
132 pub struct ModBanFromCommunityForm {
133 pub mod_person_id: PersonId,
134 pub other_person_id: PersonId,
135 pub community_id: CommunityId,
136 pub reason: Option<String>,
137 pub banned: Option<bool>,
138 pub expires: Option<chrono::NaiveDateTime>,
141 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
142 #[table_name = "mod_ban"]
145 pub mod_person_id: PersonId,
146 pub other_person_id: PersonId,
147 pub reason: Option<String>,
148 pub banned: Option<bool>,
149 pub expires: Option<chrono::NaiveDateTime>,
150 pub when_: chrono::NaiveDateTime,
153 #[derive(Insertable, AsChangeset)]
154 #[table_name = "mod_hide_community"]
155 pub struct ModHideCommunityForm {
156 pub community_id: CommunityId,
157 pub mod_person_id: PersonId,
158 pub hidden: Option<bool>,
159 pub reason: Option<String>,
161 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
162 #[table_name = "mod_hide_community"]
163 pub struct ModHideCommunity {
165 pub community_id: CommunityId,
166 pub mod_person_id: PersonId,
167 pub reason: Option<String>,
168 pub hidden: Option<bool>,
169 pub when_: chrono::NaiveDateTime,
172 #[derive(Insertable, AsChangeset)]
173 #[table_name = "mod_ban"]
174 pub struct ModBanForm {
175 pub mod_person_id: PersonId,
176 pub other_person_id: PersonId,
177 pub reason: Option<String>,
178 pub banned: Option<bool>,
179 pub expires: Option<chrono::NaiveDateTime>,
182 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
183 #[table_name = "mod_add_community"]
184 pub struct ModAddCommunity {
186 pub mod_person_id: PersonId,
187 pub other_person_id: PersonId,
188 pub community_id: CommunityId,
189 pub removed: Option<bool>,
190 pub when_: chrono::NaiveDateTime,
193 #[derive(Insertable, AsChangeset)]
194 #[table_name = "mod_add_community"]
195 pub struct ModAddCommunityForm {
196 pub mod_person_id: PersonId,
197 pub other_person_id: PersonId,
198 pub community_id: CommunityId,
199 pub removed: Option<bool>,
202 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
203 #[table_name = "mod_transfer_community"]
204 pub struct ModTransferCommunity {
206 pub mod_person_id: PersonId,
207 pub other_person_id: PersonId,
208 pub community_id: CommunityId,
209 pub removed: Option<bool>,
210 pub when_: chrono::NaiveDateTime,
213 #[derive(Insertable, AsChangeset)]
214 #[table_name = "mod_transfer_community"]
215 pub struct ModTransferCommunityForm {
216 pub mod_person_id: PersonId,
217 pub other_person_id: PersonId,
218 pub community_id: CommunityId,
219 pub removed: Option<bool>,
222 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
223 #[table_name = "mod_add"]
226 pub mod_person_id: PersonId,
227 pub other_person_id: PersonId,
228 pub removed: Option<bool>,
229 pub when_: chrono::NaiveDateTime,
232 #[derive(Insertable, AsChangeset)]
233 #[table_name = "mod_add"]
234 pub struct ModAddForm {
235 pub mod_person_id: PersonId,
236 pub other_person_id: PersonId,
237 pub removed: Option<bool>,