2 aggregates::structs::{CommentAggregates, PersonAggregates, PostAggregates, SiteAggregates},
5 comment_report::CommentReport,
6 community::CommunitySafe,
7 local_user::{LocalUser, LocalUserSettings},
8 person::{Person, PersonSafe, PersonSafeAlias1, PersonSafeAlias2},
10 post_report::PostReport,
11 private_message::PrivateMessage,
12 registration_application::RegistrationApplication,
16 use serde::{Deserialize, Serialize};
18 #[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
19 pub struct CommentReportView {
20 pub comment_report: CommentReport,
23 pub community: CommunitySafe,
24 pub creator: PersonSafe,
25 pub comment_creator: PersonSafeAlias1,
26 pub counts: CommentAggregates,
27 pub creator_banned_from_community: bool, // Left Join to CommunityPersonBan
28 pub my_vote: Option<i16>, // Left join to CommentLike
29 pub resolver: Option<PersonSafeAlias2>,
32 #[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
33 pub struct CommentView {
35 pub creator: PersonSafe,
36 pub recipient: Option<PersonSafeAlias1>, // Left joins to comment and person
38 pub community: CommunitySafe,
39 pub counts: CommentAggregates,
40 pub creator_banned_from_community: bool, // Left Join to CommunityPersonBan
41 pub subscribed: bool, // Left join to CommunityFollower
42 pub saved: bool, // Left join to CommentSaved
43 pub creator_blocked: bool, // Left join to PersonBlock
44 pub my_vote: Option<i16>, // Left join to CommentLike
47 #[derive(Debug, Serialize, Deserialize, Clone)]
48 pub struct LocalUserView {
49 pub local_user: LocalUser,
51 pub counts: PersonAggregates,
54 #[derive(Debug, Serialize, Deserialize, Clone)]
55 pub struct LocalUserSettingsView {
56 pub local_user: LocalUserSettings,
57 pub person: PersonSafe,
58 pub counts: PersonAggregates,
61 #[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
62 pub struct PostReportView {
63 pub post_report: PostReport,
65 pub community: CommunitySafe,
66 pub creator: PersonSafe,
67 pub post_creator: PersonSafeAlias1,
68 pub creator_banned_from_community: bool,
69 pub my_vote: Option<i16>,
70 pub counts: PostAggregates,
71 pub resolver: Option<PersonSafeAlias2>,
74 #[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
77 pub creator: PersonSafe,
78 pub community: CommunitySafe,
79 pub creator_banned_from_community: bool, // Left Join to CommunityPersonBan
80 pub counts: PostAggregates,
81 pub subscribed: bool, // Left join to CommunityFollower
82 pub saved: bool, // Left join to PostSaved
83 pub read: bool, // Left join to PostRead
84 pub creator_blocked: bool, // Left join to PersonBlock
85 pub my_vote: Option<i16>, // Left join to PostLike
88 #[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
89 pub struct PrivateMessageView {
90 pub private_message: PrivateMessage,
91 pub creator: PersonSafe,
92 pub recipient: PersonSafeAlias1,
95 #[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
96 pub struct RegistrationApplicationView {
97 pub registration_application: RegistrationApplication,
98 pub creator_local_user: LocalUserSettings,
99 pub creator: PersonSafe,
100 pub admin: Option<PersonSafeAlias1>,
103 #[derive(Debug, Serialize, Deserialize, Clone)]
104 pub struct SiteView {
106 pub counts: SiteAggregates,