pub struct ContractEvaluation {Show 14 fields
pub id: Uuid,
pub organization_id: Uuid,
pub service_provider_id: Uuid,
pub quote_id: Option<Uuid>,
pub ticket_id: Option<Uuid>,
pub evaluator_id: Uuid,
pub building_id: Uuid,
pub criteria: HashMap<String, u8>,
pub global_score: f64,
pub comments: Option<String>,
pub would_recommend: bool,
pub is_legal_evaluation: bool,
pub is_anonymous: bool,
pub created_at: DateTime<Utc>,
}Expand description
Contract Evaluation (Review of contractor work) Issue #276: Marketplace corps de métier + ContractEvaluation Art. 3.89 §5 12° Code Civil Belge: Évaluations contracteurs (L13 annual report)
Fields§
§id: Uuid§organization_id: Uuid§service_provider_id: Uuid§quote_id: Option<Uuid>§ticket_id: Option<Uuid>§evaluator_id: Uuid§building_id: Uuid§criteria: HashMap<String, u8>Criteria scores: qualite, delai, prix, communication, proprete, conformite_devis — each 0-5
global_score: f64§comments: Option<String>§would_recommend: bool§is_legal_evaluation: bool§is_anonymous: bool§created_at: DateTime<Utc>Implementations§
Source§impl ContractEvaluation
impl ContractEvaluation
pub fn new( organization_id: Uuid, service_provider_id: Uuid, evaluator_id: Uuid, building_id: Uuid, criteria: HashMap<String, u8>, would_recommend: bool, ) -> Result<Self, String>
Sourcepub fn link_quote(&mut self, quote_id: Uuid) -> Result<(), String>
pub fn link_quote(&mut self, quote_id: Uuid) -> Result<(), String>
Link evaluation to quote (optional)
Sourcepub fn link_ticket(&mut self, ticket_id: Uuid) -> Result<(), String>
pub fn link_ticket(&mut self, ticket_id: Uuid) -> Result<(), String>
Link evaluation to ticket (optional)
Sourcepub fn mark_as_legal_evaluation(&mut self) -> Result<(), String>
pub fn mark_as_legal_evaluation(&mut self) -> Result<(), String>
Mark as legal evaluation (L13 annual report)
Sourcepub fn mark_as_anonymous(&mut self) -> Result<(), String>
pub fn mark_as_anonymous(&mut self) -> Result<(), String>
Mark as anonymous (GDPR compliant)
Sourcepub fn recalculate_global_score(&mut self) -> Result<(), String>
pub fn recalculate_global_score(&mut self) -> Result<(), String>
Recalculate global score based on updated criteria
Trait Implementations§
Source§impl Clone for ContractEvaluation
impl Clone for ContractEvaluation
Source§fn clone(&self) -> ContractEvaluation
fn clone(&self) -> ContractEvaluation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ContractEvaluation
impl Debug for ContractEvaluation
Source§impl<'de> Deserialize<'de> for ContractEvaluation
impl<'de> Deserialize<'de> for ContractEvaluation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ContractEvaluation
impl PartialEq for ContractEvaluation
Source§impl Serialize for ContractEvaluation
impl Serialize for ContractEvaluation
impl StructuralPartialEq for ContractEvaluation
Auto Trait Implementations§
impl Freeze for ContractEvaluation
impl RefUnwindSafe for ContractEvaluation
impl Send for ContractEvaluation
impl Sync for ContractEvaluation
impl Unpin for ContractEvaluation
impl UnwindSafe for ContractEvaluation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Chain<T> for T
impl<T> Chain<T> for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Fake for T
impl<T> Fake for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.