use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use crate::ids::{EventId, ImageId, PrintId};
use crate::timestamp::Timestamp;
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
#[serde(deny_unknown_fields)]
pub struct ImageRecord {
pub id: ImageId,
pub print_id: PrintId,
pub event_id: EventId,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub source_url: Option<String>,
pub fetched_at: Timestamp,
pub content_type: String,
pub byte_len: i64,
pub sha256: String,
pub relative_path: String,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
#[serde(deny_unknown_fields)]
pub struct ImageRef {
pub id: ImageId,
pub sha256: String,
}