package tech.easyflow.ai.entity;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import tech.easyflow.common.entity.DateEntity;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;

/**
 * 知识库文档批量导入文件项。
 *
 * @author Codex
 * @since 2026-07-31
 */
@Table(value = "tb_document_import_batch_item", comment = "知识库文档批量导入文件项")
public class DocumentImportBatchItem extends DateEntity implements Serializable {

    @Id(keyType = KeyType.Generator, value = "snowFlakeId")
    private BigInteger id;

    @Column(comment = "批次ID")
    private BigInteger batchId;

    @Column(comment = "知识库ID")
    private BigInteger knowledgeId;

    @Column(comment = "文档ID")
    private BigInteger documentId;

    @Column(comment = "待覆盖的历史文档ID")
    private BigInteger replacedDocumentId;

    @Column(comment = "客户端文件键")
    private String clientFileKey;

    @Column(comment = "文件名")
    private String fileName;

    @Column(comment = "文件夹相对路径")
    private String relativePath;

    @Column(comment = "文件大小")
    private Long fileSize;

    @Column(comment = "存储路径")
    private String filePath;

    @Column(comment = "可恢复存储定位符")
    private String storageLocator;

    @Column(comment = "是否等待清理存储对象")
    private Boolean cleanupPending;

    @Column(comment = "文件内容SHA-256")
    private String contentSha256;

    @Column(comment = "当前阶段")
    private String stage;

    @Column(comment = "当前状态")
    private String status;

    @Column(comment = "错误摘要")
    private String errorSummary;

    @Column(comment = "稳定失败码")
    private String failureCode;

    @Column(comment = "实际分块策略编码")
    private String appliedStrategyCode;

    @Column(comment = "分块策略快照")
    private String strategySnapshotJson;

    @Column(comment = "是否允许批量重试")
    private Boolean retryable;

    @Column(comment = "重试次数")
    private Integer attemptCount;

    @Column(comment = "创建时间")
    private Date created;

    @Column(comment = "创建人")
    private BigInteger createdBy;

    @Column(comment = "修改时间")
    private Date modified;

    @Column(comment = "修改人")
    private BigInteger modifiedBy;

    public BigInteger getId() {
        return id;
    }

    public void setId(BigInteger id) {
        this.id = id;
    }

    public BigInteger getBatchId() {
        return batchId;
    }

    public void setBatchId(BigInteger batchId) {
        this.batchId = batchId;
    }

    public BigInteger getKnowledgeId() {
        return knowledgeId;
    }

    public void setKnowledgeId(BigInteger knowledgeId) {
        this.knowledgeId = knowledgeId;
    }

    public BigInteger getDocumentId() {
        return documentId;
    }

    public void setDocumentId(BigInteger documentId) {
        this.documentId = documentId;
    }

    public BigInteger getReplacedDocumentId() {
        return replacedDocumentId;
    }

    public void setReplacedDocumentId(BigInteger replacedDocumentId) {
        this.replacedDocumentId = replacedDocumentId;
    }

    public String getClientFileKey() {
        return clientFileKey;
    }

    public void setClientFileKey(String clientFileKey) {
        this.clientFileKey = clientFileKey;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getRelativePath() {
        return relativePath;
    }

    public void setRelativePath(String relativePath) {
        this.relativePath = relativePath;
    }

    public Long getFileSize() {
        return fileSize;
    }

    public void setFileSize(Long fileSize) {
        this.fileSize = fileSize;
    }

    public String getFilePath() {
        return filePath;
    }

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

    public String getStorageLocator() {
        return storageLocator;
    }

    public void setStorageLocator(String storageLocator) {
        this.storageLocator = storageLocator;
    }

    public Boolean getCleanupPending() {
        return cleanupPending;
    }

    public void setCleanupPending(Boolean cleanupPending) {
        this.cleanupPending = cleanupPending;
    }

    public String getContentSha256() {
        return contentSha256;
    }

    public void setContentSha256(String contentSha256) {
        this.contentSha256 = contentSha256;
    }

    public String getStage() {
        return stage;
    }

    public void setStage(String stage) {
        this.stage = stage;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getErrorSummary() {
        return errorSummary;
    }

    public void setErrorSummary(String errorSummary) {
        this.errorSummary = errorSummary;
    }

    public String getFailureCode() {
        return failureCode;
    }

    public void setFailureCode(String failureCode) {
        this.failureCode = failureCode;
    }

    public String getAppliedStrategyCode() {
        return appliedStrategyCode;
    }

    public void setAppliedStrategyCode(String appliedStrategyCode) {
        this.appliedStrategyCode = appliedStrategyCode;
    }

    public String getStrategySnapshotJson() {
        return strategySnapshotJson;
    }

    public void setStrategySnapshotJson(String strategySnapshotJson) {
        this.strategySnapshotJson = strategySnapshotJson;
    }

    public Boolean getRetryable() {
        return retryable;
    }

    public void setRetryable(Boolean retryable) {
        this.retryable = retryable;
    }

    public Integer getAttemptCount() {
        return attemptCount;
    }

    public void setAttemptCount(Integer attemptCount) {
        this.attemptCount = attemptCount;
    }

    @Override
    public Date getCreated() {
        return created;
    }

    @Override
    public void setCreated(Date created) {
        this.created = created;
    }

    public BigInteger getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(BigInteger createdBy) {
        this.createdBy = createdBy;
    }

    @Override
    public Date getModified() {
        return modified;
    }

    @Override
    public void setModified(Date modified) {
        this.modified = modified;
    }

    public BigInteger getModifiedBy() {
        return modifiedBy;
    }

    public void setModifiedBy(BigInteger modifiedBy) {
        this.modifiedBy = modifiedBy;
    }
}
