pub struct DocumentReference {
pub reference_id: Uuid,
pub source_doc_type: DocumentType,
pub source_doc_id: String,
pub target_doc_type: DocumentType,
pub target_doc_id: String,
pub reference_type: ReferenceType,
pub company_code: String,
pub reference_date: NaiveDate,
pub description: Option<String>,
pub reference_amount: Option<Decimal>,
}Expand description
Reference between two documents.
Fields§
§reference_id: UuidReference ID
source_doc_type: DocumentTypeSource document type
source_doc_id: StringSource document ID
target_doc_type: DocumentTypeTarget document type
target_doc_id: StringTarget document ID
reference_type: ReferenceTypeType of reference relationship
company_code: StringCompany code
reference_date: NaiveDateDate the reference was created
description: Option<String>Description/notes
reference_amount: Option<Decimal>Amount covered by this reference (for partial references)
Implementations§
Source§impl DocumentReference
impl DocumentReference
Sourcepub fn new(
source_type: DocumentType,
source_id: impl Into<String>,
target_type: DocumentType,
target_id: impl Into<String>,
ref_type: ReferenceType,
company_code: impl Into<String>,
date: NaiveDate,
) -> Self
pub fn new( source_type: DocumentType, source_id: impl Into<String>, target_type: DocumentType, target_id: impl Into<String>, ref_type: ReferenceType, company_code: impl Into<String>, date: NaiveDate, ) -> Self
Create a new document reference.
Sourcepub fn follow_on(
source_type: DocumentType,
source_id: impl Into<String>,
target_type: DocumentType,
target_id: impl Into<String>,
company_code: impl Into<String>,
date: NaiveDate,
) -> Self
pub fn follow_on( source_type: DocumentType, source_id: impl Into<String>, target_type: DocumentType, target_id: impl Into<String>, company_code: impl Into<String>, date: NaiveDate, ) -> Self
Create a follow-on reference.
Sourcepub fn payment(
invoice_type: DocumentType,
invoice_id: impl Into<String>,
payment_id: impl Into<String>,
company_code: impl Into<String>,
date: NaiveDate,
amount: Decimal,
) -> Self
pub fn payment( invoice_type: DocumentType, invoice_id: impl Into<String>, payment_id: impl Into<String>, company_code: impl Into<String>, date: NaiveDate, amount: Decimal, ) -> Self
Create a payment reference.
Sourcepub fn with_description(self, desc: impl Into<String>) -> Self
pub fn with_description(self, desc: impl Into<String>) -> Self
Set description.
Sourcepub fn with_amount(self, amount: Decimal) -> Self
pub fn with_amount(self, amount: Decimal) -> Self
Set reference amount.
Trait Implementations§
Source§impl Clone for DocumentReference
impl Clone for DocumentReference
Source§fn clone(&self) -> DocumentReference
fn clone(&self) -> DocumentReference
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 DocumentReference
impl Debug for DocumentReference
Source§impl<'de> Deserialize<'de> for DocumentReference
impl<'de> Deserialize<'de> for DocumentReference
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 DocumentReference
impl RefUnwindSafe for DocumentReference
impl Send for DocumentReference
impl Sync for DocumentReference
impl Unpin for DocumentReference
impl UnwindSafe for DocumentReference
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