mirror of
https://github.com/st-tu-dresden-praktikum/swt23w23
synced 2024-07-02 18:49:39 +02:00
30 lines
799 B
Java
30 lines
799 B
Java
![]() |
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||
|
// SPDX-FileCopyrightText: 2023-2024 swt23w23
|
||
|
package catering.orderCatalog;
|
||
|
|
||
|
import catering.order.CustomCart;
|
||
|
import catering.order.OrderType;
|
||
|
import org.springframework.context.annotation.Scope;
|
||
|
import org.springframework.context.annotation.ScopedProxyMode;
|
||
|
import org.springframework.stereotype.Service;
|
||
|
|
||
|
import java.time.LocalDateTime;
|
||
|
|
||
|
@Service
|
||
|
@Scope(value = "session", proxyMode = ScopedProxyMode.TARGET_CLASS)
|
||
|
public class CartService {
|
||
|
private CustomCart cart;
|
||
|
|
||
|
public CartService() {
|
||
|
this.cart = new CustomCart(OrderType.EVENT_CATERING, LocalDateTime.now().plusDays(7),
|
||
|
LocalDateTime.now().plusDays(7).plusHours(1));
|
||
|
}
|
||
|
|
||
|
public CustomCart getCart() {
|
||
|
return cart;
|
||
|
}
|
||
|
public void setCart(CustomCart cart) {
|
||
|
this.cart = cart;
|
||
|
}
|
||
|
}
|