EmployeeServiceSupport.ktEmployeeService. Marked internal — not accessible outside the fibu package. Contains all the actual logic for querying, validating, inserting, updating, soft-deleting, and undeleteing EmployeeValidSinceAttrDO entries. Also resolves current attribute values (annual leave, weekly hours, status) from the validity-period entries.| Dependency | Role |
|---|---|
BaseDOPersistenceService | Generic CRUD operations (insert, update, markAsDeleted, undelete) with access-check support. |
EmployeeCache | Invalidated after every mutation (setExpired()) to force cache refresh. |
EmployeeDao | Entity lookup and access-check delegation (checkLoggedInUserSelectAccess, checkLoggedInUserInsertAccess, checkLoggedInUserUpdateAccess). |
PfPersistenceService | Direct query execution for ValidSinceAttr lookups and validations. |
findValidSinceAttr(id, expectedType, checkAccess) — Simple entity lookup by ID with optional type validation (throws IllegalArgumentException if type mismatch).selectAllValidSinceAttrs(employee, type, deleted, checkAccess) — Core query: fetches all ValidSinceAttr for an employee, optionally filtered by type and deletion status. Ordered by validSince DESC.selectAnnualLeaveDayEntries() / selectWeeklyWorkingHoursEntries() — Convenience wrappers filtering by ANNUAL_LEAVE or WEEKLY_HOURS type. Available with employeeId or EmployeeDO parameters.getActiveEntry)The getActiveEntry(entries, validAtDate) method solves a key business problem: given a list of ValidSinceAttr entries with validSince dates, find the one that is currently applicable at a given point in time. Algorithm:
validAtDate >= entry.validSince, compare to the best-found-so-far.validSince that is still before/on the reference date.This supports historical lookups — asking "what was the annual leave for employee X on date Y" — which is critical for accurate reporting.
validate)Before insert or update, the system checks if another ValidSinceAttr exists with the same (employee, type, validSince) combination:
FIND_BY_TYPE_AND_DATE named query.FIND_OTHER_BY_TYPE_AND_DATE (excludes current ID).validSince exists, it is returned for re-use rather than throwing. This handles the UX scenario where users can't see deleted entries but try to add a new one that would collide — the system silently undeletes and updates the existing record instead.IllegalArgumentException.insert() — Validates, then either inserts new or undeletes existing (re-use logic). Always expires the employee cache.insertValidSinceAttr() — Convenience factory: creates EmployeeValidSinceAttrDO, sets all fields, and inserts.updateValidSinceAttr() — Complex update with copy semantics: validates, potentially marks existing entry as deleted and undeletes/modifies a previously-deleted one with the target date.markValidSinceAttrAsDeleted() — Validates, then soft-deletes with access check.undeleteValidSinceAttr() — Validates, then undeletes with access check.getEmployeeStatus() — Selects STATUS entries, gets active entry, converts value to EmployeeStatus enum via safeValueOf(). Logs error if unknown status value encountered.getAnnualLeaveDays() — Selects ANNUAL_LEAVE entries, gets active entry, converts to BigDecimal.getWeeklyWorkingHours() — Selects WEEKLY_HOURS entries, gets active entry, converts to BigDecimal.All return null if employee or validAtDate is null (for test compatibility with CallAllPagesTest/Wicket).
868d6abb7 2025 -> 2026 28efde264 Employee: weeklyWorkingHours now as time-dependent attr. eintritt/austritt: timestamp -> date 63081666f Source file headers: 2024-> 2025. 5f9bbfbd3 Fix typos in projectforge-business directory 4ae4f3ea3 Bugfixes while going-live... b5dc26e24 Migration stuff in progress... (all tests of all packages: OK). b0efaddc2 Migration stuff in progress... (all tests of all packages: OK). 6aca64431 Migration stuff in progress... (all tests of all packages: OK).