@@ -151,3 +151,43 @@ pub struct PersonView {
151151 pub counts : PersonAggregates ,
152152 pub is_admin : bool ,
153153}
154+
155+ #[ derive( Debug , Serialize ) ]
156+ #[ cfg_attr( feature = "full" , derive( TS ) ) ]
157+ #[ cfg_attr( feature = "full" , ts( export) ) ]
158+ pub struct VoteAnalyticsByPerson {
159+ pub creator : Person ,
160+ pub total_votes : i64 ,
161+ pub upvotes : i64 ,
162+ pub downvotes : i64 ,
163+ pub upvote_percentage : f64 ,
164+ }
165+
166+ #[ derive( Debug , Serialize ) ]
167+ #[ cfg_attr( feature = "full" , derive( TS ) ) ]
168+ #[ cfg_attr( feature = "full" , ts( export) ) ]
169+ pub struct VoteAnalyticsByCommunity {
170+ pub community : Community ,
171+ pub total_votes : i64 ,
172+ pub upvotes : i64 ,
173+ pub downvotes : i64 ,
174+ pub upvote_percentage : f64 ,
175+ }
176+
177+ #[ derive( Debug , Serialize ) ]
178+ #[ cfg_attr( feature = "full" , derive( TS ) ) ]
179+ #[ cfg_attr( feature = "full" , ts( export) ) ]
180+ pub struct VoteAnalyticsGivenByPersonView {
181+ pub post_votes_total_votes : i64 ,
182+ pub post_votes_total_upvotes : i64 ,
183+ pub post_votes_total_downvotes : i64 ,
184+ pub post_votes_total_upvote_percentage : f64 ,
185+ pub post_votes_by_target_user : Vec < VoteAnalyticsByPerson > ,
186+ pub post_votes_by_target_community : Vec < VoteAnalyticsByCommunity > ,
187+ pub comment_votes_total_votes : i64 ,
188+ pub comment_votes_total_upvotes : i64 ,
189+ pub comment_votes_total_downvotes : i64 ,
190+ pub comment_votes_total_upvote_percentage : f64 ,
191+ pub comment_votes_by_target_user : Vec < VoteAnalyticsByPerson > ,
192+ pub comment_votes_by_target_community : Vec < VoteAnalyticsByCommunity > ,
193+ }
0 commit comments