Add ID type for reports

This commit is contained in:
D. Scott Boggs 2023-01-09 07:54:07 -05:00 committed by Scott Boggs
parent d4e7c4b59b
commit 06caec85b3
1 changed files with 12 additions and 1 deletions

View File

@ -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
}
}