package com.hzs.member.account.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.hzs.common.core.annotation.BigDecimalFormat;
import com.hzs.common.core.annotation.Excel;
import com.hzs.common.core.annotation.Transaction;
import com.hzs.common.core.constant.EnumsPrefixConstants;
import lombok.*;

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

/**
 * <p>
 * 会员交易明细
 * </p>
 *
 * @author hzs
 * @since 2022-09-06
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class CuMemberTradeVO extends CuMemberBaseVO {
    /**
     * 主键
     */
    private Long pkId;
    /**
     * 钱包类型
     */
    @Transaction(transactionKey = EnumsPrefixConstants.KEY_ACC)
    private Integer pkAccount;
    /**
     * 钱包类型 翻译
     */
    @Excel(name = "钱包类型")
    private String pkAccountVal;

    /**
     * 交易类型: (101: 注册订单,102: 升级订单,103: 复购订单,104: 圣宝云代注册,105: 圣宝云代升级,106: 圣宝云代复购,107: 嗨粉订单,108: 提货订单,109: 礼包订单,110: 消费订单,111: 兑换订单,200: 提现,201: 提现充正,300: 转账,400: 后台充值,401: 线上充值,500: 收益发放,600: 撤单返钱,601: 返还本金)
     */
    @Transaction(transactionKey = EnumsPrefixConstants.TRADE_TYPE)
    private Integer tradeType;

    @Excel(name = "交易类型")
    private String tradeTypeVal;

    /**
     * 历史余额
     */
    @Excel(name = "历史余额", scale = 2)
    @BigDecimalFormat()
    private BigDecimal tradeBeforeBalance;

    /**
     * 当前余额
     */
    @Excel(name = "当前余额", scale = 2)
    @BigDecimalFormat()
    private BigDecimal tradeBalance;

    /**
     * 交易金额
     */
    @Excel(name = "交易金额", scale = 2)
    @BigDecimalFormat()
    private BigDecimal tradeAmount;

    /**
     * 历史余额(本币)
     */
    @Excel(name = "历史余额($)", scale = 2)
    @BigDecimalFormat()
    private BigDecimal settleTradeBeforeBalance;

    /**
     * 当前余额(本币)
     */
    @Excel(name = "当前余额($)", scale = 2)
    @BigDecimalFormat()
    private BigDecimal settleTradeBalance;

    /**
     * 交易金额(本币)
     */
    @Excel(name = "交易金额($)", scale = 2)
    @BigDecimalFormat()
    private BigDecimal settleTradeAmount;

    /**
     * 汇率
     */
    @Excel(name = "汇率", scale = 4)
    @BigDecimalFormat("#0.0000")
    private BigDecimal exchangeRate;

    /**
     * 交易时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "交易时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date creationTime;
    /**
     * 来源单号
     */
    @Excel(name = "单据编号")
    private String sourceCode;

    /**
     * 交易分类:(1=消费 2=提现 3=转账 4=充值 5=收益)
     */
    @JsonIgnore
    @Transaction(transactionKey = EnumsPrefixConstants.TRADE_CLASSIFY)
    private Integer tradeClassify;

    @JsonIgnore
    private String tradeClassifyVal;

    private String remarks;

    /**
     * 交易编号
     */
    private String tradeCode;

    /**
     * 已选取的ID
     */
    private List<Long> pkIds;

    /**
     * 开始时间
     */
    private String startDate;
    /**
     * 结束时间
     */
    private String endDate;

    /**
     * 修改人ID
     */
    @JsonIgnore
    private Long pkModified;

    /**
     * 交易编号list
     */
    private List<String> tradeCodes;

    /**
     * 是否拼接订单号
     */
    private Integer montage;

}
