package org.springblade.file.pojo.dto;

import com.google.common.collect.Lists;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;

/**
 * 业务附件信息表 数据传输对象实体类
 *
 * @author BladeX
 * @since 2024-09-04
 */
@NoArgsConstructor
@AllArgsConstructor
@Data
@Schema(description = "业务附件批量新增明细参数")
@Builder
public class BusinessAttachmentBatchAddDetailDTO implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    /**
     * 业务code
     */
    @NotBlank(message = "业务编码不能为空")
    @Schema(description = "业务code")
    private String bizCode;
    /**
     * 附件id列表
     */
    @NotEmpty(message = "附件id列表不能为空")
    @Schema(description = "附件id列表")
    private List<@NotNull(message = "附件id不能为空") Long> attachmentIds;

    public BusinessAttachmentBatchAddDetailDTO(String bizCode, Long attachmentId) {
        this.bizCode = bizCode;
        this.attachmentIds = Lists.newArrayList(attachmentId);
    }
}
