pub struct DocumentHeader {Show 19 fields
pub document_id: String,
pub document_type: DocumentType,
pub company_code: String,
pub fiscal_year: u16,
pub fiscal_period: u8,
pub document_date: NaiveDate,
pub posting_date: Option<NaiveDate>,
pub entry_date: NaiveDate,
pub entry_timestamp: NaiveDateTime,
pub status: DocumentStatus,
pub created_by: String,
pub changed_by: Option<String>,
pub changed_at: Option<NaiveDateTime>,
pub created_by_employee_id: Option<String>,
pub currency: String,
pub reference: Option<String>,
pub header_text: Option<String>,
pub journal_entry_id: Option<String>,
pub document_references: Vec<DocumentReference>,
}Expand description
Common document header fields.
Fields§
§document_id: StringUnique document ID
document_type: DocumentTypeDocument type
company_code: StringCompany code
fiscal_year: u16Fiscal year
fiscal_period: u8Fiscal period
document_date: NaiveDateDocument date
posting_date: Option<NaiveDate>Posting date (if applicable)
entry_date: NaiveDateEntry date (when document was created)
entry_timestamp: NaiveDateTimeEntry timestamp
status: DocumentStatusDocument status
created_by: StringCreated by user
changed_by: Option<String>Last changed by user
changed_at: Option<NaiveDateTime>Last change timestamp
created_by_employee_id: Option<String>Employee ID of the creator (bridges user_id ↔ employee_id)
created_by stores the user login (e.g. “JSMITH”) while
employee nodes use employee_id (e.g. “E-001234”). This
field stores the employee_id when it is known at generation
time, allowing the export pipeline to emit
DOC_CREATED_BY edges directly without an expensive lookup.
currency: StringCurrency
reference: Option<String>Reference number (external)
header_text: Option<String>Header text
journal_entry_id: Option<String>Related journal entry ID (if posted to GL)
document_references: Vec<DocumentReference>References to other documents
Implementations§
Source§impl DocumentHeader
impl DocumentHeader
Sourcepub fn new(
document_id: impl Into<String>,
document_type: DocumentType,
company_code: impl Into<String>,
fiscal_year: u16,
fiscal_period: u8,
document_date: NaiveDate,
created_by: impl Into<String>,
) -> Self
pub fn new( document_id: impl Into<String>, document_type: DocumentType, company_code: impl Into<String>, fiscal_year: u16, fiscal_period: u8, document_date: NaiveDate, created_by: impl Into<String>, ) -> Self
Create a new document header.
Sourcepub fn with_created_by_employee_id(self, employee_id: impl Into<String>) -> Self
pub fn with_created_by_employee_id(self, employee_id: impl Into<String>) -> Self
Set the employee ID of the document creator.
Sourcepub fn with_posting_date(self, date: NaiveDate) -> Self
pub fn with_posting_date(self, date: NaiveDate) -> Self
Set posting date.
Sourcepub fn with_currency(self, currency: impl Into<String>) -> Self
pub fn with_currency(self, currency: impl Into<String>) -> Self
Set currency.
Sourcepub fn with_reference(self, reference: impl Into<String>) -> Self
pub fn with_reference(self, reference: impl Into<String>) -> Self
Set reference.
Sourcepub fn with_header_text(self, text: impl Into<String>) -> Self
pub fn with_header_text(self, text: impl Into<String>) -> Self
Set header text.
Sourcepub fn add_reference(&mut self, reference: DocumentReference)
pub fn add_reference(&mut self, reference: DocumentReference)
Add a document reference.
Sourcepub fn update_status(
&mut self,
new_status: DocumentStatus,
user: impl Into<String>,
)
pub fn update_status( &mut self, new_status: DocumentStatus, user: impl Into<String>, )
Update status and record change.
Sourcepub fn generate_id(
doc_type: DocumentType,
company_code: &str,
sequence: u64,
) -> String
pub fn generate_id( doc_type: DocumentType, company_code: &str, sequence: u64, ) -> String
Generate a deterministic document ID.
Trait Implementations§
Source§impl Clone for DocumentHeader
impl Clone for DocumentHeader
Source§fn clone(&self) -> DocumentHeader
fn clone(&self) -> DocumentHeader
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more