rive_models/
report.rs

1use serde::{Deserialize, Serialize};
2
3/// Reason for reporting content (message or server)
4#[derive(Serialize, Deserialize, Debug, Clone)]
5pub enum ContentReportReason {
6    /// No reason has been specified
7    NoneSpecified,
8
9    /// Blatantly illegal content
10    Illegal,
11
12    /// Content that promotes harm to others / self
13    PromotesHarm,
14
15    /// Spam or platform abuse
16    SpamAbuse,
17
18    /// Distribution of malware
19    Malware,
20
21    /// Harassment or abuse targeted at another user
22    Harassment,
23}
24
25/// Reason for reporting a user
26#[derive(Serialize, Deserialize, Debug, Clone)]
27pub enum UserReportReason {
28    /// No reason has been specified
29    NoneSpecified,
30
31    /// User is sending spam or otherwise abusing the platform
32    SpamAbuse,
33
34    /// User's profile contains inappropriate content for a general audience
35    InappropriateProfile,
36
37    /// User is impersonating another user
38    Impersonation,
39
40    /// User is evading a ban
41    BanEvasion,
42
43    /// User is not of minimum age to use the platform
44    Underage,
45}
46
47/// The content being reported
48#[derive(Serialize, Deserialize, Debug, Clone)]
49#[serde(tag = "type")]
50pub enum ReportedContent {
51    /// Report a message
52    Message {
53        /// ID of the message
54        id: String,
55        /// Reason for reporting message
56        report_reason: ContentReportReason,
57    },
58    /// Report a server
59    Server {
60        /// ID of the server
61        id: String,
62        /// Reason for reporting server
63        report_reason: ContentReportReason,
64    },
65    /// Report a user
66    User {
67        /// ID of the user
68        id: String,
69        /// Reason for reporting a user
70        report_reason: UserReportReason,
71    },
72}
73
74/// Status of the report
75#[derive(Serialize, Deserialize, Debug, Clone)]
76#[serde(tag = "status")]
77pub enum ReportStatus {
78    /// Report is waiting for triage / action
79    Created,
80
81    /// Report was rejected
82    Rejected { rejection_reason: String },
83
84    /// Report was actioned and resolved
85    Resolved,
86}
87
88/// User-generated platform moderation report.
89#[derive(Deserialize, Debug, Clone)]
90pub struct Report {
91    /// Unique Id
92    #[serde(rename = "_id")]
93    pub id: String,
94    /// Id of the user creating this report
95    pub author_id: String,
96    /// Reported content
97    pub content: ReportedContent,
98    /// Additional report context
99    pub additional_context: String,
100    /// Status of the report
101    #[serde(flatten)]
102    pub status: ReportStatus,
103    /// Additional notes included on the report
104    #[serde(default)]
105    pub notes: String,
106}