pub struct FraudActor {
pub user_id: String,
pub user_name: String,
pub fraud_history: Vec<FraudIncident>,
pub escalation_pattern: EscalationPattern,
pub preferred_accounts: Vec<String>,
pub preferred_vendors: Vec<String>,
pub total_amount: Decimal,
pub start_date: Option<NaiveDate>,
pub detection_risk: f64,
pub is_active: bool,
}Expand description
A fraud actor represents a user who commits fraud over time.
Fields§
§user_id: StringUser ID of the fraudster.
user_name: StringUser’s name for display purposes.
fraud_history: Vec<FraudIncident>Fraud history (document IDs and dates).
escalation_pattern: EscalationPatternEscalation pattern for this actor.
preferred_accounts: Vec<String>Preferred GL accounts for fraud.
preferred_vendors: Vec<String>Preferred vendors (for AP fraud).
total_amount: DecimalTotal amount of fraud committed.
start_date: Option<NaiveDate>Start date of fraud activity.
detection_risk: f64Detection likelihood (0.0-1.0) - increases with activity.
is_active: boolIs this actor currently active?
Implementations§
Source§impl FraudActor
impl FraudActor
Sourcepub fn new(
user_id: impl Into<String>,
user_name: impl Into<String>,
escalation_pattern: EscalationPattern,
) -> Self
pub fn new( user_id: impl Into<String>, user_name: impl Into<String>, escalation_pattern: EscalationPattern, ) -> Self
Create a new fraud actor.
Sourcepub fn with_account(self, account: impl Into<String>) -> Self
pub fn with_account(self, account: impl Into<String>) -> Self
Add a preferred account for fraud.
Sourcepub fn with_vendor(self, vendor: impl Into<String>) -> Self
pub fn with_vendor(self, vendor: impl Into<String>) -> Self
Add a preferred vendor for fraud.
Sourcepub fn record_fraud(
&mut self,
document_id: impl Into<String>,
date: NaiveDate,
amount: Decimal,
fraud_type: impl Into<String>,
account: Option<String>,
entity: Option<String>,
)
pub fn record_fraud( &mut self, document_id: impl Into<String>, date: NaiveDate, amount: Decimal, fraud_type: impl Into<String>, account: Option<String>, entity: Option<String>, )
Record a fraud incident.
Sourcepub fn next_escalation_multiplier(&self) -> f64
pub fn next_escalation_multiplier(&self) -> f64
Get the escalation multiplier for the next fraud.
Trait Implementations§
Source§impl Clone for FraudActor
impl Clone for FraudActor
Source§fn clone(&self) -> FraudActor
fn clone(&self) -> FraudActor
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 moreAuto Trait Implementations§
impl Freeze for FraudActor
impl RefUnwindSafe for FraudActor
impl Send for FraudActor
impl Sync for FraudActor
impl Unpin for FraudActor
impl UnwindSafe for FraudActor
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