diff --git a/prototype/src/main/java/org/hso/ecommerce/controller/intern/customers/CustomersIndexController.java b/prototype/src/main/java/org/hso/ecommerce/controller/intern/customers/CustomersIndexController.java index cf13ae4..72d2893 100644 --- a/prototype/src/main/java/org/hso/ecommerce/controller/intern/customers/CustomersIndexController.java +++ b/prototype/src/main/java/org/hso/ecommerce/controller/intern/customers/CustomersIndexController.java @@ -34,6 +34,12 @@ public class CustomersIndexController { @Autowired private final CustomerOrderRepository customerOrderRepository = null; + @Autowired + private final BookingRepository bookingRepository = null; + + @Autowired + private AccountingController accountingController = null; + @GetMapping("") public String internCustomers(Model model) { @@ -60,7 +66,12 @@ public class CustomersIndexController { List orders = customerOrderRepository.getOrdersByUserId(id); model.addAttribute("orders", orders); - //TODO: Booking!!!!!!!!!!!! + List bookings = bookingRepository.customerBookingsReverseChronologically(id); + ShortTemplateBookingResult result = accountingController.buildShortTemplate( + bookings, + account -> account.userAccount != null && account.userAccount.id == id); + model.addAttribute("balance", result.balance); + model.addAttribute("bookings", result.bookings); return "intern/customers/id"; } diff --git a/prototype/src/main/resources/templates/intern/customers/id.html b/prototype/src/main/resources/templates/intern/customers/id.html index e8aa609..30962fc 100644 --- a/prototype/src/main/resources/templates/intern/customers/id.html +++ b/prototype/src/main/resources/templates/intern/customers/id.html @@ -106,10 +106,8 @@

- -

Bestellungen

@@ -129,6 +127,7 @@

+

Buchungen

Kontostand