feat(api): expose object created_at/updated_at in AdminObjectView (#44)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-06 23:17:50 +02:00
parent e7ff817c63
commit 5efa7b8a16
2 changed files with 46 additions and 0 deletions
+12
View File
@@ -45,6 +45,10 @@ pub(crate) struct AdminObjectView {
/// Flexible field values (key -> value).
#[schema(value_type = std::collections::HashMap<String, serde_json::Value>)]
pub fields: serde_json::Value,
/// RFC3339 UTC timestamp.
pub created_at: String,
/// RFC3339 UTC timestamp.
pub updated_at: String,
}
impl AdminObjectView {
@@ -61,6 +65,14 @@ impl AdminObjectView {
recording_date: o.recording_date.map(format_date),
visibility: o.visibility.as_str().to_owned(),
fields: o.fields.clone(),
created_at: o
.created_at
.format(&time::format_description::well_known::Rfc3339)
.unwrap_or_default(),
updated_at: o
.updated_at
.format(&time::format_description::well_known::Rfc3339)
.unwrap_or_default(),
}
}
}