pub struct ChartOfAccountsGenerator { /* private fields */ }Expand description
Generator for Chart of Accounts.
Implementations§
Source§impl ChartOfAccountsGenerator
impl ChartOfAccountsGenerator
Sourcepub fn new(
complexity: CoAComplexity,
industry: IndustrySector,
seed: u64,
) -> Self
pub fn new( complexity: CoAComplexity, industry: IndustrySector, seed: u64, ) -> Self
Create a new CoA generator.
Sourcepub fn with_french_pcg(self, use_pcg: bool) -> Self
pub fn with_french_pcg(self, use_pcg: bool) -> Self
Use French GAAP (Plan Comptable Général) account structure.
Deprecated: use with_coa_framework(CoAFramework::FrenchPcg) instead.
Sourcepub fn with_expand_industry_subaccounts(self, expand: bool) -> Self
pub fn with_expand_industry_subaccounts(self, expand: bool) -> Self
v5.7.0 — toggle industry-pack sub-account expansion.
When enabled, canonical accounts that have an entry in the
industry’s pack (e.g. 4000 Product Revenue for manufacturing)
become non-postable control accounts and 2–6 6-digit
sub-accounts are added per parent. Default: off.
Sourcepub fn with_coa_framework(self, framework: CoAFramework) -> Self
pub fn with_coa_framework(self, framework: CoAFramework) -> Self
Set the accounting framework for CoA generation.
Sourcepub fn generate(&mut self) -> ChartOfAccounts
pub fn generate(&mut self) -> ChartOfAccounts
Generate a complete chart of accounts.
Sourcepub fn apply_coa_semantic_prior(
coa: &mut ChartOfAccounts,
prior: &CoaSemanticPrior,
) -> usize
pub fn apply_coa_semantic_prior( coa: &mut ChartOfAccounts, prior: &CoaSemanticPrior, ) -> usize
SP4.2 — Post-process a generated CoA with corpus semantic content.
For each GLAccount in coa whose account_number appears in the
prior, overwrite:
short_descriptionandlong_descriptionwith the real descriptionaccount_class/account_class_namewith the prior’s values (when non-empty)account_sub_class/account_sub_class_namewith the prior’s values
Account numbers not in the prior are left unchanged so the structural consistency expected by downstream generators is preserved.
Returns the number of accounts enriched.
Trait Implementations§
Source§impl Generator for ChartOfAccountsGenerator
impl Generator for ChartOfAccountsGenerator
Source§type Item = ChartOfAccounts
type Item = ChartOfAccounts
Source§type Config = (CoAComplexity, IndustrySector)
type Config = (CoAComplexity, IndustrySector)
Source§fn new(config: Self::Config, seed: u64) -> Self
fn new(config: Self::Config, seed: u64) -> Self
Source§fn generate_one(&mut self) -> Self::Item
fn generate_one(&mut self) -> Self::Item
Source§fn generate_batch(&mut self, count: usize) -> Vec<Self::Item>
fn generate_batch(&mut self, count: usize) -> Vec<Self::Item>
Source§fn generate_iter(&mut self, count: usize) -> GeneratorIterator<'_, Self>where
Self: Sized,
fn generate_iter(&mut self, count: usize) -> GeneratorIterator<'_, Self>where
Self: Sized,
Auto Trait Implementations§
impl Freeze for ChartOfAccountsGenerator
impl RefUnwindSafe for ChartOfAccountsGenerator
impl Send for ChartOfAccountsGenerator
impl Sync for ChartOfAccountsGenerator
impl Unpin for ChartOfAccountsGenerator
impl UnsafeUnpin for ChartOfAccountsGenerator
impl UnwindSafe for ChartOfAccountsGenerator
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> 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.