package com.iformall.domain.po;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.iformall.domain.po.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;


import java.math.BigDecimal;
import java.util.Date;

@TableName(value = "wx_card_info")
@Data
@EqualsAndHashCode(callSuper = true)
public class WxCardInfo extends BaseEntity {
	private static final long serialVersionUID = 1L;

	@Excel(name = "卡号", width = 20, orderNum = "1")

    protected Long id; /**主键ID-与coupon_order_id一致*/


    @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId")
	private String tenantId;
    @io.swagger.annotations.ApiModelProperty(value = "券ID", name = "couponId")
    private Long couponId;
	@io.swagger.annotations.ApiModelProperty(value="微信订单号-购买类储值卡时的订单号",name="transactionId")
	private String transactionId;
	@io.swagger.annotations.ApiModelProperty(value="面额总金额",name="amount")
	private Integer amount;
    @io.swagger.annotations.ApiModelProperty(value="购买总金额",name="saleAmount")
    private Integer saleAmount;

	public String getRemainingAmountStr() {
		return new BigDecimal(remainingAmount == null ? 0 : remainingAmount).divide(new BigDecimal(100)).toPlainString();
	}

	@Excel(name = "余额(元)", width = 20, orderNum = "7")
	@TableField(exist = false)
	private String remainingAmountStr;


	@io.swagger.annotations.ApiModelProperty(value="剩余面额",name="remainingAmount")
	private Integer remainingAmount;
	@io.swagger.annotations.ApiModelProperty(value="分账总手续费",name="serviceFeeAmount")
	private Integer serviceFeeAmount;
	@io.swagger.annotations.ApiModelProperty(value="分账总金额",name="shareFeeAmount")
	private Integer shareFeeAmount;
	@io.swagger.annotations.ApiModelProperty(value="分账剩余总金额",name="remainingShareFeeAmount")
	private Integer remainingShareFeeAmount;
    @io.swagger.annotations.ApiModelProperty(value="分账通道费差(购买时刻的通道费差，分账完结时使用)",name="rateAmount")
    private Integer rateAmount;

	@Excel(name = "购买时间 ", width = 20, orderNum = "10", format = "yyyy-MM-dd HH:mm:ss")
	@io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate")
	private Date createDate;
	@io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate")
	private Date updateDate;

    @io.swagger.annotations.ApiModelProperty(value = "是否支持转送(0:不支持,1支持)", name = "supportTransfer")
    private Integer supportTransfer;


}
