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 set_temporal_context(&mut self, ctx: Arc<TemporalContext>)
pub fn set_temporal_context(&mut self, ctx: Arc<TemporalContext>)
Set the shared TemporalContext so business-day collection excludes
holidays (not just weekends) and submitted_at lag days snap forward
to the next business day.
Sourcepub fn with_temporal_context(self, ctx: Arc<TemporalContext>) -> Self
pub fn with_temporal_context(self, ctx: Arc<TemporalContext>) -> Self
Builder variant of Self::set_temporal_context.
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
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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.