summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorD. Scott Boggs <scott@tams.tech>2023-01-09 07:54:07 -0500
committerScott Boggs <dscottboggs@gmail.com>2023-01-09 09:03:21 -0500
commit06caec85b37e7fd6842610af92076873768f7552 (patch)
tree818e46162e647b3c0540fe89a3b6c6caefdce0d9
parentd4e7c4b59b2d3c2fb4fceb5e6c7b7256cb62e8e6 (diff)
Add ID type for reports
-rw-r--r--entities/src/report.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/entities/src/report.rs b/entities/src/report.rs
index bc4c7ea..89bbc4c 100644
--- a/entities/src/report.rs
+++ b/entities/src/report.rs
@@ -6,7 +6,18 @@ use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct Report {
/// The ID of the report.
- pub id: String,
+ pub id: ReportId,
/// The action taken in response to the report.
pub action_taken: String,
}
+
+/// Wrapper type for a report ID string
+#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
+#[serde(transparent)]
+pub struct ReportId(String);
+
+impl AsRef<str> for ReportId {
+ fn as_ref(&self) -> &str {
+ &self.0
+ }
+}