package com.bonus.canteen.core.order.mobile.dto;

import com.bonus.common.houqin.constant.LeConstants;
import com.fasterxml.jackson.databind.JsonNode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.Valid;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.util.List;

@ApiModel("预订餐总订单DTO")
public class OrderReserveMealTotalDTO implements OrderMobilePayParam {
   private Integer ifTrial;
   @ApiModelProperty("支付方式 支付宝、微信等")
   private @NotNull(
   message = "支付类型不能为空"
) Integer payType;
   @ApiModelProperty("优惠券id")
   private String couponId;
   @ApiModelProperty("支付密码")
   private String payPassword;
   @ApiModelProperty("总订单金额 单位分")
   private @NotNull(
   message = "总订单金额不能为空"
) @DecimalMin(
   value = "0",
   message = "总订单金额不能小于0"
) BigDecimal amount;
   @ApiModelProperty("人员id")
   private Long custId;
   @ApiModelProperty("扩展字段")
   private JsonNode extParam;
   @ApiModelProperty("预订餐订单信息list")
   private @NotNull(
   message = "预订餐订单信息不能为空"
) @Size(
   min = 1,
   max = 200,
   message = "最少1笔最多200笔订单"
) List<@Valid OrderReserveMealDTO> reserveMealList;

   public OrderReserveMealTotalDTO() {
      this.ifTrial = LeConstants.COMMON_NO;
   }

   public Integer getIfTrial() {
      return this.ifTrial;
   }

   public Integer getPayType() {
      return this.payType;
   }

   public String getCouponId() {
      return this.couponId;
   }

   public String getPayPassword() {
      return this.payPassword;
   }

   public BigDecimal getAmount() {
      return this.amount;
   }

   public Long getCustId() {
      return this.custId;
   }

   public JsonNode getExtParam() {
      return this.extParam;
   }

   public List<@Valid OrderReserveMealDTO> getReserveMealList() {
      return this.reserveMealList;
   }

   public void setIfTrial(final Integer ifTrial) {
      this.ifTrial = ifTrial;
   }

   public void setPayType(final Integer payType) {
      this.payType = payType;
   }

   public void setCouponId(final String couponId) {
      this.couponId = couponId;
   }

   public void setPayPassword(final String payPassword) {
      this.payPassword = payPassword;
   }

   public void setAmount(final BigDecimal amount) {
      this.amount = amount;
   }

   public void setCustId(final Long custId) {
      this.custId = custId;
   }

   public void setExtParam(final JsonNode extParam) {
      this.extParam = extParam;
   }

   public void setReserveMealList(final List<@Valid OrderReserveMealDTO> reserveMealList) {
      this.reserveMealList = reserveMealList;
   }

}
