package com.bonus.core.marketing.v2.rule.price.dto;

import cn.hutool.core.collection.CollUtil;
import com.bonus.core.marketing.v2.rule.meal.dto.RulePriceSimpleDTO;
import com.fasterxml.jackson.databind.JsonNode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.List;

@ApiModel("计价规则入参")
public class RulePriceDTO {
   @ApiModelProperty("是否是试算")
   private Integer tryFlag;
   @ApiModelProperty("是否是核销")
   private Integer verifyFlag;
   @ApiModelProperty("人员id")
   private Long custId;
   @ApiModelProperty("渠道")
   private Integer payChannel;
   @ApiModelProperty("订单列表")
   private List<RulePriceOrderDTO> orders;
   @ApiModelProperty("预留字段")
   private JsonNode extInfo;

   public RulePriceDTO(RulePriceSimpleDTO simpleDTO) {
      this.custId = simpleDTO.getCustId();
      this.orders = CollUtil.newArrayList(new RulePriceOrderDTO[]{new RulePriceOrderDTO(simpleDTO)});
   }

   public Integer getTryFlag() {
      return this.tryFlag;
   }

   public Integer getVerifyFlag() {
      return this.verifyFlag;
   }

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

   public Integer getPayChannel() {
      return this.payChannel;
   }

   public List<RulePriceOrderDTO> getOrders() {
      return this.orders;
   }

   public JsonNode getExtInfo() {
      return this.extInfo;
   }

   public RulePriceDTO setTryFlag(final Integer tryFlag) {
      this.tryFlag = tryFlag;
      return this;
   }

   public RulePriceDTO setVerifyFlag(final Integer verifyFlag) {
      this.verifyFlag = verifyFlag;
      return this;
   }

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

   public RulePriceDTO setPayChannel(final Integer payChannel) {
      this.payChannel = payChannel;
      return this;
   }

   public RulePriceDTO setOrders(final List<RulePriceOrderDTO> orders) {
      this.orders = orders;
      return this;
   }

   public RulePriceDTO setExtInfo(final JsonNode extInfo) {
      this.extInfo = extInfo;
      return this;
   }


   public RulePriceDTO(final Integer tryFlag, final Integer verifyFlag, final Long custId, final Integer payChannel, final List<RulePriceOrderDTO> orders, final JsonNode extInfo) {
      this.tryFlag = tryFlag;
      this.verifyFlag = verifyFlag;
      this.custId = custId;
      this.payChannel = payChannel;
      this.orders = orders;
      this.extInfo = extInfo;
   }

   public RulePriceDTO() {
   }
}
