
package com.tmerclub.cloud.user.bo.mongo;

import io.swagger.v3.oas.annotations.media.Schema;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.index.CompoundIndexes;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;


/**
 * 余额记录mongodb
 * @author TRACK
 */
@Document("user_balance_log")
@CompoundIndexes({
        @CompoundIndex(name = "idx_refund_id_number", def = "{'refundId':1, 'refundNumber':1}"),
        @CompoundIndex(name = "idx_user_id", def = "{'userId':1}"),
        @CompoundIndex(name = "idx_recharge_id", def = "{'rechargeId':1}"),
        @CompoundIndex(name = "idx_pay_id", def = "{'payId':1}")
})
public class MongoUserBalanceLogBO implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    @Id
    @Schema(description = "用户余额记录id", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long balanceLogId;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private Date createTime;

    @Schema(description = "更新时间")
    private Date updateTime;

    @Schema(description = "用户id", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long userId;

    @Schema(description = "充值id")
    private Long rechargeId;

    @Schema(description = "改变金额", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long changeBalance;

    @Schema(description = "收支类型 0支出 1收入", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer ioType;

    @Schema(description = "支付编号(用于余额充值)")
    private Long payId;

    @Schema(description = "支付类型")
    private Integer payType;

    @Schema(description = "RechargeTypeEnum 1:充值 2:赠送 3:支付  4:退款 5:平台手动修改 6:购买会员 7.提现", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer type;

    @Schema(description = "1:已支付 0:未支付(用于余额充值)")
    private Integer isPayed;

    @Schema(description = "退款单号(用于余额支付进行退款)")
    private Long refundId;

    @Schema(description = "退款序号")
    private Integer refundNumber;

    @Schema(description = "支付系统类型(0:默认支付, 1:通联支付)", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer paySysType;

    public Integer getRefundNumber() {
        return refundNumber;
    }

    public void setRefundNumber(Integer refundNumber) {
        this.refundNumber = refundNumber;
    }

    public Long getBalanceLogId() {
        return balanceLogId;
    }

    public void setBalanceLogId(Long balanceLogId) {
        this.balanceLogId = balanceLogId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getChangeBalance() {
        return changeBalance;
    }

    public void setChangeBalance(Long changeBalance) {
        this.changeBalance = changeBalance;
    }

    public Integer getIoType() {
        return ioType;
    }

    public void setIoType(Integer ioType) {
        this.ioType = ioType;
    }

    public Long getPayId() {
        return payId;
    }

    public void setPayId(Long payId) {
        this.payId = payId;
    }

    public Integer getPayType() {
        return payType;
    }

    public void setPayType(Integer payType) {
        this.payType = payType;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getIsPayed() {
        return isPayed;
    }

    public void setIsPayed(Integer isPayed) {
        this.isPayed = isPayed;
    }

    public Long getRechargeId() {
        return rechargeId;
    }

    public void setRechargeId(Long rechargeId) {
        this.rechargeId = rechargeId;
    }

    public Long getRefundId() {
        return refundId;
    }

    public void setRefundId(Long refundId) {
        this.refundId = refundId;
    }

    public Integer getPaySysType() {
        return paySysType;
    }

    public void setPaySysType(Integer paySysType) {
        this.paySysType = paySysType;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "MongoUserBalanceLogBO{" +
                "balanceLogId=" + balanceLogId +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", userId=" + userId +
                ", rechargeId=" + rechargeId +
                ", changeBalance=" + changeBalance +
                ", ioType=" + ioType +
                ", payId=" + payId +
                ", payType=" + payType +
                ", type=" + type +
                ", isPayed=" + isPayed +
                ", refundId=" + refundId +
                ", refundNumber=" + refundNumber +
                ", paySysType=" + paySysType +
                '}';
    }
}
