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

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

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

/**
 * 评论的入参模型
 *
 * @author wangli
 * @since 2023/7/29 17:25
 */
@ApiModel("评论的入参模型")
@Data
public class BpmnTaskCommentDTO implements Serializable {

    /**
     * 流程实例 ID
     */
    @ApiModelProperty(value = "流程实例 ID")
    @NotBlank(message = "流程实例 ID 不能为空")
    private String processInstanceId;

    /**
     * 评论人
     */
    @ApiModelProperty(value = "评论人")
    @Valid
    @NotNull(message = "评论人不能为空")
    private BpmnTaskDelegateAssigner operator;

    /**
     * 评论内容
     */
    @ApiModelProperty(value = "评论内容")
    @NotBlank(message = "评论内容不能为空")
    @Length(max = 100, message = "内容最长不超过 100 个字符")
    private String comment;

    /**
     * 评论扩展信息
     */
    @ApiModelProperty(value = "评论扩展信息", notes = "例如任务协同的评分")
    private BpmnTaskCommentExtDTO commentExt;

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

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

}
