package com.seer.teach.pay.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.seer.teach.common.constants.CommonConstant;
import com.seer.teach.common.entity.BaseEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.math.BigDecimal;

/**
 * <p>
 * 
 * </p>
 *
 * @author Captain
 * @since 2025-06-18
 */
@Getter
@Setter
@TableName("pay_coin_account")
@ToString
public class PayCoinAccountEntity extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @TableField("user_id")
    private Integer userId;

    @TableField("freeze_balance")
    private BigDecimal freezeBalance;

    @TableField("available_balance")
    private BigDecimal availableBalance;

    @TableField("total_amount")
    private BigDecimal totalAmount;

    @TableField("is_block")
    private Integer isBlock;

    public boolean isEnabled() {
        return isBlock != null && CommonConstant.ACCOUNT_UNLOCKED.intValue() == isBlock;
    }
}