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

import cn.hutool.core.util.StrUtil;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotNull;

public class OrderStatAndroidQueryDTO {
   @ApiModelProperty("设备sn码")
   private String machineSn;
   @ApiModelProperty("明细提交设备sn码")
   private String detailMachineSn;

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

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

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

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

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

}
