package com.njcn.gather.aireport.testreportmulti.pojo.param;

import com.njcn.web.pojo.param.BaseParam;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

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

public class TestReportMultiParam {

    @Data
    @EqualsAndHashCode(callSuper = true)
    public static class QueryParam extends BaseParam {
        @ApiModelProperty("关键字，匹配批任务编号、压缩包文件名或台账汇总文件名")
        private String keyword;

        @ApiModelProperty("创建开始时间，yyyy-MM-dd HH:mm:ss")
        private String searchBeginTime;

        @ApiModelProperty("创建结束时间，yyyy-MM-dd HH:mm:ss")
        private String searchEndTime;

        @ApiModelProperty("整体生成状态")
        private Integer generateState;
    }

    @Data
    public static class CreateParam {
        @ApiModelProperty("多模板批任务编号")
        @NotBlank(message = "批任务编号不能为空")
        @Size(max = 64, message = "批任务编号不能超过64个字符")
        private String no;

        @ApiModelProperty("校验通过的会话ID")
        @NotBlank(message = "会话ID不能为空")
        private String sessionId;

        @ApiModelProperty("子报告配置列表")
        @NotEmpty(message = "子报告配置不能为空")
        private List<ChildReportItem> childReports;
    }

    @Data
    public static class ChildReportItem {
        @ApiModelProperty("压缩包一级模板目录名称")
        @NotBlank(message = "模板目录名称不能为空")
        @Size(max = 128, message = "模板目录名称不能超过128个字符")
        private String templateDirName;

        @ApiModelProperty("压缩包一级模板目录相对路径")
        @NotBlank(message = "模板目录路径不能为空")
        @Size(max = 255, message = "模板目录路径不能超过255个字符")
        private String templateDirPath;

        @ApiModelProperty("普测报告编号")
        @NotBlank(message = "普测报告编号不能为空")
        @Size(max = 32, message = "普测报告编号不能超过32个字符")
        private String no;

        @ApiModelProperty("委托单位ID")
        @NotBlank(message = "委托单位不能为空")
        private String clientUnitId;

        @ApiModelProperty("报告模板ID")
        @NotBlank(message = "报告模板不能为空")
        private String reportModelId;

        @ApiModelProperty("检测公司ID")
        @NotBlank(message = "检测公司不能为空")
        private String createUnit;

        @ApiModelProperty("合同编号")
        @NotBlank(message = "合同编号不能为空")
        @Size(max = 32, message = "合同编号不能超过32个字符")
        private String contractNumber;

        @ApiModelProperty("检测依据ID列表")
        @NotEmpty(message = "检测依据不能为空")
        private List<String> standard;

        @ApiModelProperty("联系电话")
        @Size(max = 32, message = "联系电话不能超过32个字符")
        private String phonenumber;
    }
}
