2 newtypes::{CommentId, CommunityId, PersonId, PostId},
7 mod_ban_from_community,
13 mod_transfer_community,
16 use serde::{Deserialize, Serialize};
18 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
19 #[table_name = "mod_remove_post"]
20 pub struct ModRemovePost {
22 pub mod_person_id: PersonId,
24 pub reason: Option<String>,
25 pub removed: Option<bool>,
26 pub when_: chrono::NaiveDateTime,
29 #[derive(Insertable, AsChangeset)]
30 #[table_name = "mod_remove_post"]
31 pub struct ModRemovePostForm {
32 pub mod_person_id: PersonId,
34 pub reason: Option<String>,
35 pub removed: Option<bool>,
38 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
39 #[table_name = "mod_lock_post"]
40 pub struct ModLockPost {
42 pub mod_person_id: PersonId,
44 pub locked: Option<bool>,
45 pub when_: chrono::NaiveDateTime,
48 #[derive(Insertable, AsChangeset)]
49 #[table_name = "mod_lock_post"]
50 pub struct ModLockPostForm {
51 pub mod_person_id: PersonId,
53 pub locked: Option<bool>,
56 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
57 #[table_name = "mod_sticky_post"]
58 pub struct ModStickyPost {
60 pub mod_person_id: PersonId,
62 pub stickied: Option<bool>,
63 pub when_: chrono::NaiveDateTime,
66 #[derive(Insertable, AsChangeset)]
67 #[table_name = "mod_sticky_post"]
68 pub struct ModStickyPostForm {
69 pub mod_person_id: PersonId,
71 pub stickied: Option<bool>,
74 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
75 #[table_name = "mod_remove_comment"]
76 pub struct ModRemoveComment {
78 pub mod_person_id: PersonId,
79 pub comment_id: CommentId,
80 pub reason: Option<String>,
81 pub removed: Option<bool>,
82 pub when_: chrono::NaiveDateTime,
85 #[derive(Insertable, AsChangeset)]
86 #[table_name = "mod_remove_comment"]
87 pub struct ModRemoveCommentForm {
88 pub mod_person_id: PersonId,
89 pub comment_id: CommentId,
90 pub reason: Option<String>,
91 pub removed: Option<bool>,
94 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
95 #[table_name = "mod_remove_community"]
96 pub struct ModRemoveCommunity {
98 pub mod_person_id: PersonId,
99 pub community_id: CommunityId,
100 pub reason: Option<String>,
101 pub removed: Option<bool>,
102 pub expires: Option<chrono::NaiveDateTime>,
103 pub when_: chrono::NaiveDateTime,
106 #[derive(Insertable, AsChangeset)]
107 #[table_name = "mod_remove_community"]
108 pub struct ModRemoveCommunityForm {
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>,
116 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
117 #[table_name = "mod_ban_from_community"]
118 pub struct ModBanFromCommunity {
120 pub mod_person_id: PersonId,
121 pub other_person_id: PersonId,
122 pub community_id: CommunityId,
123 pub reason: Option<String>,
124 pub banned: Option<bool>,
125 pub expires: Option<chrono::NaiveDateTime>,
126 pub when_: chrono::NaiveDateTime,
129 #[derive(Insertable, AsChangeset)]
130 #[table_name = "mod_ban_from_community"]
131 pub struct ModBanFromCommunityForm {
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>,
140 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
141 #[table_name = "mod_ban"]
144 pub mod_person_id: PersonId,
145 pub other_person_id: PersonId,
146 pub reason: Option<String>,
147 pub banned: Option<bool>,
148 pub expires: Option<chrono::NaiveDateTime>,
149 pub when_: chrono::NaiveDateTime,
152 #[derive(Insertable, AsChangeset)]
153 #[table_name = "mod_ban"]
154 pub struct ModBanForm {
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>,
162 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
163 #[table_name = "mod_add_community"]
164 pub struct ModAddCommunity {
166 pub mod_person_id: PersonId,
167 pub other_person_id: PersonId,
168 pub community_id: CommunityId,
169 pub removed: Option<bool>,
170 pub when_: chrono::NaiveDateTime,
173 #[derive(Insertable, AsChangeset)]
174 #[table_name = "mod_add_community"]
175 pub struct ModAddCommunityForm {
176 pub mod_person_id: PersonId,
177 pub other_person_id: PersonId,
178 pub community_id: CommunityId,
179 pub removed: Option<bool>,
182 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
183 #[table_name = "mod_transfer_community"]
184 pub struct ModTransferCommunity {
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_transfer_community"]
195 pub struct ModTransferCommunityForm {
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_add"]
206 pub mod_person_id: PersonId,
207 pub other_person_id: PersonId,
208 pub removed: Option<bool>,
209 pub when_: chrono::NaiveDateTime,
212 #[derive(Insertable, AsChangeset)]
213 #[table_name = "mod_add"]
214 pub struct ModAddForm {
215 pub mod_person_id: PersonId,
216 pub other_person_id: PersonId,
217 pub removed: Option<bool>,