package com.bizzan.bitrade.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 用户体验金累计盈利钱包（每人一条）
 */
@Entity
@Data
@Table(name = "experience_gift_wallet")
public class ExperienceGiftWallet {

    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Id
    private Long id;

    /** 用户ID（全局唯一） */
    @Column(name = "member_id")
    private Long memberId;

    /** 累计领取体验金面值（USDT） */
    @Column(name = "total_received")
    private BigDecimal totalReceived = BigDecimal.ZERO;

    /** 累计盈利总额（USDT） */
    @Column(name = "total_profit")
    private BigDecimal totalProfit = BigDecimal.ZERO;

    /** 待提现金额（USDT），满100可申请 */
    @Column(name = "pending_amount")
    private BigDecimal pendingAmount = BigDecimal.ZERO;

    /** 冻结中金额（USDT），提现审核中 */
    @Column(name = "frozen_amount")
    private BigDecimal frozenAmount = BigDecimal.ZERO;

    /** 历史累计已提现金额（USDT） */
    @Column(name = "total_withdrawn")
    private BigDecimal totalWithdrawn = BigDecimal.ZERO;

    @Column(name = "created_at")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createdAt;

    @Column(name = "updated_at")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updatedAt;
}
