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

import com.bonus.core.marketing.util.EnumUtil;
import com.bonus.core.marketing.v2.rule.price.constants.RulePriceLimitEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.math.BigDecimal;
import java.math.RoundingMode;

@ApiModel("计价规则详情-累计金额")
public class PriceLimitSumAmountDTO {
   @ApiModelProperty("累计上限金额(分)")
   private BigDecimal maxAmount;
   @ApiModelProperty("限制类型")
   private Integer limitType;

   public String toString() {
      String var10000 = EnumUtil.getValueByKey(RulePriceLimitEnum.class, this.getLimitType());
      return "限制类型：" + var10000 + "<br/>累计上限金额(元)：" + String.valueOf(this.getMaxAmount().divide(new BigDecimal(100), 2, RoundingMode.HALF_UP)) + "<br/>";
   }

   public BigDecimal getMaxAmount() {
      return this.maxAmount;
   }

   public Integer getLimitType() {
      return this.limitType;
   }

   public void setMaxAmount(final BigDecimal maxAmount) {
      this.maxAmount = maxAmount;
   }

   public void setLimitType(final Integer limitType) {
      this.limitType = limitType;
   }

}
