use serde::Deserialize;
use time::OffsetDateTime;
use crate::HackerNewsID;
#[derive(Debug, Deserialize)]
pub struct HackerNewsUser {
pub id: String,
#[serde(with = "time::serde::timestamp")]
pub created: OffsetDateTime,
pub karma: u32,
pub about: Option<String>,
pub stories: Option<Vec<HackerNewsID>>,
}
impl HackerNewsUser {
pub fn has_about_section(&self) -> bool {
self.about.is_some()
}
pub fn has_related_stories(&self) -> bool {
self.stories.is_some()
}
}