pub struct FraudConfig {
pub enabled: bool,
pub fraud_rate: f64,
pub document_fraud_rate: Option<f64>,
pub propagate_to_lines: bool,
pub propagate_to_document: bool,
pub fraud_type_distribution: FraudTypeDistribution,
pub clustering_enabled: bool,
pub clustering_factor: f64,
pub approval_thresholds: Vec<f64>,
}Expand description
Fraud simulation configuration.
§Document-level vs. line-level fraud
fraud_rate applies to individual journal-entry lines (line-level).
document_fraud_rate (optional) applies to source documents
(purchase orders, vendor invoices, customer invoices, payments), and when
propagate_to_lines is true, every JE derived from a fraudulent document
also gets is_fraud = true. This lets users express either:
- pure line-level fraud (
document_fraud_rate = None): legacy behaviour; - pure document-level fraud (
fraud_rate ≈ 0anddocument_fraud_rateset): fraud rings expressed at document granularity — realistic for PO/invoice fraud schemes where one fraudulent document spawns multiple derived JEs; - hybrid (both set): document-level scheme fraud plus unrelated line-level slip-ups.
propagate_to_document does the inverse: when a JE is tagged as fraud by
the anomaly injector, its source document is also marked fraudulent.
Fields§
§enabled: boolEnable fraud scenario generation
fraud_rate: f64Line-level fraud rate: fraction of individual JE lines flagged as fraud (0.0 to 1.0).
document_fraud_rate: Option<f64>Document-level fraud rate: fraction of source documents (PO, vendor
invoice, customer invoice, payment) flagged as fraud. None disables
document-level injection; Some(r) marks ~r × document-count as fraud
independently of the line-level rate.
propagate_to_lines: boolWhen true, flagging a document as fraudulent cascades is_fraud = true
and fraud_type to every journal entry derived from that document,
and records fraud_source_document_id on the JE header.
Default: true.
propagate_to_document: boolWhen true, tagging a JE as fraud via line-level anomaly injection also
marks the JE’s source document as fraudulent (if it can be resolved).
Default: true.
fraud_type_distribution: FraudTypeDistributionFraud type distribution
clustering_enabled: boolEnable fraud clustering
clustering_factor: f64Clustering factor
approval_thresholds: Vec<f64>Approval thresholds for threshold-adjacent fraud pattern
Trait Implementations§
Source§impl Clone for FraudConfig
impl Clone for FraudConfig
Source§fn clone(&self) -> FraudConfig
fn clone(&self) -> FraudConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more