package cn.stylefeng.workflow.instance.modular.business.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.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 BusinessLinkRequest extends BaseRequest {

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

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

    @NotBlank(message = "业务的唯一编码", groups = {add.class, edit.class})
    @ChineseDescription("业务的唯一编码，一般用这个编码进行流程发起")
    @TableUniqueValue(message = "业务的唯一编码不能重复",
            groups = {add.class, edit.class},
            tableName = "flow_business_link",
            columnName = "business_code",
            idFieldName = "flow_business_id",
            excludeLogicDeleteItems = true)
    private String businessCode;

    @NotNull(message = "流程分类的id不能为空", groups = {add.class, edit.class})
    @ChineseDescription("流程分类的id")
    private Long flowCategoryId;

    @NotNull(message = "关联的流程模型id不能为空", groups = {add.class, edit.class})
    @ChineseDescription("关联的流程模型id")
    private Long flowModelId;

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

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

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

}
