use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
pub struct AddToCollectionRequest {
pub resource_id: String,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
pub struct CollectionEntryVO {
pub id: String,
pub resource_id: String,
pub created_at: DateTime<Utc>,
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn collection_entry_roundtrips_json() {
let entry = CollectionEntryVO {
id: "entry".into(),
resource_id: "resource".into(),
created_at: DateTime::parse_from_rfc3339("2026-07-24T00:00:00Z")
.unwrap()
.with_timezone(&Utc),
};
let json = serde_json::to_value(&entry).unwrap();
assert_eq!(
serde_json::from_value::<CollectionEntryVO>(json).unwrap(),
entry
);
}
}