pub struct Transaction {
pub tx_type: TxType,
pub date: NaiveDate,
pub value: Money,
pub provider_org: Option<OrgRef>,
pub receiver_org: Option<OrgRef>,
pub currency_hint: Option<CurrencyCode>,
}Expand description
Minimal transaction spine for rollups & FX.
Fields§
§tx_type: TxType§date: NaiveDate§value: Money§provider_org: Option<OrgRef>§receiver_org: Option<OrgRef>§currency_hint: Option<CurrencyCode>optional hint for a resolved currency if caller has done FX lookup
Implementations§
Source§impl Transaction
impl Transaction
pub fn new(tx_type: TxType, date: NaiveDate, value: Money) -> Self
Sourcepub fn with_provider(self, org: OrgRef) -> Self
pub fn with_provider(self, org: OrgRef) -> Self
Set provider organisation (with builder helpers).
Sourcepub fn with_receiver(self, org: OrgRef) -> Self
pub fn with_receiver(self, org: OrgRef) -> Self
Set receiver organisation (with builder helpers).
Sourcepub fn with_currency_hint(self, code: CurrencyCode) -> Self
pub fn with_currency_hint(self, code: CurrencyCode) -> Self
Set a pre-resolved currency hint (builder-style).
Trait Implementations§
Source§impl Clone for Transaction
impl Clone for Transaction
Source§fn clone(&self) -> Transaction
fn clone(&self) -> Transaction
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 Transaction
impl Debug for Transaction
Source§impl<'de> Deserialize<'de> for Transaction
impl<'de> Deserialize<'de> for Transaction
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for Transaction
impl PartialEq for Transaction
Source§impl Serialize for Transaction
impl Serialize for Transaction
impl StructuralPartialEq for Transaction
Auto Trait Implementations§
impl Freeze for Transaction
impl RefUnwindSafe for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl UnwindSafe for Transaction
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