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")
|
@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);
|
||||||
|
|
Loading…
Reference in a new issue