EmployeeScriptingService.ktEmployeeService providing read-only access to employee business logic for Groovy/Kotlin scripts. Available in scripts as: employeeService. Exposes time-dependent attribute lookups, active-status checks, employee search, and monthly report generation. This is the newer, preferred scripting interface compared to EmployeeScriptingDao.Every method delegates directly to the underlying EmployeeService instance (constructor-injected as __employeeService). The proxy follows the same pattern as ScriptingDao but wraps a service instead of a DAO — providing business logic rather than just entity access.
| Method | Underlying Service Call | Purpose |
|---|---|---|
getWeeklyWorkingHours(employee) | EmployeeService.getWeeklyWorkingHours(employee) | Weekly hours valid today |
getWeeklyWorkingHours(employee, validAtDate, checkAccess) | EmployeeService.getWeeklyWorkingHours(employee, validAtDate, checkAccess) | Weekly hours at historical date — CRITICAL for scripts needing historical data |
getAnnualLeaveDays(employee) | EmployeeService.getAnnualLeaveDays(employee) | Annual leave valid today |
getAnnualLeaveDays(employee, validAtDate, checkAccess) | EmployeeService.getAnnualLeaveDays(employee, validAtDate, checkAccess) | Annual leave at historical date |
isEmployeeActive(employee, showRecentlyLeavers) | EmployeeService.isEmployeeActive() | Active-status check |
getEmployeeStatus(employee, checkAccess) | EmployeeService.getEmployeeStatus() | Current EmployeeStatus enum |
selectAllActive(checkAccess, showRecentLeft) | EmployeeService.selectAllActive() | All active employees |
findByUserId(userId) | EmployeeService.findByUserId() | Lookup by user ID |
findByStaffnumber(staffnumber) | EmployeeService.findByStaffnumber() | Lookup by staff number (Int and String overloads) |
selectAllValidSinceAttrs(employee, type, deleted, checkAccess) | EmployeeService.selectAllValidSinceAttrs() | All time-dependent attributes with optional filtering |
getReportOfMonth(year, month, user) | EmployeeService.getReportOfMonth() | Monthly employee report with aggregated timesheet data |
Scripts need access to business logic like "get weekly hours for employee at date X" or "is this employee active?" — not just CRUD. This proxy exposes only read-only methods. Scripts should never mutate data through this interface; mutations go through dedicated scripting DAOs.
8d821622d EmployeeScriptingService.getReportOfMonth b589ea0c1 EmployeeScriptingService.kt: selectAllValidSinceAttrs added. 10d4e0aad Add EmployeeScriptingService for script access to employee data