From f9610712658e4fec2510db7784cb07219275b98d Mon Sep 17 00:00:00 2001 From: Mathis Kral Date: Tue, 9 Jan 2024 09:01:11 +0100 Subject: [PATCH] Add employee query to order controller This was simply forgotten before cross-testing. --- src/main/java/catering/order/OrderController.java | 6 +++++- src/main/resources/templates/event.html | 2 -- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/catering/order/OrderController.java b/src/main/java/catering/order/OrderController.java index ea27407..b33107f 100644 --- a/src/main/java/catering/order/OrderController.java +++ b/src/main/java/catering/order/OrderController.java @@ -6,6 +6,7 @@ import catering.catalog.CateringCatalog; import catering.catalog.Consumable; import catering.catalog.Rentable; import catering.staff.Employee; +import catering.staff.JobType; import catering.staff.StaffManagement; import org.salespointframework.catalog.Product; import org.salespointframework.inventory.UniqueInventory; @@ -28,6 +29,7 @@ import java.time.temporal.ChronoUnit; import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; +import java.util.stream.Stream; @Controller @@ -125,7 +127,9 @@ public class OrderController { inventory, customOrderRepository)))); - model.addAttribute("allStaff", staffManagement.findAll().stream().toList()); + model.addAttribute("allStaff", Stream.concat( + staffManagement.getAvailableStaffByJob(JobType.COOK, cart.getStart(), cart.getFinish()).stream(), + staffManagement.getAvailableStaffByJob(JobType.SERVICE, cart.getStart(), cart.getFinish()).stream()).toList()); model.addAttribute("duration", cart.getDurationInHours()); diff --git a/src/main/resources/templates/event.html b/src/main/resources/templates/event.html index 034e3fa..6cf028c 100644 --- a/src/main/resources/templates/event.html +++ b/src/main/resources/templates/event.html @@ -139,14 +139,12 @@ SPDX-FileCopyrightText: 2023 swt23w23 Name Typ Stundensatz - Verfügbar -