package com.bonus.core.account.v4.app.vo;

import cn.hutool.core.util.ObjectUtil;
import com.bonus.core.account.v3.api.vo.AccInfoDetailVO;
import com.bonus.core.common.encrypt.LeNiuDecryptField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
@Data
public class AppAccInfoV4VO {
   @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 walletBal;
   @ApiModelProperty("补贴钱包(可用)余额/分")
   private BigDecimal subsidyBal;
   @ApiModelProperty("红包(可用)余额")
   private BigDecimal redEnvelope;
   @ApiModelProperty("补贴钱包总金额(可用+冻结)")
   private BigDecimal subBalTotal;
   @ApiModelProperty("个人钱包冻结金额")
   private BigDecimal walletFreezeBal;
   @ApiModelProperty("补贴钱包冻结金额")
   private BigDecimal subFreezeBal;
   @ApiModelProperty("总冻结金额")
   private BigDecimal accFreezeBalTotal;
   @ApiModelProperty("账户总余额(包含冻结金额)")
   private BigDecimal accAllBal;
   @ApiModelProperty("账户可用余额总余额(不包括冻结金额)")
   private BigDecimal accBalTotal;
   @ApiModelProperty("补贴过期即将过期提示")
   private String subsidyExpirationToast;

   public static AppAccInfoV4VO of(AccInfoDetailVO accInfoDetailVO) {
      AppAccInfoV4VO appAccInfoV4VO = new AppAccInfoV4VO();
      appAccInfoV4VO.setCustId(accInfoDetailVO.getCustId());
      appAccInfoV4VO.setCustName(accInfoDetailVO.getCustName());
      appAccInfoV4VO.setAccId(accInfoDetailVO.getAccId());
      appAccInfoV4VO.setCustThirdId(accInfoDetailVO.getCustThirdId());
      appAccInfoV4VO.setOrgId(accInfoDetailVO.getOrgId());
      appAccInfoV4VO.setPsnType(accInfoDetailVO.getPsnType());
      appAccInfoV4VO.setAccBalTotal(accInfoDetailVO.getAccBalTotal());
      appAccInfoV4VO.setAccAllBal(accInfoDetailVO.getAccAllBal());
      appAccInfoV4VO.setWalletBal(accInfoDetailVO.getWalletBal());
      appAccInfoV4VO.setSubsidyBal(accInfoDetailVO.getSubsidyBal());
      appAccInfoV4VO.setRedEnvelope(accInfoDetailVO.getRedEnvelope());
      appAccInfoV4VO.setWalletFreezeBal(accInfoDetailVO.getWalletFreezeBal());
      appAccInfoV4VO.setSubFreezeBal(accInfoDetailVO.getSubFreezeBal());
      appAccInfoV4VO.setAccFreezeBalTotal(accInfoDetailVO.getAccFreezeBalTotal());
      appAccInfoV4VO.setAccStatus(accInfoDetailVO.getAccStatus());
      appAccInfoV4VO.setSubBalTotal(accInfoDetailVO.getSubsidyBal().add(accInfoDetailVO.getSubFreezeBal()));
      return appAccInfoV4VO;
   }
}
