pub struct BankGuarantee {
pub id: String,
pub entity_id: String,
pub guarantee_type: GuaranteeType,
pub amount: Decimal,
pub currency: String,
pub beneficiary: String,
pub issuing_bank: String,
pub issue_date: NaiveDate,
pub expiry_date: NaiveDate,
pub status: GuaranteeStatus,
pub linked_contract_id: Option<String>,
pub linked_project_id: Option<String>,
}Expand description
A bank guarantee or letter of credit.
Fields§
§id: StringUnique guarantee identifier
entity_id: StringLegal entity that obtained the guarantee
guarantee_type: GuaranteeTypeType of guarantee
amount: DecimalFace amount of the guarantee
currency: StringDenomination currency
beneficiary: StringParty in whose favour the guarantee is issued
issuing_bank: StringBank that issued the guarantee
issue_date: NaiveDateIssue date
expiry_date: NaiveDateExpiry date
status: GuaranteeStatusCurrent lifecycle status
linked_contract_id: Option<String>Linked procurement contract (if applicable)
linked_project_id: Option<String>Linked project (if applicable)
Implementations§
Source§impl BankGuarantee
impl BankGuarantee
Sourcepub fn new(
id: impl Into<String>,
entity_id: impl Into<String>,
guarantee_type: GuaranteeType,
amount: Decimal,
currency: impl Into<String>,
beneficiary: impl Into<String>,
issuing_bank: impl Into<String>,
issue_date: NaiveDate,
expiry_date: NaiveDate,
) -> Self
pub fn new( id: impl Into<String>, entity_id: impl Into<String>, guarantee_type: GuaranteeType, amount: Decimal, currency: impl Into<String>, beneficiary: impl Into<String>, issuing_bank: impl Into<String>, issue_date: NaiveDate, expiry_date: NaiveDate, ) -> Self
Creates a new bank guarantee.
Sourcepub fn with_status(self, status: GuaranteeStatus) -> Self
pub fn with_status(self, status: GuaranteeStatus) -> Self
Sets the status.
Sourcepub fn with_linked_contract(self, contract_id: impl Into<String>) -> Self
pub fn with_linked_contract(self, contract_id: impl Into<String>) -> Self
Links to a procurement contract.
Sourcepub fn with_linked_project(self, project_id: impl Into<String>) -> Self
pub fn with_linked_project(self, project_id: impl Into<String>) -> Self
Links to a project.
Sourcepub fn is_active_on(&self, date: NaiveDate) -> bool
pub fn is_active_on(&self, date: NaiveDate) -> bool
Returns true if the guarantee is active on the given date.
Sourcepub fn remaining_days(&self, as_of: NaiveDate) -> i64
pub fn remaining_days(&self, as_of: NaiveDate) -> i64
Returns the remaining validity in days from the given date.
Trait Implementations§
Source§impl Clone for BankGuarantee
impl Clone for BankGuarantee
Source§fn clone(&self) -> BankGuarantee
fn clone(&self) -> BankGuarantee
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 BankGuarantee
impl Debug for BankGuarantee
Source§impl<'de> Deserialize<'de> for BankGuarantee
impl<'de> Deserialize<'de> for BankGuarantee
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
Auto Trait Implementations§
impl Freeze for BankGuarantee
impl RefUnwindSafe for BankGuarantee
impl Send for BankGuarantee
impl Sync for BankGuarantee
impl Unpin for BankGuarantee
impl UnsafeUnpin for BankGuarantee
impl UnwindSafe for BankGuarantee
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