Types v1
This commit is contained in:
parent
c6b524d7b1
commit
ed8e9af9d9
@ -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")]
|
||||
|
@ -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
16
src/dto/filters.rs
Normal 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),
|
||||
}
|
@ -0,0 +1 @@
|
||||
pub mod filters;
|
Loading…
Reference in New Issue
Block a user