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).