From c938e84990cfa5859c3653463cbe4c6523cbc6b4 Mon Sep 17 00:00:00 2001 From: Franklin Date: Wed, 15 Mar 2023 09:13:12 -0400 Subject: [PATCH] Dtos still missing --- src/domain/project.rs | 4 +++- src/domain/project_condition/mod.rs | 3 ++- src/dto/filters.rs | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/domain/project.rs b/src/domain/project.rs index bcc6dd8..571fa6d 100644 --- a/src/domain/project.rs +++ b/src/domain/project.rs @@ -2,7 +2,7 @@ use chrono::{DateTime, Utc}; use serde::{Serialize, Deserialize}; use uuid::Uuid; -use super::{media::MediaList, project_type::ProjectType}; +use super::{media::MediaList, project_type::ProjectType, project_condition::ProjectCondition}; #[derive(Serialize, Deserialize, Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord)] pub struct Project { @@ -10,6 +10,8 @@ pub struct Project { #[serde(rename = "projectType")] pub project_type: ProjectType, + #[serde(rename = "projectCondition")] + pub project_condition: ProjectCondition, #[serde(rename = "agentId")] pub agent_id: Uuid, diff --git a/src/domain/project_condition/mod.rs b/src/domain/project_condition/mod.rs index 6e539d1..5e74116 100644 --- a/src/domain/project_condition/mod.rs +++ b/src/domain/project_condition/mod.rs @@ -7,8 +7,9 @@ use super::error::Error; #[cfg(feature = "sqlx")] pub mod impls; -#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Serialize, Deserialize, Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord)] pub enum ProjectCondition { + #[default] New, Resale, } diff --git a/src/dto/filters.rs b/src/dto/filters.rs index 03c4e38..fa71922 100644 --- a/src/dto/filters.rs +++ b/src/dto/filters.rs @@ -1,6 +1,6 @@ use serde::{Deserialize, Serialize}; -use crate::domain::project_type::ProjectType; +use crate::domain::{project_type::ProjectType, project_condition::ProjectCondition}; #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, PartialOrd)] @@ -13,4 +13,5 @@ pub enum Filter { Finished, ByProjectType(ProjectType), + ByProjectCondition(ProjectCondition), } \ No newline at end of file