Add improved checkout

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

View file

@ -69,13 +69,15 @@ public class OrderController {
@PostMapping("/event/checkout") @PostMapping("/event/checkout")
public String checkout(Model model) { 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( CustomOrder myOrder = new CustomOrder(
cart.getOrderType(), cart.getOrderType(),
LocalDateTime.MIN, min,
LocalDateTime.MAX, min.plusDays((int) (Math.random() * 5)).plusHours((int) (Math.random() * 10)),
cart.getProucts(), cart.getProucts(),
false, false,
Double.MAX_VALUE Math.round(Math.random() * 10000)
); );
orderRepository.addOrder(myOrder); orderRepository.addOrder(myOrder);