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


import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * 字典分类 Base VO，提供给添加、修改、详细的子 VO 使用
 * 如果子 VO 存在差异的字段，请不要添加到这里，影响 Swagger 文档生成
 */
@Data
public class CategoryBaseVO {

    @ApiModelProperty(value = "类型")
    private String type;

    @ApiModelProperty(value = "编码")
    @NotBlank(message = "类型编码不能为空")
    @Size(max = 100, message = "类型编码长度不能超过100个字符")
    private String code;

    @ApiModelProperty(value = "类型名称")
    @NotBlank(message = "类型名称不能为空")
    @Size(max = 32, message = "字典标签长度不能超过32个字符")
    private String name;

    @ApiModelProperty(value = "系统数据标识")
    private String sysFlag;

    @ApiModelProperty(value = "状态（0正常 1停用）", required = true)
    @NotNull(message = "状态（0正常 1停用）不能为空")
    private Integer status;

    @ApiModelProperty(value = "备注")
    @Size(max = 200, message = "备注最长200个字符")
    private String remark;


    @ApiModelProperty(value = "所属主题", example = "TIME")
    private String categoryTheme;

    @ApiModelProperty(value = "所属应用", example = "timesheet", required = true)
    @NotBlank(message = "所属应用不能为空", groups = Update.class)
    private String ownerApp;

    @ApiModelProperty(value = "存储类型", example = "0", required = true, notes = "0-聚合 ;1 独立")
    @NotNull(message = "存储类型不能为空", groups = Update.class)
    private Integer storeType;

    @ApiModelProperty(value = "存储表名", example = "system_category_data", notes = "如果存储类型为1 则必填,否则为system_category_data")
    private String storeTableName;

    @ApiModelProperty(value = "版本号", example = "1")
    @NotNull(message = "版本号不能为空", groups = Update.class)
    private Long categoryVersion;

    @ApiModelProperty(value = "是否最新版本", example = "1", notes = "0-否 1-是")
    private Integer isNewVersion;

    @ApiModelProperty(value = "是否可以修改", example = "1", notes = "0-否 1-是")
    @NotNull(message = "是否可以修改不能为空", groups = Update.class)
    private Integer isModify;

    @ApiModelProperty(value = "是否有版本控制", example = "1", notes = "0-否 1-是")
    @NotNull(message = "是否有版本控制不能为空", groups = Update.class)
    private Integer isVersionControl;

    public interface Update {
    }

}
