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

import cn.axzo.workflow.common.constraint.AttachmentTypeValidator;
import cn.axzo.workflow.common.constraint.AttachmentValidator;
import cn.axzo.workflow.common.enums.AttachmentTypeEnum;
import cn.axzo.workflow.common.model.request.bpmn.task.AttachmentDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;
import java.util.List;

/**
 * 抄送流程实例的入参模型
 *
 * @author wangli
 * @since 11/03/2024 18:32
 */
@ApiModel("抄送流程实例的入参模型")
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class BpmnProcessInstanceCarbonCopyDTO {

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

    /**
     * 抄送意见
     */
    @ApiModelProperty(value = "抄送意见")
    private String advice;

    /**
     * 附件列表
     */
    @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;

    /**
     * 被抄送人员
     */
    @ApiModelProperty(value = "被抄送人员")
    @NotEmpty(message = "被抄送人不能为空")
    private List<BpmnTaskDelegateAssigner> copyAssigners;
}
