This commit is contained in:
Franklin 2023-03-14 21:13:24 -04:00
parent c6b524d7b1
commit ed8e9af9d9
4 changed files with 24 additions and 2 deletions

View File

@ -16,7 +16,6 @@ pub struct Agent {
#[serde(rename = "credentialType")]
pub credential_type: CredentialType,
#[serde(rename = "timeCreated")]
pub time_created: DateTime<Utc>,
#[serde(rename = "lastUpdated")]

View File

@ -2,12 +2,15 @@ use chrono::{DateTime, Utc};
use serde::{Serialize, Deserialize};
use uuid::Uuid;
use super::media::MediaList;
use super::{media::MediaList, project_type::ProjectType};
#[derive(Serialize, Deserialize, Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord)]
pub struct Project {
pub id: Uuid,
#[serde(rename = "projectType")]
pub project_type: ProjectType,
#[serde(rename = "agentId")]
pub agent_id: Uuid,
#[serde(rename = "locationId")]
@ -16,6 +19,9 @@ pub struct Project {
/// Title is optional as the agent can choose not to put the title there (in that case the title will be generated in the frontend)
pub title: Option<String>,
pub description: String,
#[serde(rename = "adminTag", skip_serializing_if = "Option::is_none")]
pub admin_tag: Option<String>,
/// Amount of floors the building/house has
pub floors: i16,

16
src/dto/filters.rs Normal file
View File

@ -0,0 +1,16 @@
use serde::{Deserialize, Serialize};
use crate::domain::project_type::ProjectType;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, PartialOrd)]
pub enum Filter {
CheaperThan(f64),
MoreExpensiveThan(f64),
InCity(String),
InDistrict(String),
Finished,
ByProjectType(ProjectType),
}

View File

@ -0,0 +1 @@
pub mod filters;