mirror of
https://github.com/st-tu-dresden-praktikum/swt23w23
synced 2024-07-19 21:04:36 +02:00
Add improved checkout
This commit is contained in:
parent
0a24be51be
commit
d328eb5e85
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue