public class Menu {
private Long id;
private String name;
private long storeId;
private long price;
private boolean orderable;
private List<OptionGroup> optionGroups;
private Menu(String name, long storeId, long price, boolean orderable, OptionGroup... optionGroups) {
this.name = name;
this.storeId = storeId;
this.price = price;
this.orderable = orderable;
this.optionGroups = Arrays.asList(optionGroups);
}
/** 주문 가능하게 설정 */
public void changeOrderable(long storeId) {
orderable = true;
}
/** 주문 불가능하게 설정 */
public void changeUnorderable(long storeId) {
orderable = false;
}
}
public class OptionGroup {
private Long id;
private String name;
private long price;
private boolean isRequired;
private Integer limitQuantity; // null is unlimited
private List<OptionItem> OptionItems;
}
public class OptionItem {
private Long id;
private String name;
private long price;
}