swt23w23/src/main/java/catering/orderCatalog/CartService.java
2024-01-19 19:00:51 +01:00

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;
}
}