2 aggregates::structs::{CommentAggregates, PersonAggregates, PostAggregates, SiteAggregates},
5 comment_report::CommentReport,
6 community::CommunitySafe,
8 local_site_rate_limit::LocalSiteRateLimit,
9 local_user::{LocalUser, LocalUserSettings},
10 person::{Person, PersonSafe},
12 post_report::PostReport,
13 private_message::PrivateMessage,
14 private_message_report::PrivateMessageReport,
15 registration_application::RegistrationApplication,
20 use serde::{Deserialize, Serialize};
22 #[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
23 pub struct CommentReportView {
24 pub comment_report: CommentReport,
27 pub community: CommunitySafe,
28 pub creator: PersonSafe,
29 pub comment_creator: PersonSafe,
30 pub counts: CommentAggregates,
31 pub creator_banned_from_community: bool, // Left Join to CommunityPersonBan
32 pub my_vote: Option<i16>, // Left join to CommentLike
33 pub resolver: Option<PersonSafe>,
36 #[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
37 pub struct CommentView {
39 pub creator: PersonSafe,
41 pub community: CommunitySafe,
42 pub counts: CommentAggregates,
43 pub creator_banned_from_community: bool, // Left Join to CommunityPersonBan
44 pub subscribed: SubscribedType, // Left join to CommunityFollower
45 pub saved: bool, // Left join to CommentSaved
46 pub creator_blocked: bool, // Left join to PersonBlock
47 pub my_vote: Option<i16>, // Left join to CommentLike
50 #[derive(Debug, Serialize, Deserialize, Clone)]
51 pub struct LocalUserView {
52 pub local_user: LocalUser,
54 pub counts: PersonAggregates,
57 #[derive(Debug, Serialize, Deserialize, Clone)]
58 pub struct LocalUserSettingsView {
59 pub local_user: LocalUserSettings,
60 pub person: PersonSafe,
61 pub counts: PersonAggregates,
64 #[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
65 pub struct PostReportView {
66 pub post_report: PostReport,
68 pub community: CommunitySafe,
69 pub creator: PersonSafe,
70 pub post_creator: PersonSafe,
71 pub creator_banned_from_community: bool,
72 pub my_vote: Option<i16>,
73 pub counts: PostAggregates,
74 pub resolver: Option<PersonSafe>,
77 #[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
80 pub creator: PersonSafe,
81 pub community: CommunitySafe,
82 pub creator_banned_from_community: bool, // Left Join to CommunityPersonBan
83 pub counts: PostAggregates,
84 pub subscribed: SubscribedType, // Left join to CommunityFollower
85 pub saved: bool, // Left join to PostSaved
86 pub read: bool, // Left join to PostRead
87 pub creator_blocked: bool, // Left join to PersonBlock
88 pub my_vote: Option<i16>, // Left join to PostLike
89 pub unread_comments: i64, // Left join to PersonPostAggregates
92 #[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
93 pub struct PrivateMessageView {
94 pub private_message: PrivateMessage,
95 pub creator: PersonSafe,
96 pub recipient: PersonSafe,
99 #[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
100 pub struct PrivateMessageReportView {
101 pub private_message_report: PrivateMessageReport,
102 pub private_message: PrivateMessage,
103 pub private_message_creator: PersonSafe,
104 pub creator: PersonSafe,
105 pub resolver: Option<PersonSafe>,
108 #[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
109 pub struct RegistrationApplicationView {
110 pub registration_application: RegistrationApplication,
111 pub creator_local_user: LocalUserSettings,
112 pub creator: PersonSafe,
113 pub admin: Option<PersonSafe>,
116 #[derive(Debug, Serialize, Deserialize, Clone)]
117 pub struct SiteView {
119 pub local_site: LocalSite,
120 pub local_site_rate_limit: LocalSiteRateLimit,
121 pub counts: SiteAggregates,