pub struct ExpenseReportGenerator { /* private fields */ }Expand description
Generates ExpenseReport records for employees over a period.
Implementations§
Source§impl ExpenseReportGenerator
impl ExpenseReportGenerator
Sourcepub fn new(seed: u64) -> Self
pub fn new(seed: u64) -> Self
Create a new expense report generator with default configuration.
Sourcepub fn with_config(seed: u64, config: ExpenseConfig) -> Self
pub fn with_config(seed: u64, config: ExpenseConfig) -> Self
Create an expense report generator with custom configuration.
Sourcepub fn with_pools(
self,
employee_ids: Vec<String>,
cost_center_ids: Vec<String>,
) -> Self
pub fn with_pools( self, employee_ids: Vec<String>, cost_center_ids: Vec<String>, ) -> Self
Set ID pools for cross-reference coherence.
When pools are non-empty, the generator selects approved_by from
employee_ids and cost_center from cost_center_ids instead of
fabricating placeholder IDs.
Sourcepub fn with_employee_names(self, names: HashMap<String, String>) -> Self
pub fn with_employee_names(self, names: HashMap<String, String>) -> Self
Set the employee name mapping for denormalization (DS-011).
Maps employee IDs to their display names so that generated expense reports include the employee name for graph export convenience.
Sourcepub fn generate(
&mut self,
employee_ids: &[String],
period_start: NaiveDate,
period_end: NaiveDate,
config: &ExpenseConfig,
) -> Vec<ExpenseReport>
pub fn generate( &mut self, employee_ids: &[String], period_start: NaiveDate, period_end: NaiveDate, config: &ExpenseConfig, ) -> Vec<ExpenseReport>
Generate expense reports for employees over the given period.
Only config.submission_rate fraction of employees submit reports each
month within the period.
§Arguments
employee_ids- Slice of employee identifiersperiod_start- Start of the period (inclusive)period_end- End of the period (inclusive)config- Expense management configuration
Sourcepub fn generate_with_currency(
&mut self,
employee_ids: &[String],
period_start: NaiveDate,
period_end: NaiveDate,
config: &ExpenseConfig,
currency: &str,
) -> Vec<ExpenseReport>
pub fn generate_with_currency( &mut self, employee_ids: &[String], period_start: NaiveDate, period_end: NaiveDate, config: &ExpenseConfig, currency: &str, ) -> Vec<ExpenseReport>
Generate expense reports with a specific company currency.