pub struct GLAccount {Show 24 fields
pub account_number: String,
pub short_description: String,
pub long_description: String,
pub account_type: AccountType,
pub sub_type: AccountSubType,
pub account_class: String,
pub account_class_name: String,
pub account_sub_class: String,
pub account_sub_class_name: String,
pub account_group: String,
pub is_control_account: bool,
pub is_suspense_account: bool,
pub parent_account: Option<String>,
pub hierarchy_level: u8,
pub normal_debit_balance: bool,
pub is_postable: bool,
pub is_blocked: bool,
pub allowed_doc_types: Vec<String>,
pub requires_cost_center: bool,
pub requires_profit_center: bool,
pub industry_weights: IndustryWeights,
pub typical_frequency: f64,
pub typical_amount_range: (f64, f64),
pub accounting_framework: Option<String>,
}Expand description
Individual GL account definition.
Represents a single account in the chart of accounts with all necessary metadata for realistic transaction generation.
Fields§
§account_number: StringAccount number (e.g., “100000”, “400100”)
short_description: StringShort description
long_description: StringLong description
account_type: AccountTypePrimary account type
sub_type: AccountSubTypeDetailed sub-type classification
account_class: StringISO 21378 (Audit Data Collection) Level-2 account class code
(e.g. "A.B" for Trade Receivables, "X.A" for Cost of Goods
Sold). Derived from sub_type via
crate::iso21378::from_account_sub_type. v5.6.0 schema
change: prior versions populated this with the first digit of
account_number (e.g. "1"); the new value is the descriptive
ISO code consumers can filter / group by directly.
account_class_name: StringISO 21378 Level-2 account class name (e.g. "Trade Receivables", "Cost of Goods Sold"). Added in v5.6.0.
account_sub_class: StringISO 21378 Level-3 account sub-class code (e.g. "A.B.A" for
Trade Accounts Receivable). Added in v5.6.0.
account_sub_class_name: StringISO 21378 Level-3 account sub-class name (e.g. "Trade Accounts Receivable"). Added in v5.6.0.
account_group: StringAccount group for reporting
is_control_account: boolIs this a control account (subledger summary)
is_suspense_account: boolIs this a suspense/clearing account
parent_account: Option<String>Parent account number (for hierarchies)
hierarchy_level: u8Account hierarchy level (1 = top level)
normal_debit_balance: boolNormal balance side (true = debit, false = credit)
is_postable: boolIs posting allowed directly to this account
is_blocked: boolIs this account blocked for posting
allowed_doc_types: Vec<String>Allowed document types for this account
requires_cost_center: boolRequired cost center assignment
requires_profit_center: boolRequired profit center assignment
industry_weights: IndustryWeightsIndustry sector relevance scores (0.0-1.0)
typical_frequency: f64Typical transaction frequency (transactions per month)
typical_amount_range: (f64, f64)Typical transaction amount range (min, max)
accounting_framework: Option<String>Accounting framework this account belongs to (e.g., “us_gaap”,
“french_pcg”, “german_skr04”). Mirrors the parent
ChartOfAccounts::accounting_framework sidecar so per-row
consumers (CSV / parquet readers) can filter by framework
without joining back to coa_meta. Added in v5.0.1.
Implementations§
Source§impl GLAccount
impl GLAccount
Sourcepub fn new(
account_number: String,
description: String,
account_type: AccountType,
sub_type: AccountSubType,
) -> Self
pub fn new( account_number: String, description: String, account_type: AccountType, sub_type: AccountSubType, ) -> Self
Create a new GL account with minimal required fields.
account_class, account_class_name, account_sub_class,
account_sub_class_name are auto-derived from sub_type via
the ISO 21378 mapping in crate::iso21378.
Sourcepub fn account_code(&self) -> &str
pub fn account_code(&self) -> &str
Get account code (alias for account_number).
Sourcepub fn description(&self) -> &str
pub fn description(&self) -> &str
Get description (alias for short_description).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for GLAccount
impl<'de> Deserialize<'de> for GLAccount
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>,
Auto Trait Implementations§
impl Freeze for GLAccount
impl RefUnwindSafe for GLAccount
impl Send for GLAccount
impl Sync for GLAccount
impl Unpin for GLAccount
impl UnsafeUnpin for GLAccount
impl UnwindSafe for GLAccount
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.