package tech.easyflow.approval.entity.base;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.core.handler.FastjsonTypeHandler;

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

/**
 * 审批实例基础字段。
 */
public class ApprovalInstanceBase implements Serializable {

    private static final long serialVersionUID = 1L;

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

    @Column(comment = "流程ID")
    private BigInteger flowId;

    @Column(comment = "流程版本")
    private Integer flowVersion;

    @Column(comment = "资源类型")
    private String resourceType;

    @Column(comment = "资源ID")
    private BigInteger resourceId;

    @Column(comment = "动作类型")
    private String actionType;

    @Column(comment = "实例状态")
    private String status;

    @Column(comment = "当前步骤序号")
    private Integer currentStepNo;

    @Column(typeHandler = FastjsonTypeHandler.class, comment = "审批快照")
    private Map<String, Object> snapshotJson;

    @Column(comment = "审批摘要")
    private String summary;

    @Column(comment = "申请人ID")
    private BigInteger applicantId;

    @Column(comment = "提交时间")
    private Date submittedAt;

    @Column(comment = "完成时间")
    private Date finishedAt;

    @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 getFlowId() {
        return flowId;
    }

    public void setFlowId(BigInteger flowId) {
        this.flowId = flowId;
    }

    public Integer getFlowVersion() {
        return flowVersion;
    }

    public void setFlowVersion(Integer flowVersion) {
        this.flowVersion = flowVersion;
    }

    public String getResourceType() {
        return resourceType;
    }

    public void setResourceType(String resourceType) {
        this.resourceType = resourceType;
    }

    public BigInteger getResourceId() {
        return resourceId;
    }

    public void setResourceId(BigInteger resourceId) {
        this.resourceId = resourceId;
    }

    public String getActionType() {
        return actionType;
    }

    public void setActionType(String actionType) {
        this.actionType = actionType;
    }

    public String getStatus() {
        return status;
    }

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

    public Integer getCurrentStepNo() {
        return currentStepNo;
    }

    public void setCurrentStepNo(Integer currentStepNo) {
        this.currentStepNo = currentStepNo;
    }

    public Map<String, Object> getSnapshotJson() {
        return snapshotJson;
    }

    public void setSnapshotJson(Map<String, Object> snapshotJson) {
        this.snapshotJson = snapshotJson;
    }

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public BigInteger getApplicantId() {
        return applicantId;
    }

    public void setApplicantId(BigInteger applicantId) {
        this.applicantId = applicantId;
    }

    public Date getSubmittedAt() {
        return submittedAt;
    }

    public void setSubmittedAt(Date submittedAt) {
        this.submittedAt = submittedAt;
    }

    public Date getFinishedAt() {
        return finishedAt;
    }

    public void setFinishedAt(Date finishedAt) {
        this.finishedAt = finishedAt;
    }

    public Date getCreated() {
        return created;
    }

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

    public BigInteger getCreatedBy() {
        return createdBy;
    }

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

    public Date getModified() {
        return modified;
    }

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

    public BigInteger getModifiedBy() {
        return modifiedBy;
    }

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