use chrono::NaiveDate;
use serde::{Deserialize, Serialize};
use typeshare::typeshare;
use utoipa::ToSchema;
use uuid::Uuid;
use crate::model::dto::{
areas::{NewAreaDto, UpdateAreaDto},
base_layer_images::{BaseLayerImageDto, DeleteBaseLayerImageDto, UpdateBaseLayerImageDto},
drawings::{DrawingDto, UpdateDrawingsDto},
layers::{DeleteLayerDto, LayerDto, UpdateLayerDto},
plantings::{DeletePlantingDto, PlantingDto, UpdatePlantingDto},
};
#[typeshare]
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
#[aliases(
ActionDtoWrapperNewPlantings = ActionDtoWrapper<Vec<PlantingDto>>,
ActionDtoWrapperUpdatePlantings = ActionDtoWrapper<UpdatePlantingDto>,
ActionDtoWrapperDeletePlantings = ActionDtoWrapper<Vec<DeletePlantingDto>>,
ActionDtoWrapperNewDrawings = ActionDtoWrapper<Vec<DrawingDto>>,
ActionDtoWrapperUpdateDrawings = ActionDtoWrapper<UpdateDrawingsDto>,
ActionDtoWrapperDeleteDrawings = ActionDtoWrapper<Vec<Uuid>>,
ActionDtoWrapperNewAreas = ActionDtoWrapper<Vec<NewAreaDto>>,
ActionDtoWrapperUpdateAreas = ActionDtoWrapper<UpdateAreaDto>,
ActionDtoWrapperDeleteAreas = ActionDtoWrapper<Vec<Uuid>>,
ActionDtoWrapperNewLayer = ActionDtoWrapper<LayerDto>,
ActionDtoWrapperUpdateLayer = ActionDtoWrapper<UpdateLayerDto>,
ActionDtoWrapperDeleteLayer = ActionDtoWrapper<DeleteLayerDto>,
ActionDtoWrapperNewBaseLayerImage = ActionDtoWrapper<BaseLayerImageDto>,
ActionDtoWrapperUpdateBaseLayerImage = ActionDtoWrapper<UpdateBaseLayerImageDto>,
ActionDtoWrapperDeleteBaseLayerImage = ActionDtoWrapper<DeleteBaseLayerImageDto>,
)]
#[serde(rename_all = "camelCase")]
pub struct ActionDtoWrapper<T> {
pub action_id: Uuid,
pub dto: T,
}
#[typeshare]
#[derive(Debug, Serialize, Clone, Deserialize, ToSchema)]
#[aliases(
TimelinePagePlantingsDto = TimelinePage<PlantingDto>,
)]
pub struct TimelinePage<T> {
pub results: Vec<T>,
pub from: NaiveDate,
pub to: NaiveDate,
}