package cn.stylefeng.workflow.design.modular.pojo.request;

import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest;
import cn.stylefeng.roses.kernel.validator.api.validators.unique.TableUniqueValue;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.Set;

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

    @NotNull(message = "主键不能为空", groups = {detail.class, edit.class, delete.class, upgradeVersion.class})
    @ChineseDescription("主键")
    private Long modelId;

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

    @ChineseDescription("模型名称")
    @TableUniqueValue(message = "模型名称不能重复",
            groups = {add.class, edit.class},
            tableName = "flow_design_model",
            columnName = "model_name",
            idFieldName = "model_id",
            excludeLogicDeleteItems = true)
    private String modelName;

    @ChineseDescription("模型编码")
    @TableUniqueValue(message = "模型编码不能重复",
            groups = {add.class, edit.class},
            tableName = "flow_design_model",
            columnName = "model_code",
            idFieldName = "model_id",
            excludeLogicDeleteItems = true)
    private String modelCode;

    @ChineseDescription("图标类型：1-文件id，2-选择图片")
    private Integer modelIconType;

    @ChineseDescription("模型图标，存icon编号对应前端资源")
    private String modelIcon;

    @ChineseDescription("模型图标，自定义上传文件id")
    private Long modelIconFileId;

    @ChineseDescription("说明")
    private String remark;

    @ChineseDescription("状态：1-启用，2-停用")
    private Integer statusFlag;

    @ChineseDescription("是否隐藏流程：Y-隐藏，N-不隐藏")
    private String hiddenFlag;

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

    @ChineseDescription("流程管理员的用户id")
    private Long managerUserId;

    private boolean openAuthValidate = false;

    private Set<Long> userHaveAuthFlowModelIdList;

    public @interface upgradeVersion {
    }

}
