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

import cn.axzo.workflow.common.constraint.AttachmentTypeValidator;
import cn.axzo.workflow.common.constraint.AttachmentValidator;
import cn.axzo.workflow.common.enums.AttachmentTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;

/**
 * 审批节点退回模型
 *
 */
@ApiModel("审批节点退回模型")
@Data
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class BpmnNodeBackSystemOperateDTO implements Serializable {

    private static final long serialVersionUID = -4160538355403179298L;

    @ApiModelProperty(value = "流程实例id", required = true)
    @NotBlank(message = "流程实例id不能为空")
    private String processInstanceId;

    @ApiModelProperty(value = "当前流程节点id", required = true)
    @NotBlank(message = "当前节点id不能为空")
    private String currentActivityId;

    @ApiModelProperty(value = "目标流程节点id", required = true)
    @NotBlank(message = "目标流程节点id不能为空")
    private String toActivityId;

    @ApiModelProperty(value = "可以指定任务处理", required = true)
    private List<String> targetTaskIds;

    @ApiModelProperty(value = "意见")
    private String advice;

    @ApiModelProperty(value = "操作描述")
    private String operationDesc;

    @ApiModelProperty(value = "操作人")
    private BpmnTaskDelegateAssigner operator;

    /**
     * 附件列表
     */
    @ApiModelProperty(value = "附件列表")
    @Size(max = 11, message = "附件数量超过限制")
    @AttachmentValidator(types = {
            @AttachmentTypeValidator(type = AttachmentTypeEnum.image, max = 5),
            @AttachmentTypeValidator(type = AttachmentTypeEnum.file, max = 5),
            @AttachmentTypeValidator(type = AttachmentTypeEnum.signature, max = 1)}
    )
    private List<AttachmentDTO> attachmentList;

}
