Skip to content

Commit

Permalink
#372 ensure business rules captured in TimereportService are used
Browse files Browse the repository at this point in the history
  • Loading branch information
KlausRicharz committed Jul 4, 2024
1 parent 8014de9 commit 9dc9b7e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.tb.dailyreport.persistence.TimereportDAO;
import org.tb.dailyreport.domain.Workingday;
import org.tb.dailyreport.persistence.WorkingdayDAO;
import org.tb.dailyreport.service.TimereportService;
import org.tb.dailyreport.viewhelper.TimereportHelper;
import org.tb.employee.domain.Employeecontract;
import org.tb.employee.persistence.EmployeecontractDAO;
Expand All @@ -39,6 +40,7 @@ public class DeleteTimereportFromDailyDisplayAction extends DailyReportAction<Sh
private final EmployeeorderDAO employeeorderDAO;
private final WorkingdayDAO workingdayDAO;
private final TimereportHelper timereportHelper;
private final TimereportService timereportService;

@Override
public ActionForward executeAuthenticated(ActionMapping mapping, ShowDailyReportForm form, HttpServletRequest request, HttpServletResponse response) throws IOException {
Expand All @@ -53,7 +55,7 @@ public ActionForward executeAuthenticated(ActionMapping mapping, ShowDailyReport
return mapping.getInputForward();
}

if (!timereportDAO.deleteTimereportById(trId)) {
if (!timereportService.deleteTimereport(trId, authorizedUser)) {
return mapping.findForward("error");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,6 @@ public void deleteBooking(@RequestBody DailyReportData report) {
throw new ResponseStatusException(UNAUTHORIZED);
}

if (report.getId() != -1) {
timereportDAO.deleteTimereportById(report.getId());
}
timereportService.deleteTimereport(report.getId(), authorizedUser);
}
}

0 comments on commit 9dc9b7e

Please sign in to comment.