package cn.axzo.workflow.common.model.request.form.definition;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import java.util.List;

/**
 * 特殊的模型,对应 Flowable Engine 中的 {@see org.flowable.form.model.SimpleFormModel}
 *
 * @author wangli
 * @since 2023/7/24 22:36
 */
@Data
public class FormDefinitionDTO {

    /**
     * 表单名称
     */
    @ApiModelProperty(value = "表单定义的名称")
    @NotBlank(message = "表单定义名称不能为空")
    private String name;

    @ApiModelProperty(value = "表单定义的标识")
    @NotBlank(message = "表单定义标识不能为空")
    private String key;

    @ApiModelProperty(value = "表单的版本")
    private int version;

    @ApiModelProperty(value = "表单定义的具体字段项", example = "[{'': '''}]")
    @Valid
    private List<FormFieldDTO> fields;

    @ApiModelProperty(value = "描述")
    private String description;

}
