Add improved checkout

This commit is contained in:
Mathis Kral 2023-11-14 20:43:15 +01:00 committed by Simon Bruder
parent b3d93685c3
commit c7c8a0126a
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC

View file

@ -69,13 +69,15 @@ public class OrderController {
@PostMapping("/event/checkout")
public String checkout(Model model) {
LocalDateTime min = LocalDateTime.of(2023, (int) (Math.random() * 11 + 1.0), (int) (Math.random() * 27 + 1.0), (int) (Math.random() * 23 + 1.0), 0, 0);
CustomOrder myOrder = new CustomOrder(
cart.getOrderType(),
LocalDateTime.MIN,
LocalDateTime.MAX,
min,
min.plusDays((int) (Math.random() * 5)).plusHours((int) (Math.random() * 10)),
cart.getProucts(),
false,
Double.MAX_VALUE
Math.round(Math.random() * 10000)
);
orderRepository.addOrder(myOrder);