use core::time::Duration;
use chrono::NaiveDate;
use super::duration_from_minutes;
use super::id::{CollectionId, MovieId};
#[derive(Debug, Clone, serde::Deserialize)]
pub struct Movie {
pub id: MovieId,
#[serde(rename = "belongs_to_collection")]
pub collection: Option<InCollection>,
pub title: String,
pub tagline: String,
pub overview: String,
pub release_date: NaiveDate,
#[serde(deserialize_with = "duration_from_minutes")]
pub runtime: Duration,
}
#[derive(Debug, Clone, serde::Deserialize)]
pub struct InCollection {
pub id: CollectionId,
#[serde(rename = "name")]
pub title: String,
}