pub struct TechnicalInspection {Show 26 fields
pub id: Uuid,
pub organization_id: Uuid,
pub building_id: Uuid,
pub inspection_type: InspectionType,
pub title: String,
pub description: Option<String>,
pub inspector_name: String,
pub inspector_company: Option<String>,
pub inspector_certification: Option<String>,
pub inspection_date: DateTime<Utc>,
pub next_due_date: DateTime<Utc>,
pub status: InspectionStatus,
pub result_summary: Option<String>,
pub defects_found: Option<String>,
pub recommendations: Option<String>,
pub compliant: Option<bool>,
pub compliance_certificate_number: Option<String>,
pub compliance_valid_until: Option<DateTime<Utc>>,
pub cost: Option<Decimal>,
pub invoice_number: Option<String>,
pub reports: Vec<String>,
pub photos: Vec<String>,
pub certificates: Vec<String>,
pub notes: Option<String>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
Technical Inspection - Inspection technique obligatoire
Tracks mandatory technical inspections for building equipment and systems. Belgian law requires regular inspections for safety-critical equipment.
Fields§
§id: Uuid§organization_id: Uuid§building_id: Uuid§inspection_type: InspectionType§title: String§description: Option<String>§inspector_name: String§inspector_company: Option<String>§inspector_certification: Option<String>§inspection_date: DateTime<Utc>§next_due_date: DateTime<Utc>§status: InspectionStatus§result_summary: Option<String>§defects_found: Option<String>§recommendations: Option<String>§compliant: Option<bool>§compliance_certificate_number: Option<String>§compliance_valid_until: Option<DateTime<Utc>>§cost: Option<Decimal>Coût de l’inspection en EUR. Decimal et non f64 : montant
refacturé via la répartition des charges (Art. 3.86 CC) —
ADR-0007/0008 §A.
invoice_number: Option<String>§reports: Vec<String>§photos: Vec<String>§certificates: Vec<String>§notes: Option<String>§created_at: DateTime<Utc>§updated_at: DateTime<Utc>Implementations§
Source§impl TechnicalInspection
impl TechnicalInspection
Sourcepub fn set_cost(
&mut self,
cost: Option<Decimal>,
) -> Result<(), TechnicalInspectionError>
pub fn set_cost( &mut self, cost: Option<Decimal>, ) -> Result<(), TechnicalInspectionError>
Pose le coût en portant l’invariant de non-négativité.
TechnicalInspection::new ne prend pas de coût (il est renseigné plus
tard, à la facturation) : l’invariant que portait
#[validate(range(min = 0.0))] côté DTO se place donc ici, au seul
point d’écriture, plutôt que de disparaître avec l’annotation.
pub fn new( organization_id: Uuid, building_id: Uuid, title: String, description: Option<String>, inspection_type: InspectionType, inspector_name: String, inspection_date: DateTime<Utc>, ) -> Self
Sourcepub fn calculate_next_due_date(&self) -> DateTime<Utc>
pub fn calculate_next_due_date(&self) -> DateTime<Utc>
Calculate next due date based on inspection type
Sourcepub fn is_overdue(&self) -> bool
pub fn is_overdue(&self) -> bool
Check if inspection is overdue
Sourcepub fn days_until_due(&self) -> i64
pub fn days_until_due(&self) -> i64
Get days until next inspection is due (negative if overdue)
Sourcepub fn mark_overdue(&mut self)
pub fn mark_overdue(&mut self)
Mark as overdue
Sourcepub fn add_report(&mut self, report_path: String)
pub fn add_report(&mut self, report_path: String)
Add report to inspection
Sourcepub fn add_certificate(&mut self, certificate_path: String)
pub fn add_certificate(&mut self, certificate_path: String)
Add certificate to inspection
Trait Implementations§
Source§impl Clone for TechnicalInspection
impl Clone for TechnicalInspection
Source§fn clone(&self) -> TechnicalInspection
fn clone(&self) -> TechnicalInspection
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TechnicalInspection
impl Debug for TechnicalInspection
Source§impl<'de> Deserialize<'de> for TechnicalInspection
impl<'de> Deserialize<'de> for TechnicalInspection
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>,
Source§impl PartialEq for TechnicalInspection
impl PartialEq for TechnicalInspection
Source§fn eq(&self, other: &TechnicalInspection) -> bool
fn eq(&self, other: &TechnicalInspection) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for TechnicalInspection
impl Serialize for TechnicalInspection
impl StructuralPartialEq for TechnicalInspection
Auto Trait Implementations§
impl Freeze for TechnicalInspection
impl RefUnwindSafe for TechnicalInspection
impl Send for TechnicalInspection
impl Sync for TechnicalInspection
impl Unpin for TechnicalInspection
impl UnsafeUnpin for TechnicalInspection
impl UnwindSafe for TechnicalInspection
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§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>
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>
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 more