package com.ruoyi.credit.domain;

import javax.validation.constraints.Min;
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.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 合同文件对象 dc_contract_file
 * 
 * @author ruoyi
 * @date 2025-01-20
 */
public class ContractFile extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 文件ID */
    private Long fileId;

    /** 关联合同ID */
    @Excel(name = "关联合同ID")
    @NotNull(message = "关联合同ID不能为空")
    private Long contractId;

    /** 原始文件名 */
    @Excel(name = "原始文件名")
    @NotBlank(message = "原始文件名不能为空")
    @Size(max = 255, message = "原始文件名长度不能超过255个字符")
    private String originalFilename;

    /** 存储文件名 */
    @Excel(name = "存储文件名")
    @NotBlank(message = "存储文件名不能为空")
    @Size(max = 255, message = "存储文件名长度不能超过255个字符")
    private String storedFilename;

    /** 文件存储路径 */
    @Excel(name = "文件存储路径")
    @NotBlank(message = "文件存储路径不能为空")
    @Size(max = 500, message = "文件存储路径长度不能超过500个字符")
    private String filePath;

    /** 文件大小(字节) */
    @Excel(name = "文件大小")
    @NotNull(message = "文件大小不能为空")
    @Min(value = 1, message = "文件大小必须大于0")
    private Long fileSize;

    /** 文件类型 */
    @Excel(name = "文件类型")
    @NotBlank(message = "文件类型不能为空")
    @Size(max = 100, message = "文件类型长度不能超过100个字符")
    private String fileType;

    /** MIME类型 */
    @Excel(name = "MIME类型")
    @NotBlank(message = "MIME类型不能为空")
    @Size(max = 100, message = "MIME类型长度不能超过100个字符")
    private String mimeType;

    /** 文件哈希值 */
    @Excel(name = "文件哈希值")
    @NotBlank(message = "文件哈希值不能为空")
    @Size(max = 255, message = "文件哈希值长度不能超过255个字符")
    private String fileHash;

    /** 上传状态 */
    @Excel(name = "上传状态")
    @NotBlank(message = "上传状态不能为空")
    @Pattern(regexp = "^(UPLOADING|UPLOADED|FAILED)$", message = "上传状态只能是UPLOADING、UPLOADED或FAILED")
    private String uploadStatus;

    /** 验证状态 */
    @Excel(name = "验证状态")
    @NotBlank(message = "验证状态不能为空")
    @Pattern(regexp = "^(PENDING|VALIDATING|VALID|INVALID)$", message = "验证状态只能是PENDING、VALIDATING、VALID或INVALID")
    private String validationStatus;

    /** 验证结果 */
    @Excel(name = "验证结果")
    private String validationResult;

    public void setFileId(Long fileId) 
    {
        this.fileId = fileId;
    }

    public Long getFileId() 
    {
        return fileId;
    }
    public void setContractId(Long contractId) 
    {
        this.contractId = contractId;
    }

    public Long getContractId() 
    {
        return contractId;
    }
    public void setOriginalFilename(String originalFilename) 
    {
        this.originalFilename = originalFilename;
    }

    public String getOriginalFilename() 
    {
        return originalFilename;
    }
    public void setStoredFilename(String storedFilename) 
    {
        this.storedFilename = storedFilename;
    }

    public String getStoredFilename() 
    {
        return storedFilename;
    }
    public void setFilePath(String filePath) 
    {
        this.filePath = filePath;
    }

    public String getFilePath() 
    {
        return filePath;
    }
    public void setFileSize(Long fileSize) 
    {
        this.fileSize = fileSize;
    }

    public Long getFileSize() 
    {
        return fileSize;
    }
    public void setFileType(String fileType) 
    {
        this.fileType = fileType;
    }

    public String getFileType() 
    {
        return fileType;
    }
    public void setMimeType(String mimeType) 
    {
        this.mimeType = mimeType;
    }

    public String getMimeType() 
    {
        return mimeType;
    }
    public void setFileHash(String fileHash) 
    {
        this.fileHash = fileHash;
    }

    public String getFileHash() 
    {
        return fileHash;
    }
    public void setUploadStatus(String uploadStatus) 
    {
        this.uploadStatus = uploadStatus;
    }

    public String getUploadStatus() 
    {
        return uploadStatus;
    }
    public void setValidationStatus(String validationStatus) 
    {
        this.validationStatus = validationStatus;
    }

    public String getValidationStatus() 
    {
        return validationStatus;
    }
    public void setValidationResult(String validationResult) 
    {
        this.validationResult = validationResult;
    }

    public String getValidationResult() 
    {
        return validationResult;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("fileId", getFileId())
            .append("contractId", getContractId())
            .append("originalFilename", getOriginalFilename())
            .append("storedFilename", getStoredFilename())
            .append("filePath", getFilePath())
            .append("fileSize", getFileSize())
            .append("fileType", getFileType())
            .append("mimeType", getMimeType())
            .append("fileHash", getFileHash())
            .append("uploadStatus", getUploadStatus())
            .append("validationStatus", getValidationStatus())
            .append("validationResult", getValidationResult())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}