pub struct DocumentFlowAnomalyInjector { /* private fields */ }Expand description
Injector for document flow anomalies.
Implementations§
Source§impl DocumentFlowAnomalyInjector
impl DocumentFlowAnomalyInjector
Sourcepub fn new(config: DocumentFlowAnomalyConfig, seed: u64) -> Self
pub fn new(config: DocumentFlowAnomalyConfig, seed: u64) -> Self
Create a new document flow anomaly injector.
Sourcepub fn get_results(&self) -> &[DocumentFlowAnomalyResult]
pub fn get_results(&self) -> &[DocumentFlowAnomalyResult]
Get the results of anomaly injection.
Sourcepub fn clear_results(&mut self)
pub fn clear_results(&mut self)
Clear results.
Sourcepub fn maybe_inject_quantity_mismatch(
&mut self,
gr: &mut GoodsReceipt,
po: &PurchaseOrder,
) -> bool
pub fn maybe_inject_quantity_mismatch( &mut self, gr: &mut GoodsReceipt, po: &PurchaseOrder, ) -> bool
Maybe inject a quantity mismatch into a goods receipt.
Returns true if an anomaly was injected.
Sourcepub fn maybe_inject_price_mismatch(
&mut self,
invoice: &mut VendorInvoice,
po: &PurchaseOrder,
) -> bool
pub fn maybe_inject_price_mismatch( &mut self, invoice: &mut VendorInvoice, po: &PurchaseOrder, ) -> bool
Maybe inject a price mismatch into a vendor invoice.
Returns true if an anomaly was injected.
Sourcepub fn inject_maverick_buying(&mut self, invoice: &mut VendorInvoice) -> bool
pub fn inject_maverick_buying(&mut self, invoice: &mut VendorInvoice) -> bool
Create an invoice without PO reference (maverick buying).
Removes the PO reference from an invoice to simulate maverick buying.
Sourcepub fn create_early_invoice_anomaly(
&mut self,
invoice: &VendorInvoice,
gr: &GoodsReceipt,
) -> Option<DocumentFlowAnomalyResult>
pub fn create_early_invoice_anomaly( &mut self, invoice: &VendorInvoice, gr: &GoodsReceipt, ) -> Option<DocumentFlowAnomalyResult>
Mark a goods receipt as having invoice timing anomaly.
Returns a result indicating invoice came before goods receipt.
Check for potential unauthorized payment (payment without proper invoice).
Sourcepub fn get_statistics(&self) -> DocumentFlowAnomalyStats
pub fn get_statistics(&self) -> DocumentFlowAnomalyStats
Get statistics about injected anomalies.
Auto Trait Implementations§
impl Freeze for DocumentFlowAnomalyInjector
impl RefUnwindSafe for DocumentFlowAnomalyInjector
impl Send for DocumentFlowAnomalyInjector
impl Sync for DocumentFlowAnomalyInjector
impl Unpin for DocumentFlowAnomalyInjector
impl UnwindSafe for DocumentFlowAnomalyInjector
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