pub struct PayrollGenerator { /* private fields */ }Expand description
Generates PayrollRun and PayrollLineItem records from employee data.
Implementations§
Source§impl PayrollGenerator
impl PayrollGenerator
Sourcepub fn with_config(seed: u64, config: PayrollConfig) -> Self
pub fn with_config(seed: u64, config: PayrollConfig) -> Self
Create a payroll generator with custom configuration.
Sourcepub fn generate(
&mut self,
company_code: &str,
employees: &[(String, Decimal, Option<String>, Option<String>)],
period_start: NaiveDate,
period_end: NaiveDate,
currency: &str,
) -> (PayrollRun, Vec<PayrollLineItem>)
pub fn generate( &mut self, company_code: &str, employees: &[(String, Decimal, Option<String>, Option<String>)], period_start: NaiveDate, period_end: NaiveDate, currency: &str, ) -> (PayrollRun, Vec<PayrollLineItem>)
Generate a payroll run and line items for the given employees and period.
§Arguments
company_code- Company code owning the payrollemployees- Slice of (employee_id, base_salary, cost_center, department)period_start- Start of the pay period (inclusive)period_end- End of the pay period (inclusive)currency- ISO 4217 currency code
Auto Trait Implementations§
impl !Freeze for PayrollGenerator
impl RefUnwindSafe for PayrollGenerator
impl Send for PayrollGenerator
impl Sync for PayrollGenerator
impl Unpin for PayrollGenerator
impl UnwindSafe for PayrollGenerator
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