package com.ruoyi.payment.domain;

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

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;

import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 账户余额对象 dc_account_balance
 * 
 * @author ruoyi
 * @date 2025-12-17
 */
public class AccountBalance extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 余额记录ID */
    private Long balanceId;

    /** 账户ID */
    @Excel(name = "账户ID")
    @NotNull(message = "账户ID不能为空")
    private Long accountId;

    /** 余额 */
    @Excel(name = "余额")
    @NotNull(message = "余额不能为空")
    @DecimalMin(value = "0", message = "余额不能为负数")
    private BigDecimal balance;

    /** 冻结金额 */
    @Excel(name = "冻结金额")
    @NotNull(message = "冻结金额不能为空")
    @DecimalMin(value = "0", message = "冻结金额不能为负数")
    private BigDecimal frozenAmount;

    /** 可用余额 */
    @Excel(name = "可用余额")
    @NotNull(message = "可用余额不能为空")
    @DecimalMin(value = "0", message = "可用余额不能为负数")
    private BigDecimal availableBalance;

    /** 更新时间 */
    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "更新时间不能为空")
    private Date updateTime;

    /** 版本号(乐观锁) */
    @Excel(name = "版本号")
    @NotNull(message = "版本号不能为空")
    private Long version;

    public void setBalanceId(Long balanceId) 
    {
        this.balanceId = balanceId;
    }

    public Long getBalanceId() 
    {
        return balanceId;
    }
    public void setAccountId(Long accountId) 
    {
        this.accountId = accountId;
    }

    public Long getAccountId() 
    {
        return accountId;
    }
    public void setBalance(BigDecimal balance) 
    {
        this.balance = balance;
    }

    public BigDecimal getBalance() 
    {
        return balance;
    }
    public void setFrozenAmount(BigDecimal frozenAmount) 
    {
        this.frozenAmount = frozenAmount;
    }

    public BigDecimal getFrozenAmount() 
    {
        return frozenAmount;
    }
    public void setAvailableBalance(BigDecimal availableBalance) 
    {
        this.availableBalance = availableBalance;
    }

    public BigDecimal getAvailableBalance() 
    {
        return availableBalance;
    }
    @Override
    public void setUpdateTime(Date updateTime) 
    {
        this.updateTime = updateTime;
    }

    @Override
    public Date getUpdateTime() 
    {
        return updateTime;
    }
    public void setVersion(Long version) 
    {
        this.version = version;
    }

    public Long getVersion() 
    {
        return version;
    }

    @Override
    public String toString() {
        return "AccountBalance{" +
                "balanceId=" + balanceId +
                ", accountId=" + accountId +
                ", balance=" + balance +
                ", frozenAmount=" + frozenAmount +
                ", availableBalance=" + availableBalance +
                ", updateTime=" + updateTime +
                ", version=" + version +
                '}';
    }
}