use serde::{Deserialize, Serialize};
use uuid::Uuid;
use crate::v5::{chapter_aggregate_array_or_map, volume_aggregate_array_or_map};
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
#[non_exhaustive]
pub struct MangaAggregate {
#[serde(with = "volume_aggregate_array_or_map")]
pub volumes: Vec<VolumeAggregate>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
#[non_exhaustive]
pub struct VolumeAggregate {
pub volume: String,
pub count: u32,
#[serde(with = "chapter_aggregate_array_or_map")]
pub chapters: Vec<ChapterAggregate>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
#[non_exhaustive]
pub struct ChapterAggregate {
pub chapter: String,
pub id: Uuid,
pub others: Vec<Uuid>,
pub count: u32,
}