package cn.stylefeng.team.view.modular.pojo.request;

import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest;
import cn.stylefeng.team.view.api.pojo.ViewConfig;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.List;

@EqualsAndHashCode(callSuper = true)
@Data
public class ViewRequest extends BaseRequest {

    @NotNull(message = "模型id不能为空", groups = {edit.class, delete.class, detail.class, saveViewConfig.class})
    @ChineseDescription("模型id")
    private Long viewId;

    @NotNull(message = "所属业务分类id不能为空", groups = {add.class, edit.class})
    @ChineseDescription("所属业务分类id")
    private Long businessCategoryId;

    @NotNull(message = "所属业务id不能为空", groups = {add.class, edit.class, page.class, formFieldSearch.class})
    @ChineseDescription("所属业务id")
    private Long businessId;

    @NotBlank(message = "视图名称不能为空", groups = {add.class, edit.class})
    @ChineseDescription("视图名称")
    private String viewName;

    @NotBlank(message = "视图编码不能为空", groups = {add.class, edit.class})
    @ChineseDescription("视图编码")
    private String viewCode;

    @NotNull(message = "系统编码，这里用十进制存储不能为空", groups = {add.class})
    @ChineseDescription("系统编码，这里用十进制存储")
    private Integer systemCode;

    @NotBlank(message = "系统编码，用于展示不能为空", groups = {add.class})
    @ChineseDescription("系统编码，用于展示")
    private String systemCodeShow;

    @ChineseDescription("项目描述")
    private String description;

    @NotNull(message = "视图类型：1-列表视图，2-其他视图不能为空", groups = {add.class, edit.class})
    @ChineseDescription("视图类型：1-列表视图，2-其他视图")
    private Integer viewType;

    @ChineseDescription("排序")
    private BigDecimal fldSort;

    @NotNull(message = "批量删除id集合不能为空", groups = batchDelete.class)
    @ChineseDescription("批量删除用的id集合")
    private List<Long> batchDeleteIdList;

    @NotNull(message = "视图配置不能为空", groups = saveViewConfig.class)
    @ChineseDescription("视图配置")
    private ViewConfig viewConfig;

    public @interface saveViewConfig {
    }

    public @interface formFieldSearch {
    }

}
