rattail.employment

Employment Handler

class rattail.employment.EmploymentHandler(config, **kwargs)[source]

Base class and default implementation for employment handlers.

begin_employment(person, start_date, **kwargs)[source]

Begin employment for the given person.

end_employment(employee, end_date, **kwargs)[source]

End employment for the given employee.

ensure_employee(person)[source]

Returns the employee record associated with the given person, creating it first if necessary.

get_context_employee(employee)[source]

Return a dict of context data for the given employee.

get_employee(obj)[source]

Returns the Employee associated with the given object, if any.

make_employee(person)[source]

Create and return a new employee record.

make_employee_history(employee, start_date)[source]

Create and return a new employee history record.

why_not_begin_employment(person)[source]

Inspect the given person and if they should not be made a current employee for any reason, return that reason as text. If it’s okay for the person to be made an employee, returns None.

why_not_end_employment(person)[source]

Inspect the given person and if their current employment should not be ended for any reason, return that reason as text. If it’s okay for the person to stop being an employee, returns None.

rattail.employment.get_employment_handler(config, **kwargs)[source]

Create and return the configured EmploymentHandler instance.