package com.bonus.canteen.core.report.api.dto;

import cn.hutool.core.text.CharSequenceUtil;
import com.bonus.canteen.core.common.page.PageDTO;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotNull;
import java.time.LocalDate;
import java.util.List;

public class DeviceOrderDishesSumQueryDTO extends PageDTO {
   @ApiModelProperty("开始日期 yyyy-MM-dd")
   private @NotNull LocalDate startDate;
   @ApiModelProperty("结束日期")
   private @NotNull LocalDate endDate;
   @ApiModelProperty("下单设备sn")
   private String machineSn;
   @ApiModelProperty("明细提交设备sn")
   private String detailMachineSn;
   @ApiModelProperty("支付状态")
   private List<Integer> payStateList;
   @ApiModelProperty("订单退款状态")
   private List<Integer> orderRefundStateList;
   @ApiModelProperty("订单状态")
   private List<Integer> orderStateList;
   @ApiModelProperty("餐次类型")
   private List<Integer> mealtimeTypeList;

   @JsonIgnore
   public @NotNull(
   message = "{order.locker.no-device-info}"
) String getAvailableMachineSn() {
      return CharSequenceUtil.isNotBlank(this.machineSn) ? this.machineSn : this.detailMachineSn;
   }

   public LocalDate getStartDate() {
      return this.startDate;
   }

   public LocalDate getEndDate() {
      return this.endDate;
   }

   public String getMachineSn() {
      return this.machineSn;
   }

   public String getDetailMachineSn() {
      return this.detailMachineSn;
   }

   public List<Integer> getPayStateList() {
      return this.payStateList;
   }

   public List<Integer> getOrderRefundStateList() {
      return this.orderRefundStateList;
   }

   public List<Integer> getOrderStateList() {
      return this.orderStateList;
   }

   public List<Integer> getMealtimeTypeList() {
      return this.mealtimeTypeList;
   }

   public void setStartDate(final LocalDate startDate) {
      this.startDate = startDate;
   }

   public void setEndDate(final LocalDate endDate) {
      this.endDate = endDate;
   }

   public void setMachineSn(final String machineSn) {
      this.machineSn = machineSn;
   }

   public void setDetailMachineSn(final String detailMachineSn) {
      this.detailMachineSn = detailMachineSn;
   }

   public void setPayStateList(final List<Integer> payStateList) {
      this.payStateList = payStateList;
   }

   public void setOrderRefundStateList(final List<Integer> orderRefundStateList) {
      this.orderRefundStateList = orderRefundStateList;
   }

   public void setOrderStateList(final List<Integer> orderStateList) {
      this.orderStateList = orderStateList;
   }

   public void setMealtimeTypeList(final List<Integer> mealtimeTypeList) {
      this.mealtimeTypeList = mealtimeTypeList;
   }

}
