package com.ruoyi.payment.domain;

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

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 资金流转记录对象 dc_fund_transfer
 * 
 * @author ruoyi
 * @date 2025-01-20
 */
public class FundTransfer extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 流转ID */
    private Long transferId;

    /** 流转编号 */
    @Excel(name = "流转编号")
    @NotBlank(message = "流转编号不能为空")
    @Size(max = 100, message = "流转编号长度不能超过100个字符")
    private String transferNumber;

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

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

    /** 转账金额 */
    @Excel(name = "转账金额")
    @NotNull(message = "转账金额不能为空")
    @DecimalMin(value = "0.01", message = "转账金额必须大于0")
    private BigDecimal transferAmount;

    /** 转账类型 */
    @Excel(name = "转账类型")
    @NotBlank(message = "转账类型不能为空")
    @Pattern(regexp = "^(DEPOSIT|WITHDRAW|TRANSFER|REPAYMENT|DISTRIBUTION)$", message = "转账类型只能是DEPOSIT、WITHDRAW、TRANSFER、REPAYMENT或DISTRIBUTION")
    private String transferType;

    /** 转账状态 */
    @Excel(name = "转账状态")
    @NotBlank(message = "转账状态不能为空")
    @Pattern(regexp = "^(PENDING|PROCESSING|SUCCESS|FAILED|CANCELLED)$", message = "转账状态只能是PENDING、PROCESSING、SUCCESS、FAILED或CANCELLED")
    private String transferStatus;

    /** 描述 */
    @Excel(name = "描述")
    @Size(max = 500, message = "描述长度不能超过500个字符")
    private String description;

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

    /** 区块链交易哈希 */
    @Excel(name = "区块链交易哈希")
    @Size(max = 255, message = "区块链交易哈希长度不能超过255个字符")
    private String blockchainTxHash;

    public void setTransferId(Long transferId) 
    {
        this.transferId = transferId;
    }

    public Long getTransferId() 
    {
        return transferId;
    }
    public void setTransferNumber(String transferNumber) 
    {
        this.transferNumber = transferNumber;
    }

    public String getTransferNumber() 
    {
        return transferNumber;
    }
    public void setFromAccountId(Long fromAccountId) 
    {
        this.fromAccountId = fromAccountId;
    }

    public Long getFromAccountId() 
    {
        return fromAccountId;
    }
    public void setToAccountId(Long toAccountId) 
    {
        this.toAccountId = toAccountId;
    }

    public Long getToAccountId() 
    {
        return toAccountId;
    }
    public void setTransferAmount(BigDecimal transferAmount) 
    {
        this.transferAmount = transferAmount;
    }

    public BigDecimal getTransferAmount() 
    {
        return transferAmount;
    }
    public void setTransferType(String transferType) 
    {
        this.transferType = transferType;
    }

    public String getTransferType() 
    {
        return transferType;
    }
    public void setTransferStatus(String transferStatus) 
    {
        this.transferStatus = transferStatus;
    }

    public String getTransferStatus() 
    {
        return transferStatus;
    }
    public void setDescription(String description) 
    {
        this.description = description;
    }

    public String getDescription() 
    {
        return description;
    }
    public void setTransferTime(Date transferTime) 
    {
        this.transferTime = transferTime;
    }

    public Date getTransferTime() 
    {
        return transferTime;
    }
    public void setBlockchainTxHash(String blockchainTxHash) 
    {
        this.blockchainTxHash = blockchainTxHash;
    }

    public String getBlockchainTxHash() 
    {
        return blockchainTxHash;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("transferId", getTransferId())
            .append("transferNumber", getTransferNumber())
            .append("fromAccountId", getFromAccountId())
            .append("toAccountId", getToAccountId())
            .append("transferAmount", getTransferAmount())
            .append("transferType", getTransferType())
            .append("transferStatus", getTransferStatus())
            .append("description", getDescription())
            .append("transferTime", getTransferTime())
            .append("blockchainTxHash", getBlockchainTxHash())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}