pub struct EmployeeGenerator { /* private fields */ }Expand description
Generator for employee master data with org hierarchy.
Implementations§
Source§impl EmployeeGenerator
impl EmployeeGenerator
Sourcepub fn with_config(seed: u64, config: EmployeeGeneratorConfig) -> Self
pub fn with_config(seed: u64, config: EmployeeGeneratorConfig) -> Self
Create a new employee generator with custom configuration.
Sourcepub fn set_country_pack(&mut self, pack: CountryPack)
pub fn set_country_pack(&mut self, pack: CountryPack)
Set the country pack for locale-aware generation.
When set, the generator can use locale-specific names and business rules from the country pack. Currently the pack is stored for future expansion; existing behaviour is unchanged when no pack is provided.
Sourcepub fn generate_employee(
&mut self,
company_code: &str,
department: &DepartmentDefinition,
hire_date: NaiveDate,
) -> Employee
pub fn generate_employee( &mut self, company_code: &str, department: &DepartmentDefinition, hire_date: NaiveDate, ) -> Employee
Generate a single employee.
Sourcepub fn generate_employee_with_level(
&mut self,
company_code: &str,
department: &DepartmentDefinition,
job_level: JobLevel,
hire_date: NaiveDate,
) -> Employee
pub fn generate_employee_with_level( &mut self, company_code: &str, department: &DepartmentDefinition, job_level: JobLevel, hire_date: NaiveDate, ) -> Employee
Generate an employee with specific job level.
Sourcepub fn generate_department_pool(
&mut self,
company_code: &str,
department: &DepartmentDefinition,
hire_date_range: (NaiveDate, NaiveDate),
) -> EmployeePool
pub fn generate_department_pool( &mut self, company_code: &str, department: &DepartmentDefinition, hire_date_range: (NaiveDate, NaiveDate), ) -> EmployeePool
Generate an employee pool for a department.
Sourcepub fn generate_company_pool(
&mut self,
company_code: &str,
hire_date_range: (NaiveDate, NaiveDate),
) -> EmployeePool
pub fn generate_company_pool( &mut self, company_code: &str, hire_date_range: (NaiveDate, NaiveDate), ) -> EmployeePool
Generate a full company employee pool with hierarchy.
Sourcepub fn generate_change_history(
&mut self,
employee: &Employee,
period_end: NaiveDate,
) -> Vec<EmployeeChangeEvent>
pub fn generate_change_history( &mut self, employee: &Employee, period_end: NaiveDate, ) -> Vec<EmployeeChangeEvent>
Generate 2-5 change history events for a single employee.
Always starts with a Hired event on hire_date. Up to 4 subsequent
events (promotions, salary adjustments, or transfers) are spread
uniformly over the employee’s tenure, ending with a Terminated event
for terminated employees.
Sourcepub fn generate_all_change_history(
&mut self,
pool: &EmployeePool,
period_end: NaiveDate,
) -> Vec<EmployeeChangeEvent>
pub fn generate_all_change_history( &mut self, pool: &EmployeePool, period_end: NaiveDate, ) -> Vec<EmployeeChangeEvent>
Generate change history for all employees in a pool.