pub struct ChartOfAccounts {
pub coa_id: String,
pub name: String,
pub country: String,
pub industry: IndustrySector,
pub accounts: Vec<GLAccount>,
pub complexity: CoAComplexity,
pub account_format: String,
pub accounting_framework: Option<String>,
/* private fields */
}Expand description
Complete Chart of Accounts structure.
Contains all GL accounts for an entity along with metadata about the overall structure.
Fields§
§coa_id: StringUnique identifier for this CoA
name: StringName/description
country: StringCountry/region code
industry: IndustrySectorIndustry sector this CoA is designed for
accounts: Vec<GLAccount>All accounts in this CoA
complexity: CoAComplexityComplexity level
account_format: StringAccount number format (e.g., “######” for 6 digits)
accounting_framework: Option<String>v4.4.1+ accounting framework for this CoA — “us_gaap”, “ifrs”,
“french_gaap”, “german_gaap”, or “dual_reporting”. Populated by
the orchestrator from config.accounting_standards.framework
when accounting_standards.enabled = true; None otherwise.
SDK consumers previously reported this field as null across
the board — before v4.4.1 it simply didn’t exist.
Implementations§
Source§impl ChartOfAccounts
impl ChartOfAccounts
Sourcepub fn new(
coa_id: String,
name: String,
country: String,
industry: IndustrySector,
complexity: CoAComplexity,
) -> Self
pub fn new( coa_id: String, name: String, country: String, industry: IndustrySector, complexity: CoAComplexity, ) -> Self
Create a new empty Chart of Accounts.
Sourcepub fn with_accounting_framework(self, framework: impl Into<String>) -> Self
pub fn with_accounting_framework(self, framework: impl Into<String>) -> Self
v4.4.1+ builder for the accounting framework label (e.g.
"us_gaap", "ifrs"). Typically invoked by the orchestrator
from the parsed AccountingFrameworkConfig.
Sourcepub fn add_account(&mut self, account: GLAccount)
pub fn add_account(&mut self, account: GLAccount)
Add an account to the CoA.
Sourcepub fn rebuild_index(&mut self)
pub fn rebuild_index(&mut self)
Rebuild the account index (call after deserialization).
Sourcepub fn get_account(&self, account_number: &str) -> Option<&GLAccount>
pub fn get_account(&self, account_number: &str) -> Option<&GLAccount>
Get an account by number.
Sourcepub fn get_postable_accounts(&self) -> Vec<&GLAccount>
pub fn get_postable_accounts(&self) -> Vec<&GLAccount>
Get all postable accounts.
Sourcepub fn get_accounts_by_type(&self, account_type: AccountType) -> Vec<&GLAccount>
pub fn get_accounts_by_type(&self, account_type: AccountType) -> Vec<&GLAccount>
Get all accounts of a specific type.
Sourcepub fn get_accounts_by_sub_type(
&self,
sub_type: AccountSubType,
) -> Vec<&GLAccount>
pub fn get_accounts_by_sub_type( &self, sub_type: AccountSubType, ) -> Vec<&GLAccount>
Get all accounts of a specific sub-type.
Sourcepub fn get_suspense_accounts(&self) -> Vec<&GLAccount>
pub fn get_suspense_accounts(&self) -> Vec<&GLAccount>
Get suspense/clearing accounts.
Sourcepub fn get_industry_weighted_accounts(
&self,
account_type: AccountType,
) -> Vec<(&GLAccount, f64)>
pub fn get_industry_weighted_accounts( &self, account_type: AccountType, ) -> Vec<(&GLAccount, f64)>
Get accounts weighted by industry relevance.
Sourcepub fn account_count(&self) -> usize
pub fn account_count(&self) -> usize
Get total account count.
Sourcepub fn postable_count(&self) -> usize
pub fn postable_count(&self) -> usize
Get count of postable accounts.
Trait Implementations§
Source§impl Clone for ChartOfAccounts
impl Clone for ChartOfAccounts
Source§fn clone(&self) -> ChartOfAccounts
fn clone(&self) -> ChartOfAccounts
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more