diff --git a/src/main/java/de/focusshift/zeiterfassung/overtime/OvertimeServiceImpl.java b/src/main/java/de/focusshift/zeiterfassung/overtime/OvertimeServiceImpl.java index b5b3fb361..b35271874 100644 --- a/src/main/java/de/focusshift/zeiterfassung/overtime/OvertimeServiceImpl.java +++ b/src/main/java/de/focusshift/zeiterfassung/overtime/OvertimeServiceImpl.java @@ -34,7 +34,8 @@ public Map accumulatedOvertimeToDate(LocalDate da final Map localIdById = userManagementService.findAllUsersByLocalIds(userLocalIds).stream() .collect(toMap(user -> user.id().value(), User::localId)); - final Map> byUserIdValue = overtimeRepository.getWorkDurationsToDate(false, localIdById.keySet(), dateExclusive) + // TODO create overtime snapshots (e.g. every month) so we don't have to read/calculate the whole past... + // workDuration has to be considered with plannedWorkingHours to calculate the overtimeDuration. otherwise it's just... the actual worked hours... final Map> byUserIdValue = overtimeRepository.getWorkDurationsToDate(false, localIdById.keySet(), dateExclusive) .stream() .collect(groupingBy(TimeEntryEntityDurationView::getUserId));