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

import com.bonus.common.houqin.constant.LeConstants;
import com.bonus.canteen.core.common.utils.SysUtil;
import com.bonus.canteen.core.pay.api.dto.UnifyRefundDTO;
import com.fasterxml.jackson.databind.JsonNode;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.Min;
import java.math.BigDecimal;
import java.util.List;

public class OrderRefundParam {
   @ApiModelProperty("是否为试算")
   private Integer ifTrial;
   @ApiModelProperty("订单id")
   private Long orderId;
   @ApiModelProperty("外部退单流水号（选填）")
   private String macRefundId;
   @ApiModelProperty("恢复库存 1是 2否")
   private Integer restoreInventory;
   @ApiModelProperty("退款原因")
   private String remark;
   @ApiModelProperty("退款纠错图片 多个用逗号分割")
   private String resressPicurl;
   @ApiModelProperty("是否需要二次审核")
   private Boolean needCheckFlag;
   @ApiModelProperty("本次退单金额（默认不传则自动计算）")
   private @Min(0L) BigDecimal refundAmount;
   @ApiModelProperty("退单详情list")
   private List<OrderDetailRefundDTO> detailRefundList;
   @ApiModelProperty("指定退款渠道明细")
   private List<UnifyRefundDTO.ChannelDetail> channelAssignList;
   @ApiModelProperty("扩展字段")
   private JsonNode extParam;
   /** @deprecated */
   @ApiModelProperty("设备订单id")
   @Deprecated
   private String macOrderId;

   public void setResressPicurl(String resressPicurl) {
      this.resressPicurl = SysUtil.getCutPathMulti(resressPicurl);
   }

   public boolean ifCustomRefundAmount() {
      return this.refundAmount != null;
   }

   public OrderRefundParam() {
      this.ifTrial = LeConstants.COMMON_NO;
      this.needCheckFlag = false;
   }

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

   public Long getOrderId() {
      return this.orderId;
   }

   public String getMacRefundId() {
      return this.macRefundId;
   }

   public Integer getRestoreInventory() {
      return this.restoreInventory;
   }

   public String getRemark() {
      return this.remark;
   }

   public String getResressPicurl() {
      return this.resressPicurl;
   }

   public Boolean getNeedCheckFlag() {
      return this.needCheckFlag;
   }

   public BigDecimal getRefundAmount() {
      return this.refundAmount;
   }

   public List<OrderDetailRefundDTO> getDetailRefundList() {
      return this.detailRefundList;
   }

   public List<UnifyRefundDTO.ChannelDetail> getChannelAssignList() {
      return this.channelAssignList;
   }

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

   /** @deprecated */
   @Deprecated
   public String getMacOrderId() {
      return this.macOrderId;
   }

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

   public void setOrderId(final Long orderId) {
      this.orderId = orderId;
   }

   public void setMacRefundId(final String macRefundId) {
      this.macRefundId = macRefundId;
   }

   public void setRestoreInventory(final Integer restoreInventory) {
      this.restoreInventory = restoreInventory;
   }

   public void setRemark(final String remark) {
      this.remark = remark;
   }

   public void setNeedCheckFlag(final Boolean needCheckFlag) {
      this.needCheckFlag = needCheckFlag;
   }

   public void setRefundAmount(final BigDecimal refundAmount) {
      this.refundAmount = refundAmount;
   }

   public void setDetailRefundList(final List<OrderDetailRefundDTO> detailRefundList) {
      this.detailRefundList = detailRefundList;
   }

   public void setChannelAssignList(final List<UnifyRefundDTO.ChannelDetail> channelAssignList) {
      this.channelAssignList = channelAssignList;
   }

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

   /** @deprecated */
   @Deprecated
   public void setMacOrderId(final String macOrderId) {
      this.macOrderId = macOrderId;
   }

}
