pub struct VendorAnomalyRules {
pub new_vendor_threshold_days: u32,
pub new_vendor_error_multiplier: f64,
pub new_vendor_error_types: Vec<AnomalyType>,
pub strategic_vendor_spend_threshold: Decimal,
pub strategic_vendor_types: Vec<AnomalyType>,
pub international_error_types: Vec<AnomalyType>,
pub dormant_vendor_threshold_days: u32,
pub dormant_reactivation_multiplier: f64,
}Expand description
Rules for vendor-specific anomaly patterns.
Fields§
§new_vendor_threshold_days: u32Threshold for “new” vendor in days.
new_vendor_error_multiplier: f64Error rate multiplier for new vendors.
new_vendor_error_types: Vec<AnomalyType>Anomaly types more common with new vendors.
strategic_vendor_spend_threshold: DecimalThreshold for “strategic” vendor by total spend.
strategic_vendor_types: Vec<AnomalyType>Anomaly types for strategic vendors (typically fraud).
international_error_types: Vec<AnomalyType>International vendor FX/tax error types.
dormant_vendor_threshold_days: u32Dormant vendor threshold in days.
dormant_reactivation_multiplier: f64Error multiplier for dormant vendor reactivation.
Implementations§
Source§impl VendorAnomalyRules
impl VendorAnomalyRules
Sourcepub fn is_new_vendor(
&self,
creation_date: NaiveDate,
current_date: NaiveDate,
) -> bool
pub fn is_new_vendor( &self, creation_date: NaiveDate, current_date: NaiveDate, ) -> bool
Checks if a vendor is considered “new”.
Sourcepub fn is_dormant_vendor(
&self,
last_activity: NaiveDate,
current_date: NaiveDate,
) -> bool
pub fn is_dormant_vendor( &self, last_activity: NaiveDate, current_date: NaiveDate, ) -> bool
Checks if a vendor is “dormant” (no activity for threshold period).
Sourcepub fn is_strategic_vendor(&self, total_spend: Decimal) -> bool
pub fn is_strategic_vendor(&self, total_spend: Decimal) -> bool
Checks if a vendor is “strategic” based on total spend.
Sourcepub fn get_multiplier(&self, context: &VendorContext) -> f64
pub fn get_multiplier(&self, context: &VendorContext) -> f64
Gets the error rate multiplier for a vendor.
Sourcepub fn get_applicable_types(&self, context: &VendorContext) -> Vec<AnomalyType>
pub fn get_applicable_types(&self, context: &VendorContext) -> Vec<AnomalyType>
Gets applicable anomaly types for a vendor context.
Trait Implementations§
Source§impl Clone for VendorAnomalyRules
impl Clone for VendorAnomalyRules
Source§fn clone(&self) -> VendorAnomalyRules
fn clone(&self) -> VendorAnomalyRules
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 VendorAnomalyRules
impl Debug for VendorAnomalyRules
Source§impl Default for VendorAnomalyRules
impl Default for VendorAnomalyRules
Source§impl<'de> Deserialize<'de> for VendorAnomalyRules
impl<'de> Deserialize<'de> for VendorAnomalyRules
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
Auto Trait Implementations§
impl Freeze for VendorAnomalyRules
impl RefUnwindSafe for VendorAnomalyRules
impl Send for VendorAnomalyRules
impl Sync for VendorAnomalyRules
impl Unpin for VendorAnomalyRules
impl UnsafeUnpin for VendorAnomalyRules
impl UnwindSafe for VendorAnomalyRules
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