pub struct TimeEntryGenerator { /* private fields */ }Expand description
Generates TimeEntry records for employees across business days in a period.
Implementations§
Source§impl TimeEntryGenerator
impl TimeEntryGenerator
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 time entries include the employee name for graph export convenience.
Sourcepub fn generate(
&mut self,
employee_ids: &[String],
period_start: NaiveDate,
period_end: NaiveDate,
config: &TimeAttendanceConfig,
) -> Vec<TimeEntry>
pub fn generate( &mut self, employee_ids: &[String], period_start: NaiveDate, period_end: NaiveDate, config: &TimeAttendanceConfig, ) -> Vec<TimeEntry>
Generate time entries for a set of employees over a date range.
§Arguments
employee_ids- Slice of employee identifiersperiod_start- Start of the period (inclusive)period_end- End of the period (inclusive)config- Time and attendance configuration
Auto Trait Implementations§
impl !Freeze for TimeEntryGenerator
impl RefUnwindSafe for TimeEntryGenerator
impl Send for TimeEntryGenerator
impl Sync for TimeEntryGenerator
impl Unpin for TimeEntryGenerator
impl UnsafeUnpin for TimeEntryGenerator
impl UnwindSafe for TimeEntryGenerator
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
Mutably borrows from an owned value. Read more