package com.fizz.business.form;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

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

@Getter
@Setter
public class AddDefectForm implements Serializable {
    @NotNull(message = "计划id不能为空")
    @Schema(description = "计划id")
    private Long planId;
    @NotBlank(message = "计划号不能为空")
    @Schema(description = "计划号")
    private String planNo;
    @NotBlank(message = "钢卷号不能为空")
    @Schema(description = "钢卷号")
    private String entryMatId;

    @Valid
    @Schema(description = "缺陷列表")
    private List<DefectInfo> defectList;

    @Getter
    @Setter
    public static class DefectInfo {
        @NotBlank(message = "缺陷代码不能为空")
        @Schema(description = "缺陷代码")
        private String defectCode;
        @NotBlank(message = "缺陷名称不能为空")
        @Schema(description =  "缺陷名称")
        private String defectName;
        @Schema(description =  "缺陷描述")
        private String defectDesc;
    }
}
