Skip to main content

JournalEntryHeader

Struct JournalEntryHeader 

Source
pub struct JournalEntryHeader {
Show 32 fields pub document_id: Uuid, pub company_code: String, pub fiscal_year: u16, pub fiscal_period: u8, pub posting_date: NaiveDate, pub document_date: NaiveDate, pub created_at: DateTime<Utc>, pub document_type: String, pub currency: String, pub exchange_rate: Decimal, pub reference: Option<String>, pub header_text: Option<String>, pub created_by: String, pub user_persona: String, pub source: TransactionSource, pub business_process: Option<BusinessProcess>, pub ledger: String, pub is_fraud: bool, pub fraud_type: Option<FraudType>, pub is_anomaly: bool, pub anomaly_id: Option<String>, pub anomaly_type: Option<String>, pub batch_id: Option<Uuid>, pub control_ids: Vec<String>, pub sox_relevant: bool, pub control_status: ControlStatus, pub sod_violation: bool, pub sod_conflict_type: Option<SodConflictType>, pub approval_workflow: Option<ApprovalWorkflow>, pub ocpm_event_ids: Vec<Uuid>, pub ocpm_object_ids: Vec<Uuid>, pub ocpm_case_id: Option<Uuid>,
}
Expand description

Header information for a journal entry document.

Contains all metadata about the posting including timing, user, and organizational assignment.

Fields§

§document_id: Uuid

Unique identifier for this journal entry (UUID v7 for time-ordering)

§company_code: String

Company code this entry belongs to

§fiscal_year: u16

Fiscal year (4-digit)

§fiscal_period: u8

Fiscal period (1-12, or 13-16 for special periods)

§posting_date: NaiveDate

Posting date (when the entry affects the books)

§document_date: NaiveDate

Document date (date on source document)

§created_at: DateTime<Utc>

Entry timestamp (when created in system)

§document_type: String

Document type code

§currency: String

Transaction currency (ISO 4217)

§exchange_rate: Decimal

Exchange rate to local currency (1.0 if same currency)

§reference: Option<String>

Reference document number (external reference)

§header_text: Option<String>

Header text/description

§created_by: String

User who created the entry

§user_persona: String

User persona classification for behavioral analysis

§source: TransactionSource

Transaction source (manual vs automated)

§business_process: Option<BusinessProcess>

Business process reference

§ledger: String

Ledger (0L = Leading Ledger)

§is_fraud: bool

Is this entry part of a fraud scenario

§fraud_type: Option<FraudType>

Fraud type if applicable

§is_anomaly: bool

Whether this entry has an injected anomaly

§anomaly_id: Option<String>

Unique anomaly identifier for label linkage

§anomaly_type: Option<String>

Type of anomaly if applicable (serialized enum name)

§batch_id: Option<Uuid>

Simulation batch ID for traceability

§control_ids: Vec<String>

Internal control IDs that apply to this transaction

§sox_relevant: bool

Whether this is a SOX-relevant transaction

§control_status: ControlStatus

Control status for this transaction

§sod_violation: bool

Whether a Segregation of Duties violation occurred

§sod_conflict_type: Option<SodConflictType>

Type of SoD conflict if violation occurred

§approval_workflow: Option<ApprovalWorkflow>

Approval workflow for high-value transactions

§ocpm_event_ids: Vec<Uuid>

OCPM event IDs that triggered this journal entry

§ocpm_object_ids: Vec<Uuid>

OCPM object IDs involved in this journal entry

§ocpm_case_id: Option<Uuid>

OCPM case ID for process instance tracking

Implementations§

Source§

impl JournalEntryHeader

Source

pub fn new(company_code: String, posting_date: NaiveDate) -> Self

Create a new journal entry header with default values.

Source

pub fn with_deterministic_id( company_code: String, posting_date: NaiveDate, document_id: Uuid, ) -> Self

Create a new journal entry header with a deterministic document ID.

Used for reproducible generation where the document ID is derived from a seed and counter.

Trait Implementations§

Source§

impl Clone for JournalEntryHeader

Source§

fn clone(&self) -> JournalEntryHeader

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for JournalEntryHeader

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for JournalEntryHeader

Source§

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 Serialize for JournalEntryHeader

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,