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

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.validation.annotation.Validated;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 审批任务节点的入参模型
 *
 * @author wangli
 */
@ApiModel("审批任务节点的入参模型")
@Data
@Validated
public class BpmnTaskAuditDTO {

    @ApiModelProperty(value = "任务编号", required = true, example = "1024")
    @NotEmpty(message = "任务编号不能为空")
    private String taskId;

    /**
     * 评论信息
     */
    @ApiModelProperty(value = "审批意见")
    private String advice;

    /**
     * 附件列表
     */
    @ApiModelProperty(value = "附件列表")
    private List<AttachmentDTO> attachmentList;

    /**
     * 手写签名图片地址
     */
    @ApiModelProperty(value = "手写签名url")
    private String signatureUrl;

    /**
     * 当前审核人信息
     */
    @ApiModelProperty(value = "当前审核人信息", notes = "可为空,则该任务不验证用户归属")
    @Valid
    @NotNull(message = "审批人不能为空")
    private BpmnTaskDelegateAssigner approver;

    /**
     * 下级审批人
     */
    @ApiModelProperty(value = "下级审批人信息", notes = "可为空,定义选择审批人,如果不为空,则覆盖下一级任务的审核人")
    //    @Valid
    private BpmnTaskDelegateAssigner nextApprover;

    /**
     * 是否异步执行
     */
    @ApiModelProperty(value = "是否异步", notes = "异步时,只接收请求便返回数据")
    private Boolean async = true;
}
