pub struct Quote {Show 22 fields
pub id: Uuid,
pub building_id: Uuid,
pub contractor_id: Uuid,
pub project_title: String,
pub project_description: String,
pub amount_excl_vat: Decimal,
pub vat_rate: Decimal,
pub amount_incl_vat: Decimal,
pub validity_date: DateTime<Utc>,
pub estimated_start_date: Option<DateTime<Utc>>,
pub estimated_duration_days: i32,
pub warranty_years: i32,
pub contractor_rating: Option<i32>,
pub status: QuoteStatus,
pub requested_at: DateTime<Utc>,
pub submitted_at: Option<DateTime<Utc>>,
pub reviewed_at: Option<DateTime<Utc>>,
pub decision_at: Option<DateTime<Utc>>,
pub decision_by: Option<Uuid>,
pub decision_notes: Option<String>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
Quote for contractor work (Belgian legal requirement: 3 quotes for works >5000€)
Fields§
§id: Uuid§building_id: Uuid§contractor_id: Uuid§project_title: String§project_description: String§amount_excl_vat: Decimal§vat_rate: Decimal§amount_incl_vat: Decimal§validity_date: DateTime<Utc>§estimated_start_date: Option<DateTime<Utc>>§estimated_duration_days: i32§warranty_years: i32§contractor_rating: Option<i32>§status: QuoteStatus§requested_at: DateTime<Utc>§submitted_at: Option<DateTime<Utc>>§reviewed_at: Option<DateTime<Utc>>§decision_at: Option<DateTime<Utc>>§decision_by: Option<Uuid>§decision_notes: Option<String>§created_at: DateTime<Utc>§updated_at: DateTime<Utc>Implementations§
Source§impl Quote
impl Quote
Sourcepub fn new(
building_id: Uuid,
contractor_id: Uuid,
project_title: String,
project_description: String,
amount_excl_vat: Decimal,
vat_rate: Decimal,
validity_date: DateTime<Utc>,
estimated_duration_days: i32,
warranty_years: i32,
) -> Result<Self, String>
pub fn new( building_id: Uuid, contractor_id: Uuid, project_title: String, project_description: String, amount_excl_vat: Decimal, vat_rate: Decimal, validity_date: DateTime<Utc>, estimated_duration_days: i32, warranty_years: i32, ) -> Result<Self, String>
Create new quote request
Sourcepub fn start_review(&mut self) -> Result<(), String>
pub fn start_review(&mut self) -> Result<(), String>
Mark quote under review (Syndic action)
Sourcepub fn accept(
&mut self,
decision_by: Uuid,
decision_notes: Option<String>,
) -> Result<(), String>
pub fn accept( &mut self, decision_by: Uuid, decision_notes: Option<String>, ) -> Result<(), String>
Accept quote (winning bid)
Sourcepub fn reject(
&mut self,
decision_by: Uuid,
decision_notes: Option<String>,
) -> Result<(), String>
pub fn reject( &mut self, decision_by: Uuid, decision_notes: Option<String>, ) -> Result<(), String>
Reject quote (losing bid or unqualified)
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if quote is expired
Sourcepub fn mark_expired(&mut self) -> Result<(), String>
pub fn mark_expired(&mut self) -> Result<(), String>
Mark quote as expired (background job)
Sourcepub fn set_contractor_rating(&mut self, rating: i32) -> Result<(), String>
pub fn set_contractor_rating(&mut self, rating: i32) -> Result<(), String>
Update contractor rating (from historical data)
Sourcepub fn calculate_score(
&self,
min_price: Decimal,
max_price: Decimal,
min_duration: i32,
max_duration: i32,
max_warranty: i32,
) -> Result<QuoteScore, String>
pub fn calculate_score( &self, min_price: Decimal, max_price: Decimal, min_duration: i32, max_duration: i32, max_warranty: i32, ) -> Result<QuoteScore, String>
Calculate automatic score (Belgian best practices) Algorithm: price (40%), delay (30%), warranty (20%), reputation (10%) Returns QuoteScore with breakdown
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Quote
impl<'de> Deserialize<'de> for Quote
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 From<Quote> for QuoteResponseDto
impl From<Quote> for QuoteResponseDto
impl StructuralPartialEq for Quote
Auto Trait Implementations§
impl Freeze for Quote
impl RefUnwindSafe for Quote
impl Send for Quote
impl Sync for Quote
impl Unpin for Quote
impl UnwindSafe for Quote
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.