pub struct RevenueRecognitionGenerator { /* private fields */ }Expand description
Generator for revenue recognition contracts following ASC 606 / IFRS 15.
Produces realistic CustomerContract instances with performance obligations,
variable consideration, and progress tracking suitable for financial data
generation and audit testing scenarios.
Implementations§
Source§impl RevenueRecognitionGenerator
impl RevenueRecognitionGenerator
Sourcepub fn new(seed: u64) -> Self
pub fn new(seed: u64) -> Self
Create a new generator with default configuration.
§Arguments
seed- Seed for deterministic generation.
Sourcepub fn with_config(seed: u64, _config: &RevenueRecognitionConfig) -> Self
pub fn with_config(seed: u64, _config: &RevenueRecognitionConfig) -> Self
Create a new generator with a custom configuration seed.
This constructor exists for API symmetry with other generators;
the actual per-generation configuration is passed to Self::generate.
§Arguments
seed- Seed for deterministic generation._config- Revenue recognition configuration (used at generate time).
Sourcepub fn generate(
&mut self,
company_code: &str,
customer_ids: &[String],
period_start: NaiveDate,
period_end: NaiveDate,
currency: &str,
config: &RevenueRecognitionConfig,
framework: AccountingFramework,
) -> Vec<CustomerContract>
pub fn generate( &mut self, company_code: &str, customer_ids: &[String], period_start: NaiveDate, period_end: NaiveDate, currency: &str, config: &RevenueRecognitionConfig, framework: AccountingFramework, ) -> Vec<CustomerContract>
Generate a set of customer contracts for the given period.
Produces config.contract_count contracts, each containing one or more
performance obligations with allocated transaction prices and progress
tracking appropriate for the specified accounting framework.
§Arguments
company_code- The company code to associate contracts with.customer_ids- Pool of customer identifiers to draw from.period_start- Start of the generation period.period_end- End of the generation period.currency- ISO currency code (e.g., “USD”).config- Revenue recognition configuration parameters.framework- Accounting framework (US GAAP, IFRS, or Dual).
§Returns
A vector of CustomerContract instances with fully allocated
performance obligations.