1use core::time::Duration;
2
3use chrono::NaiveDate;
4
5use super::duration_from_minutes;
6use super::id::{CollectionId, MovieId};
7
8#[derive(Debug, Clone, serde::Deserialize)]
10pub struct Movie {
11 pub id: MovieId,
13 #[serde(rename = "belongs_to_collection")]
15 pub collection: Option<InCollection>,
16 pub title: String,
18 pub tagline: String,
20 pub overview: String,
22 pub release_date: NaiveDate,
24 #[serde(deserialize_with = "duration_from_minutes")]
26 pub runtime: Duration,
27}
28
29#[derive(Debug, Clone, serde::Deserialize)]
31pub struct InCollection {
32 pub id: CollectionId,
34 #[serde(rename = "name")]
36 pub title: String,
37}
38
39