package com.bonus.core.menu.dto;

import cn.hutool.core.util.ObjectUtil;
import com.bonus.core.menu.constant.MenuEvaluaOrderTypeEnum;
import com.bonus.core.order.common.constants.OrderTypeEnum;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;

public class MenuEvaluaOrderAddDTO implements Serializable {
   @ApiModelProperty("订单编号")
   private @NotNull(
   message = "{menu_ord_id_null}"
) Long ordId;
   private Integer orderType;
   @ApiModelProperty("描述")
   private String description;
   @ApiModelProperty("评价图片")
   private List<String> pictureList;
   @ApiModelProperty("订单详情")
   private @Size(
   min = 1,
   message = "{menu_ord_detail_null}"
) List<MenuEvaluaDetailAddDTO> detailList;
   @ApiModelProperty("档口或店铺id")
   private @NotNull(
   message = "{menu_stall_id_null}"
) Long shopstallId;
   private Integer orderEvaluaType;

   public Integer getOrderEvaluaType() {
      if (ObjectUtil.isNotEmpty(this.orderEvaluaType)) {
         return this.orderEvaluaType;
      } else {
         return OrderTypeEnum.isShopCategory(this.orderType) ? MenuEvaluaOrderTypeEnum.SUPERMARKET_ORDER.key() : MenuEvaluaOrderTypeEnum.CANTEEN_ORDER.key();
      }
   }

   public Long getOrdId() {
      return this.ordId;
   }

   public Integer getOrderType() {
      return this.orderType;
   }

   public String getDescription() {
      return this.description;
   }

   public List<String> getPictureList() {
      return this.pictureList;
   }

   public List<MenuEvaluaDetailAddDTO> getDetailList() {
      return this.detailList;
   }

   public Long getShopstallId() {
      return this.shopstallId;
   }

   public void setOrdId(final Long ordId) {
      this.ordId = ordId;
   }

   public void setOrderType(final Integer orderType) {
      this.orderType = orderType;
   }

   public void setDescription(final String description) {
      this.description = description;
   }

   public void setPictureList(final List<String> pictureList) {
      this.pictureList = pictureList;
   }

   public void setDetailList(final List<MenuEvaluaDetailAddDTO> detailList) {
      this.detailList = detailList;
   }

   public void setShopstallId(final Long shopstallId) {
      this.shopstallId = shopstallId;
   }

   public void setOrderEvaluaType(final Integer orderEvaluaType) {
      this.orderEvaluaType = orderEvaluaType;
   }
}
