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 CodeBlockingLevelVO {

    @Size(max = 100, message = "最多100条规则")
    private List<@Valid Rule> rules;

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

    @Data
    @Valid
    public static class Rule {

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

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

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

        @Size(max = 100, message = "最多100个条件")
        private List<@Valid Condition> condition;
    }

    @Data
    @Valid
    public static class Condition {

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

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

        private FormOption formOption;

        private List<Lgbu> lgbuList;

//        @Size(max = 100, message = "bu最多100个条件")
//        private List<@Size(max = 100, message = "bu最多100个字符") String> bu;

//        @Size(max = 100, message = "legalEntity最多100个条件")
//        private List<@Size(max = 100, message = "legalEntity最多100个字符") String> legalEntity;


    }

    @Data
    @Valid
    public static class FormOption {
        private boolean emptyBtn;
        private boolean submitBtn;
        private boolean menuBtn;
        private Integer labelWidth;
        private List<Column> column;
    }

    @Data
    @Valid
    public static class Column {
        private String label;
        private String prop;
        private Integer span;
    }

    @Data
    @Valid
    public static class Lgbu {
        private List<List<String>> lgbu;
    }
}
