package com.codvision.workflow.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;

/**
 * 流程表单
 * @author hxl
 */
@Data
@ApiModel
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("tbl_work_flow_form")
public class WorkFlowForm implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @NotBlank(message = "表单ID不能为空")
    @ApiModelProperty("表单ID")
    private Integer formId;

    @NotBlank(message = "流程定义ID不能为空")
    @ApiModelProperty("流程定义ID")
    private String definitionId;

    @ApiModelProperty("流程定义Key")
    private String definitionKey;

    @NotBlank(message = "元素唯一值不能为空")
    @ApiModelProperty("元素唯一值")
    private String elementKey;

    @NotBlank(message = "表单权限不能为空")
    @ApiModelProperty("表单权限")
    private String formAuthJson;

    @ApiModelProperty("主表单标志")
    private Boolean isStartForm;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty("创建时间")
    private Date createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty("更新时间")
    private Date updateTime;
}
