package com.bonus.core.order.mobile.vo;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import com.bonus.core.order.common.constants.ChangeDetailTypeEnum;
import com.bonus.core.order.common.model.OrderAmountChange;

import java.math.BigDecimal;

public class OrderAmountChangeVO {
   private Long changeId;
   private Long orderId;
   private BigDecimal changeAmount;
   private Integer changeType;
   private Integer changeDetailType;
   private String remark;
   private String changeDetailTypeDesc;

   public String getChangeDetailTypeDesc() {
      String typeDesc = ChangeDetailTypeEnum.getDesc(this.changeDetailType);
      if (ChangeDetailTypeEnum.ifFromRule(this.changeDetailType) && StrUtil.isNotBlank(this.remark)) {
         typeDesc = typeDesc + "（" + this.remark + "）";
      }

      return typeDesc;
   }

   public static OrderAmountChangeVO of(OrderAmountChange orderAmountChange) {
      return (OrderAmountChangeVO)BeanUtil.copyProperties(orderAmountChange, OrderAmountChangeVO.class, new String[0]);
   }

   public Long getChangeId() {
      return this.changeId;
   }

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

   public BigDecimal getChangeAmount() {
      return this.changeAmount;
   }

   public Integer getChangeType() {
      return this.changeType;
   }

   public Integer getChangeDetailType() {
      return this.changeDetailType;
   }

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

   public void setChangeId(final Long changeId) {
      this.changeId = changeId;
   }

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

   public void setChangeAmount(final BigDecimal changeAmount) {
      this.changeAmount = changeAmount;
   }

   public void setChangeType(final Integer changeType) {
      this.changeType = changeType;
   }

   public void setChangeDetailType(final Integer changeDetailType) {
      this.changeDetailType = changeDetailType;
   }

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

   public void setChangeDetailTypeDesc(final String changeDetailTypeDesc) {
      this.changeDetailTypeDesc = changeDetailTypeDesc;
   }
}
