package com.njcn.bpm.pojo.param;

import com.njcn.common.pojo.constant.PatternRegex;
import com.njcn.web.constant.ValidMessage;
import com.njcn.web.pojo.param.BaseParam;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;


@Data
public class BpmModelParam implements Serializable {


    @ApiModelProperty("流程标识")
    @NotBlank(message = "流程标识不能为空")
    private String key;

    @ApiModelProperty("流程名称")
    @NotBlank(message = "流程名称不能为空")
    private String name;

    @ApiModelProperty( "流程图标")
    private String icon;

    @ApiModelProperty("流程分类")
    private String category;

    @ApiModelProperty("BPMN XML")
    private String bpmnXml;

    @ApiModelProperty("流程表单")
    private String formId;

    @ApiModelProperty("流程描述")
    private String description;

    private Integer formType;

    @ApiModelProperty("表单提交路由")
    private String formCustomCreatePath;

    @ApiModelProperty("表单查看路由")
    private String formCustomViewPath;

    /**
     * 更新操作实体
     */
    @Data
    @EqualsAndHashCode(callSuper = true)
    public static class BpmModelUpdateParam extends BpmModelParam {

        /**
         * 表Id
         */
        @ApiModelProperty("id")
        @NotBlank(message = ValidMessage.ID_NOT_BLANK)
        private String id;

    }


    /**
     * 分页查询实体
     */
    @Data
    @EqualsAndHashCode(callSuper = true)
    public static class BpmModelQueryParam extends BaseParam {

        @ApiModelProperty("流程标识")
        private String key;

        @ApiModelProperty("流程名称")
        private String name;

        @ApiModelProperty("流程分类")
        private String category;

    }

}
