pub struct EmployeeAnomalyRules {
pub new_employee_threshold_days: u32,
pub new_employee_error_rate: f64,
pub volume_fatigue_threshold: u32,
pub volume_fatigue_multiplier: f64,
pub coverage_error_multiplier: f64,
pub overtime_hours_threshold: f64,
pub overtime_error_multiplier: f64,
pub new_employee_error_types: Vec<AnomalyType>,
pub fatigue_error_types: Vec<AnomalyType>,
}Expand description
Rules for employee-specific anomaly patterns.
Fields§
§new_employee_threshold_days: u32Threshold for “new” employee in days.
new_employee_error_rate: f64Error rate for new employees.
volume_fatigue_threshold: u32Transaction volume threshold for fatigue.
volume_fatigue_multiplier: f64Error multiplier when volume exceeds threshold.
coverage_error_multiplier: f64Error multiplier when covering for absent approver.
overtime_hours_threshold: f64Overtime hours threshold for error spike.
overtime_error_multiplier: f64Error multiplier during overtime.
new_employee_error_types: Vec<AnomalyType>Error types more common with new employees.
fatigue_error_types: Vec<AnomalyType>Error types from fatigue.
Implementations§
Source§impl EmployeeAnomalyRules
impl EmployeeAnomalyRules
Sourcepub fn is_new_employee(
&self,
hire_date: NaiveDate,
current_date: NaiveDate,
) -> bool
pub fn is_new_employee( &self, hire_date: NaiveDate, current_date: NaiveDate, ) -> bool
Checks if an employee is considered “new”.
Sourcepub fn is_volume_fatigue(&self, daily_transaction_count: u32) -> bool
pub fn is_volume_fatigue(&self, daily_transaction_count: u32) -> bool
Checks if employee is experiencing volume fatigue.
Sourcepub fn is_overtime(&self, weekly_hours: f64) -> bool
pub fn is_overtime(&self, weekly_hours: f64) -> bool
Checks if employee is in overtime.
Sourcepub fn get_multiplier(&self, context: &EmployeeContext) -> f64
pub fn get_multiplier(&self, context: &EmployeeContext) -> f64
Gets the error rate multiplier for an employee.
Sourcepub fn get_applicable_types(
&self,
context: &EmployeeContext,
) -> Vec<AnomalyType>
pub fn get_applicable_types( &self, context: &EmployeeContext, ) -> Vec<AnomalyType>
Gets applicable anomaly types for an employee context.
Trait Implementations§
Source§impl Clone for EmployeeAnomalyRules
impl Clone for EmployeeAnomalyRules
Source§fn clone(&self) -> EmployeeAnomalyRules
fn clone(&self) -> EmployeeAnomalyRules
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 EmployeeAnomalyRules
impl Debug for EmployeeAnomalyRules
Source§impl Default for EmployeeAnomalyRules
impl Default for EmployeeAnomalyRules
Source§impl<'de> Deserialize<'de> for EmployeeAnomalyRules
impl<'de> Deserialize<'de> for EmployeeAnomalyRules
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 EmployeeAnomalyRules
impl RefUnwindSafe for EmployeeAnomalyRules
impl Send for EmployeeAnomalyRules
impl Sync for EmployeeAnomalyRules
impl Unpin for EmployeeAnomalyRules
impl UnwindSafe for EmployeeAnomalyRules
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