package com.bonus.core.account.v3.api.vo;

import cn.hutool.core.util.ObjectUtil;
import com.bonus.core.account.v3.constants.AccStatusEnum;
import com.bonus.core.common.encrypt.LeNiuDecryptDataProcess;
import com.bonus.core.common.encrypt.LeNiuDecryptField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

@LeNiuDecryptDataProcess
public class AccInfoDetailVO {
   @ApiModelProperty("人员id")
   private Long custId;
   @ApiModelProperty("人员姓名")
   @LeNiuDecryptField
   private String custName;
   @ApiModelProperty("账户Id")
   private Long accId;
   @ApiModelProperty("第三方人员Id")
   private String custThirdId;
   @ApiModelProperty("组织id")
   private Long orgId;
   @ApiModelProperty("人员类别")
   private Integer psnType;
   @ApiModelProperty("账户状态 1正常  2冻结  3销户 4过期")
   private Integer accStatus;
   @ApiModelProperty("账户可用总余额(不包括冻结金额)")
   private BigDecimal accBalTotal;
   @ApiModelProperty("账户总余额(包含冻结金额)")
   private BigDecimal accAllBal;
   @ApiModelProperty("个人钱包(可用)余额/分")
   private BigDecimal walletBal;
   @ApiModelProperty("补贴钱包(可用)余额/分")
   private BigDecimal subsidyBal;
   @ApiModelProperty("红包余额")
   private BigDecimal redEnvelope;
   @ApiModelProperty("个人钱包冻结金额")
   private BigDecimal walletFreezeBal;
   @ApiModelProperty("补贴钱包冻结金额")
   private BigDecimal subFreezeBal;
   @ApiModelProperty("总冻结金额")
   private BigDecimal accFreezeBalTotal;
   @ApiModelProperty("卡序列号")
   private String serialNum;
   @ApiModelProperty("卡状态")
   private Integer cardStatus;
   @ApiModelProperty("押金")
   private Integer deposit;
   @ApiModelProperty("工本费")
   private Integer productCost;

   public boolean isNormal() {
      return AccStatusEnum.NORMAL.getKey().equals(this.accStatus);
   }

   public BigDecimal getAccBalTotal() {
      return ObjectUtil.isNull(this.accBalTotal) ? BigDecimal.ZERO : this.accBalTotal;
   }

   public BigDecimal getWalletBal() {
      return ObjectUtil.isNull(this.walletBal) ? BigDecimal.ZERO : this.walletBal;
   }

   public BigDecimal getSubsidyBal() {
      return ObjectUtil.isNull(this.subsidyBal) ? BigDecimal.ZERO : this.subsidyBal;
   }

   public BigDecimal getRedEnvelope() {
      return ObjectUtil.isNull(this.redEnvelope) ? BigDecimal.ZERO : this.redEnvelope;
   }

   public static AccInfoDetailVOBuilder builder() {
      return new AccInfoDetailVOBuilder();
   }

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

   public String getCustName() {
      return this.custName;
   }

   public Long getAccId() {
      return this.accId;
   }

   public String getCustThirdId() {
      return this.custThirdId;
   }

   public Long getOrgId() {
      return this.orgId;
   }

   public Integer getPsnType() {
      return this.psnType;
   }

   public Integer getAccStatus() {
      return this.accStatus;
   }

   public BigDecimal getAccAllBal() {
      return this.accAllBal;
   }

   public BigDecimal getWalletFreezeBal() {
      return this.walletFreezeBal;
   }

   public BigDecimal getSubFreezeBal() {
      return this.subFreezeBal;
   }

   public BigDecimal getAccFreezeBalTotal() {
      return this.accFreezeBalTotal;
   }

   public String getSerialNum() {
      return this.serialNum;
   }

   public Integer getCardStatus() {
      return this.cardStatus;
   }

   public Integer getDeposit() {
      return this.deposit;
   }

   public Integer getProductCost() {
      return this.productCost;
   }

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

   public void setCustName(final String custName) {
      this.custName = custName;
   }

   public void setAccId(final Long accId) {
      this.accId = accId;
   }

   public void setCustThirdId(final String custThirdId) {
      this.custThirdId = custThirdId;
   }

   public void setOrgId(final Long orgId) {
      this.orgId = orgId;
   }

   public void setPsnType(final Integer psnType) {
      this.psnType = psnType;
   }

   public void setAccStatus(final Integer accStatus) {
      this.accStatus = accStatus;
   }

   public void setAccBalTotal(final BigDecimal accBalTotal) {
      this.accBalTotal = accBalTotal;
   }

   public void setAccAllBal(final BigDecimal accAllBal) {
      this.accAllBal = accAllBal;
   }

   public void setWalletBal(final BigDecimal walletBal) {
      this.walletBal = walletBal;
   }

   public void setSubsidyBal(final BigDecimal subsidyBal) {
      this.subsidyBal = subsidyBal;
   }

   public void setRedEnvelope(final BigDecimal redEnvelope) {
      this.redEnvelope = redEnvelope;
   }

   public void setWalletFreezeBal(final BigDecimal walletFreezeBal) {
      this.walletFreezeBal = walletFreezeBal;
   }

   public void setSubFreezeBal(final BigDecimal subFreezeBal) {
      this.subFreezeBal = subFreezeBal;
   }

   public void setAccFreezeBalTotal(final BigDecimal accFreezeBalTotal) {
      this.accFreezeBalTotal = accFreezeBalTotal;
   }

   public void setSerialNum(final String serialNum) {
      this.serialNum = serialNum;
   }

   public void setCardStatus(final Integer cardStatus) {
      this.cardStatus = cardStatus;
   }

   public void setDeposit(final Integer deposit) {
      this.deposit = deposit;
   }

   public void setProductCost(final Integer productCost) {
      this.productCost = productCost;
   }

   @Data
   public static class AccInfoDetailVOBuilder {
      private Long custId;
      private String custName;
      private Long accId;
      private String custThirdId;
      private Long orgId;
      private Integer psnType;
      private Integer accStatus;
      private BigDecimal accBalTotal;
      private BigDecimal accAllBal;
      private BigDecimal walletBal;
      private BigDecimal subsidyBal;
      private BigDecimal redEnvelope;
      private BigDecimal walletFreezeBal;
      private BigDecimal subFreezeBal;
      private BigDecimal accFreezeBalTotal;
      private String serialNum;
      private Integer cardStatus;
      private Integer deposit;
      private Integer productCost;
   }
}
