pub struct ApprovalChain {
pub thresholds: Vec<ApprovalThreshold>,
pub auto_approve_threshold: Decimal,
}Expand description
Approval chain configuration with amount thresholds.
Fields§
§thresholds: Vec<ApprovalThreshold>Thresholds in ascending order
auto_approve_threshold: DecimalAuto-approve threshold (below this amount, no approval needed)
Implementations§
Source§impl ApprovalChain
impl ApprovalChain
Sourcepub fn required_level(&self, amount: Decimal) -> u8
pub fn required_level(&self, amount: Decimal) -> u8
Determine the required approval level for an amount.
Sourcepub fn required_personas(&self, amount: Decimal) -> Vec<UserPersona>
pub fn required_personas(&self, amount: Decimal) -> Vec<UserPersona>
Get the required personas for a given amount.
Sourcepub fn is_auto_approve(&self, amount: Decimal) -> bool
pub fn is_auto_approve(&self, amount: Decimal) -> bool
Check if an amount qualifies for auto-approval.
Trait Implementations§
Source§impl Clone for ApprovalChain
impl Clone for ApprovalChain
Source§fn clone(&self) -> ApprovalChain
fn clone(&self) -> ApprovalChain
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 moreSource§impl Debug for ApprovalChain
impl Debug for ApprovalChain
Auto Trait Implementations§
impl Freeze for ApprovalChain
impl RefUnwindSafe for ApprovalChain
impl Send for ApprovalChain
impl Sync for ApprovalChain
impl Unpin for ApprovalChain
impl UnwindSafe for ApprovalChain
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