package cn.ey.biz.module.system.controller.admin.code.vo;

import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.Size;
import java.util.List;

@Data
public class CodeOtherVO {


    private List<@Valid Rule> rules;

    @Size(max = 200, message = "说明最多200个字符")
    private String explanation;

    @Data
    @Valid
    public static class Rule {

        @Size(max = 200, message = "country最多200个字符")
        private String country;

        @Size(max = 200, message = "业务线最多200个字符")
        private String sl;

        @Size(max = 200, message = "region最多200个字符")
        private String region;

        @Valid
        private Condition condition;

        @Size(max = 10, message = "需求最多200个字符")
        private List<@Valid Condition> requests;
    }

    @Data
    @Valid
    public static class Condition {

        @Size(max = 100, message = "relation最多100个字符")
        private String relation;

        @Size(max = 10, message = "目标最多10个")
        private List<@Size(max = 100, message = "目标最多100个字符") String> targets;

        @Size(max = 100, message = "类型最多100个字符")
        private String type;

        @Size(max = 10, message = "Code最多10个")
        private List<@Size(max = 100, message = "code最多100个字符") String> codes;
    }
}
