From 9d3adca4d3d45816fd521af34b203a97487e3b19 Mon Sep 17 00:00:00 2001 From: Franklin Date: Sun, 19 Mar 2023 10:21:53 -0400 Subject: [PATCH] Removed Yew from types and added description to units --- src/domain/project.rs | 1 - src/domain/project_state/mod.rs | 8 ++++---- src/domain/unit.rs | 5 +---- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/domain/project.rs b/src/domain/project.rs index d831cfb..571fa6d 100644 --- a/src/domain/project.rs +++ b/src/domain/project.rs @@ -4,7 +4,6 @@ use uuid::Uuid; use super::{media::MediaList, project_type::ProjectType, project_condition::ProjectCondition}; -#[cfg_attr(feature = "yew", derive(yew::Properties))] #[derive(Serialize, Deserialize, Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord)] pub struct Project { pub id: Uuid, diff --git a/src/domain/project_state/mod.rs b/src/domain/project_state/mod.rs index 3284e1c..200467d 100644 --- a/src/domain/project_state/mod.rs +++ b/src/domain/project_state/mod.rs @@ -15,8 +15,8 @@ pub enum ProjectState { impl Display for ProjectState { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - ProjectState::Finished => write!(f, "Terminado"), - ProjectState::InConstruction => write!(f, "En construcción"), + ProjectState::Finished => write!(f, "Finished"), + ProjectState::InConstruction => write!(f, "InConstruction"), } } } @@ -26,8 +26,8 @@ impl FromStr for ProjectState { fn from_str(s: &str) -> Result { match s { - "Terminado" => Ok(Self::Finished), - "En construcción" => Ok(Self::InConstruction), + "Finished" => Ok(Self::Finished), + "InConstruction" => Ok(Self::InConstruction), _ => Err(Error::Parsing), } } diff --git a/src/domain/unit.rs b/src/domain/unit.rs index 5912780..6bfe7c1 100644 --- a/src/domain/unit.rs +++ b/src/domain/unit.rs @@ -7,19 +7,16 @@ use uuid::Uuid; use super::{unit_type::UnitType, media::MediaList}; -#[cfg_attr(feature = "yew", derive(yew::Properties))] #[derive(Serialize, Deserialize, Debug, Default, Clone, PartialEq, PartialOrd)] pub struct Unit { pub id: Uuid, #[serde(rename = "projectId")] pub project_id: Uuid, - /// Let the client convert from usd to whatever currency #[serde(rename = "priceUsd")] pub price_usd: f64, #[serde(rename = "unitType")] pub unit_type: UnitType, - /// Amount of rooms in unit pub rooms: i16, /// Amount of bathrooms in unit @@ -28,7 +25,7 @@ pub struct Unit { pub area: f32, pub description: String, pub media: MediaList, - + pub admin_tag: Option, #[serde(rename = "timeCreated")] pub time_created: DateTime, #[serde(rename = "lastUpdated")]