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_template_provider(&mut self, provider: SharedTemplateProvider)
pub fn set_template_provider(&mut self, provider: SharedTemplateProvider)
Set a template provider so user-supplied department names override the factory defaults. (v3.2.1+)
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.
Auto Trait Implementations§
impl !RefUnwindSafe for EmployeeGenerator
impl !UnwindSafe for EmployeeGenerator
impl Freeze for EmployeeGenerator
impl Send for EmployeeGenerator
impl Sync for EmployeeGenerator
impl Unpin for EmployeeGenerator
impl UnsafeUnpin for EmployeeGenerator
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.