package com.sundot.airport.system.domain.approval;

import java.util.List;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.sundot.airport.common.annotation.Excel;
import com.sundot.airport.common.core.domain.BaseEntity;

/**
 * 审批流程定义对象 approval_workflow_definition
 *
 * @author simon lin
 * @date 2025-09-06
 */
@TableName("approval_workflow_definition")
public class ApprovalWorkflowDefinition extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 流程代码
     */
    @Excel(name = "流程代码")
    @NotBlank(message = "流程代码不能为空")
    @Size(min = 0, max = 50, message = "流程代码长度不能超过50个字符")
    private String workflowCode;

    /**
     * 流程名称
     */
    @Excel(name = "流程名称")
    @NotBlank(message = "流程名称不能为空")
    @Size(min = 0, max = 100, message = "流程名称长度不能超过100个字符")
    private String workflowName;

    /**
     * 流程类型(PERSONAL:个人级别,SECTION:科级,GROUP:班组级,SEIZURE_REPORT:查获上报)
     */
    @Excel(name = "流程类型")
    @NotBlank(message = "流程类型不能为空")
    @Size(min = 0, max = 50, message = "流程类型长度不能超过50个字符")
    private String workflowType;

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

    /**
     * 状态(0正常 1停用)
     */
    @Excel(name = "状态", readConverterExp = "0=正常,1=停用")
    private String status;

    /**
     * 节点定义列表
     */
    @TableField(exist = false)
    private List<ApprovalNodeDefinition> nodes;

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

    public Long getId() {
        return id;
    }

    public void setWorkflowCode(String workflowCode) {
        this.workflowCode = workflowCode;
    }

    public String getWorkflowCode() {
        return workflowCode;
    }

    public void setWorkflowName(String workflowName) {
        this.workflowName = workflowName;
    }

    public String getWorkflowName() {
        return workflowName;
    }

    public void setWorkflowType(String workflowType) {
        this.workflowType = workflowType;
    }

    public String getWorkflowType() {
        return workflowType;
    }

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

    public String getDescription() {
        return description;
    }

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

    public String getStatus() {
        return status;
    }

    public List<ApprovalNodeDefinition> getNodes() {
        return nodes;
    }

    public void setNodes(List<ApprovalNodeDefinition> nodes) {
        this.nodes = nodes;
    }

    @Override
    public String toString() {
        return "ApprovalWorkflowDefinition{" +
                "id=" + id +
                ", workflowCode='" + workflowCode + '\'' +
                ", workflowName='" + workflowName + '\'' +
                ", workflowType='" + workflowType + '\'' +
                ", description='" + description + '\'' +
                ", status='" + status + '\'' +
                '}';
    }
}