Skip to main content

FraudActor

Struct FraudActor 

Source
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: String

User ID of the fraudster.

§user_name: String

User’s name for display purposes.

§fraud_history: Vec<FraudIncident>

Fraud history (document IDs and dates).

§escalation_pattern: EscalationPattern

Escalation pattern for this actor.

§preferred_accounts: Vec<String>

Preferred GL accounts for fraud.

§preferred_vendors: Vec<String>

Preferred vendors (for AP fraud).

§total_amount: Decimal

Total amount of fraud committed.

§start_date: Option<NaiveDate>

Start date of fraud activity.

§detection_risk: f64

Detection likelihood (0.0-1.0) - increases with activity.

§is_active: bool

Is this actor currently active?

Implementations§

Source§

impl FraudActor

Source

pub fn new( user_id: impl Into<String>, user_name: impl Into<String>, escalation_pattern: EscalationPattern, ) -> Self

Create a new fraud actor.

Source

pub fn with_account(self, account: impl Into<String>) -> Self

Add a preferred account for fraud.

Source

pub fn with_vendor(self, vendor: impl Into<String>) -> Self

Add a preferred vendor for fraud.

Source

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.

Source

pub fn next_escalation_multiplier(&self) -> f64

Get the escalation multiplier for the next fraud.

Source

pub fn get_preferred_account<R: Rng>(&self, rng: &mut R) -> Option<&str>

Get a preferred account, or None if no preferences.

Source

pub fn get_preferred_vendor<R: Rng>(&self, rng: &mut R) -> Option<&str>

Get a preferred vendor, or None if no preferences.

Trait Implementations§

Source§

impl Clone for FraudActor

Source§

fn clone(&self) -> FraudActor

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FraudActor

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V