package cn.axzo.workflow.common.model.request.bpmn.model;

import cn.axzo.workflow.common.model.request.bpmn.BpmnJsonModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
 * 创建流程模型的入参模型
 */
@ApiModel("创建流程模型的入参模型")
@Data
@Accessors(chain = true)
public class BpmnModelCreateDTO implements Serializable {

    @ApiModelProperty(value = "流程模型标识", example = "process_key", hidden = true)
    @Length(max = 255, message = "流程标识最长只支持255个字符")
    private String key;

    /**
     * 流程名称
     */
    @ApiModelProperty(value = "流程名称", required = true, example = "模板流程名称")
    @NotBlank(message = "流程名称不能为空")
    @Length(max = 32, message = "流程名称最长只支持32个字符")
    private String name;

    /**
     * 自定义分类
     */
    @ApiModelProperty(value = "自定义分类", notes = "由业务自定义")
    @NotBlank(message = "自定义分类不能为空")
    private String category;

    /**
     * 描述
     */
    @ApiModelProperty(value = "描述", notes = "存放与底层模型中 meta_info 中")
    private String description;

    @ApiModelProperty(value = "流程模型的 Json 结构")
    @Valid
    private BpmnJsonModel jsonModel;

    /**
     * 租户Id
     */
    @ApiModelProperty(value = "租户Id", example = "1")
    private String tenantId = "";
}
