Adjusted filters

This commit is contained in:
Franklin 2023-03-19 11:29:24 -04:00
parent edc5267cbd
commit 025db35b9a
4 changed files with 8 additions and 13 deletions

View File

@ -1,34 +1,32 @@
use chrono::{DateTime, Utc};
use chrono::{DateTime, Utc, NaiveDateTime};
use serde::{Serialize, Deserialize};
use uuid::Uuid;
use super::{media::MediaList, project_type::ProjectType, project_condition::ProjectCondition};
use super::{media::MediaList, project_type::ProjectType, project_condition::ProjectCondition, project_state::ProjectState};
#[derive(Serialize, Deserialize, Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord)]
pub struct Project {
pub id: Uuid,
#[serde(rename = "projectState")]
pub project_state: ProjectState,
#[serde(rename = "projectType")]
pub project_type: ProjectType,
#[serde(rename = "projectCondition")]
pub project_condition: ProjectCondition,
#[serde(rename = "agentId")]
pub agent_id: Uuid,
#[serde(rename = "locationId")]
pub location_id: Uuid,
/// 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>,
#[serde(rename = "finishDate")]
pub finish_date: NaiveDateTime,
/// Amount of floors the building/house has
pub floors: i16,
pub media: MediaList,
#[serde(rename = "timeCreated")]
pub time_created: DateTime<Utc>,
#[serde(rename = "lastUpdated")]

View File

@ -6,8 +6,9 @@ use serde::{Deserialize, Serialize};
use super::error::Error;
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Default)]
pub enum ProjectState {
#[default]
Finished,
InConstruction,
}

View File

@ -16,7 +16,6 @@ pub enum ProjectType {
Solar,
}
#[allow(unused)]
impl Display for ProjectType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {

View File

@ -5,9 +5,6 @@ use crate::domain::{project_type::ProjectType, project_condition::ProjectConditi
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, PartialOrd)]
pub enum Filter {
CheaperThan(f64),
MoreExpensiveThan(f64),
InCity(String),
InDistrict(String),