From 6de96d6805701cd1760b9c2e3e3af9f5855bf456 Mon Sep 17 00:00:00 2001 From: Benjamin Seber Date: Fri, 11 Oct 2024 15:27:51 +0200 Subject: [PATCH] remove obsolete dto attribute --- .../java/de/focusshift/zeiterfassung/report/DetailDayDto.java | 2 -- .../zeiterfassung/report/ReportControllerHelper.java | 3 +-- .../zeiterfassung/report/ReportWeekControllerTest.java | 3 +-- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/de/focusshift/zeiterfassung/report/DetailDayDto.java b/src/main/java/de/focusshift/zeiterfassung/report/DetailDayDto.java index 269e6ca5..9b853592 100644 --- a/src/main/java/de/focusshift/zeiterfassung/report/DetailDayDto.java +++ b/src/main/java/de/focusshift/zeiterfassung/report/DetailDayDto.java @@ -1,6 +1,5 @@ package de.focusshift.zeiterfassung.report; -import java.time.Duration; import java.util.List; record DetailDayDto( @@ -8,7 +7,6 @@ record DetailDayDto( String dayOfWeek, String dayOfWeekFull, String date, - Duration hoursWorked, /* todo remove maybe? */ String workedWorkingHours, String shouldWorkingHours, String hoursDelta, diff --git a/src/main/java/de/focusshift/zeiterfassung/report/ReportControllerHelper.java b/src/main/java/de/focusshift/zeiterfassung/report/ReportControllerHelper.java index a9bb52fb..7341bd5d 100644 --- a/src/main/java/de/focusshift/zeiterfassung/report/ReportControllerHelper.java +++ b/src/main/java/de/focusshift/zeiterfassung/report/ReportControllerHelper.java @@ -158,7 +158,6 @@ private DetailDayDto toDetailDayReportDto(ReportDay reportDay, boolean different final String dayOfWeekNarrow = dateFormatter.formatDayOfWeekNarrow(reportDay.date().getDayOfWeek()); final String dayOfWeekFull = dateFormatter.formatDayOfWeekFull(reportDay.date().getDayOfWeek()); final String dateString = dateFormatter.formatDate(reportDay.date()); - final Duration hoursWorked = reportDay.workDuration().duration(); final List dayEntryDtos = reportDay.reportDayEntries().stream().map(this::toDetailDayEntryDto).toList(); final List detailDayAbsenceDto = reportDay.detailDayAbsencesByUser().values().stream() @@ -174,7 +173,7 @@ private DetailDayDto toDetailDayReportDto(ReportDay reportDay, boolean different final Duration deltaDuration = workDuration.duration().minus(shouldWorkingHours.duration()); final String deltaHours = durationToTimeString(deltaDuration); - return new DetailDayDto(differentMonth, dayOfWeekNarrow, dayOfWeekFull, dateString, hoursWorked, workedWorkingHoursString, shouldWorkingHoursString, deltaHours, deltaDuration.isNegative(), dayEntryDtos, detailDayAbsenceDto); + return new DetailDayDto(differentMonth, dayOfWeekNarrow, dayOfWeekFull, dateString, workedWorkingHoursString, shouldWorkingHoursString, deltaHours, deltaDuration.isNegative(), dayEntryDtos, detailDayAbsenceDto); } private DetailDayEntryDto toDetailDayEntryDto(ReportDayEntry reportDayEntry) { diff --git a/src/test/java/de/focusshift/zeiterfassung/report/ReportWeekControllerTest.java b/src/test/java/de/focusshift/zeiterfassung/report/ReportWeekControllerTest.java index 41900028..081f718e 100644 --- a/src/test/java/de/focusshift/zeiterfassung/report/ReportWeekControllerTest.java +++ b/src/test/java/de/focusshift/zeiterfassung/report/ReportWeekControllerTest.java @@ -23,7 +23,6 @@ import org.threeten.extra.YearWeek; import java.time.Clock; -import java.time.Duration; import java.time.LocalDate; import java.time.LocalTime; import java.time.Year; @@ -180,7 +179,7 @@ void ensureReportWeekWithAbsences() throws Exception { Date.from(ZonedDateTime.of(LocalDate.of(2023, 2,5), LocalTime.MIN, ZoneId.systemDefault()).toInstant()), 5, List.of( - new DetailDayDto(true, "F", "Freitag", "03.02.2023", Duration.ZERO, "00:00", "00:00", "00:00", false, List.of(), + new DetailDayDto(true, "F", "Freitag", "03.02.2023", "00:00", "00:00", "00:00", false, List.of(), List.of( new DetailDayAbsenceDto( "Bruce Wayne",