pub struct CollusionRing {Show 13 fields
pub ring_id: Uuid,
pub ring_type: CollusionRingType,
pub fraud_category: AcfeFraudCategory,
pub members: Vec<Conspirator>,
pub formation_date: NaiveDate,
pub status: RingStatus,
pub total_stolen: Decimal,
pub transaction_count: u32,
pub detection_risk: f64,
pub behavior: RingBehavior,
pub active_months: u32,
pub transaction_ids: Vec<String>,
pub metadata: HashMap<String, String>,
}Expand description
A collusion ring modeling multiple conspirators in a coordinated scheme.
Fields§
§ring_id: UuidUnique ring identifier.
ring_type: CollusionRingTypeType of collusion ring.
fraud_category: AcfeFraudCategoryACFE fraud category.
members: Vec<Conspirator>Members of the ring.
formation_date: NaiveDateDate the ring was formed.
status: RingStatusCurrent status.
total_stolen: DecimalTotal amount stolen by the ring.
transaction_count: u32Number of successful transactions.
detection_risk: f64Current detection risk (0.0-1.0).
behavior: RingBehaviorBehavioral parameters.
active_months: u32Months the ring has been active.
transaction_ids: Vec<String>Transaction IDs associated with this ring.
metadata: HashMap<String, String>Metadata for tracking.
Implementations§
Source§impl CollusionRing
impl CollusionRing
Sourcepub fn new(
ring_type: CollusionRingType,
fraud_category: AcfeFraudCategory,
formation_date: NaiveDate,
) -> Self
pub fn new( ring_type: CollusionRingType, fraud_category: AcfeFraudCategory, formation_date: NaiveDate, ) -> Self
Creates a new collusion ring.
Sourcepub fn add_member(&mut self, conspirator: Conspirator)
pub fn add_member(&mut self, conspirator: Conspirator)
Adds a conspirator to the ring.
Sourcepub fn initiators(&self) -> Vec<&Conspirator>
pub fn initiators(&self) -> Vec<&Conspirator>
Returns the initiator(s) of the ring.
Sourcepub fn executors(&self) -> Vec<&Conspirator>
pub fn executors(&self) -> Vec<&Conspirator>
Returns the executor(s) of the ring.
Sourcepub fn approvers(&self) -> Vec<&Conspirator>
pub fn approvers(&self) -> Vec<&Conspirator>
Returns the approver(s) of the ring.
Sourcepub fn record_transaction(
&mut self,
amount: Decimal,
transaction_id: impl Into<String>,
)
pub fn record_transaction( &mut self, amount: Decimal, transaction_id: impl Into<String>, )
Records a successful transaction.
Sourcepub fn record_near_miss(&mut self)
pub fn record_near_miss(&mut self)
Records a near miss event.
Sourcepub fn advance_month<R: Rng>(&mut self, rng: &mut R)
pub fn advance_month<R: Rng>(&mut self, rng: &mut R)
Advances the ring by one month.
Sourcepub fn detection_difficulty(&self) -> AnomalyDetectionDifficulty
pub fn detection_difficulty(&self) -> AnomalyDetectionDifficulty
Returns the detection difficulty for this ring.
Calculates the average share per member.
Sourcepub fn description(&self) -> String
pub fn description(&self) -> String
Returns descriptive summary of the ring.
Trait Implementations§
Source§impl Clone for CollusionRing
impl Clone for CollusionRing
Source§fn clone(&self) -> CollusionRing
fn clone(&self) -> CollusionRing
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CollusionRing
impl Debug for CollusionRing
Source§impl<'de> Deserialize<'de> for CollusionRing
impl<'de> Deserialize<'de> for CollusionRing
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>,
Auto Trait Implementations§
impl Freeze for CollusionRing
impl RefUnwindSafe for CollusionRing
impl Send for CollusionRing
impl Sync for CollusionRing
impl Unpin for CollusionRing
impl UnsafeUnpin for CollusionRing
impl UnwindSafe for CollusionRing
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.