package catering.order; import org.aspectj.weaver.ast.Or; import org.salespointframework.quantity.Quantity; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.Map; /** * This class is only used for the prototype to avoid using the bloated Salespoint API */ public class CustomOrder { private OrderType orderType; private LocalDateTime start; private LocalDateTime finish; private Map products; private boolean invoiceAvailable; private double totalCost; // this is in € private DateTimeFormatter formatter; public CustomOrder(OrderType orderType, LocalDateTime start, LocalDateTime finish, Map products, boolean invoiceAvailable, double totalCost) { this.orderType = orderType; this.start = start; this.finish = finish; this.products = products; this.invoiceAvailable = invoiceAvailable; this.totalCost = totalCost; this.formatter = DateTimeFormatter.ofPattern("MM.dd.yyy, HH:mm 'Uhr'"); } public OrderType getOrderType() { return orderType; } public LocalDateTime getStart() { return start; } public String getFormattedStart() { return start.format(formatter); } public LocalDateTime getFinish() { return finish; } public String getFormattedFinish() { return finish.format(formatter); } public Map getProducts() { return products; } public boolean invoiceAvailable() { return invoiceAvailable; } public double getTotalCost() { return totalCost; } enum OrderType { RENT_A_COOK, EVENT_CATERING, SUSHI_NIGHT, SOMETHING_ELSE } }