package cn.axzo.workflow.common.model.response.bpmn.process;

import cn.axzo.workflow.common.enums.ApprovalMethodEnum;
import cn.axzo.workflow.common.enums.ApproverEmptyHandleTypeEnum;
import cn.axzo.workflow.common.enums.ApproverScopeEnum;
import cn.axzo.workflow.common.enums.ApproverSpecifyEnum;
import cn.axzo.workflow.common.enums.InitiatorSpecifiedRangeEnum;
import cn.axzo.workflow.common.model.request.bpmn.BpmnSignApproverLimit;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 发起流程前的节点列表中每个节点的模型配置信息
 *
 * @author wangli
 * @since 2025-03-26 09:40
 */
@ApiModel("发起流程前的节点列表中每个节点的模型配置信息")
@AllArgsConstructor
@NoArgsConstructor
@Data
@Builder
public class BpmnNodeConfigVO {
    /**
     * 审批方式, 审批节点与业务节点会有不同
     * <p>
     * human("human", "人工审批", ""),
     * autoPassed("autoPassed", "自动通过", "[仅审批节点可能选该值]"),
     * autoRejection("autoRejection", "自动驳回", "[仅审批节点可能选该值]"),
     * nobody("nobody", "不设置审批人", "[仅业务节点可能有该值]"),
     * bizSpecify("bizSpecify", "业务指定审批人", "[仅业务节点可能有该值]"),
     */
    @ApiModelProperty(value = "审批方式")
    private ApprovalMethodEnum approvalMethodEnum;

    /**
     * 审批人所在范围
     * <p>
     * entWorkspace("entWorkspace", "企业工作台", "entWorkspaceProcessor"),
     * govWorkspace("govWorkspace", "政务工作台", "govWorkspaceProcessor"),
     * projectWorkspace("projectWorkspace", "项目工作台","projectWorkspaceProcessor"),
     * preTaskUser("preTaskUser", "上节点审批人所在单位","preTaskUserProcessor"),
     * preTaskSpecified("preTaskSpecified", "上节点审批人指定","preTaskUserProcessor"),
     */
    @ApiModelProperty(value = "审批人所在范围")
    private ApproverScopeEnum approverScopeEnum;

    /**
     * 审批人指定
     * <p>
     * position("position", "指定岗位"),
     * role("role", "指定角色"),
     * identity("identity", "指定身份"),
     * fixedPerson("fixedPerson", "固定人员"), 如果节点是该类型，则该节点下的人，会默认回显至该上级模型属性中
     * initiatorLeader("initiatorLeader", "发起人主管"),
     * initiatorSpecified("initiatorSpecified", "发起人自选"),
     * <p>
     * // 新配置规则的审批人指定方式
     * position_v2("position_v2", "指定岗位", 2),
     * role_v2("role_v2", "指定角色", 2),
     * identity_v2("identity_v2", "指定身份", 2),
     * initiatorSpecified_v2("initiatorSpecified_v2", "发起人自选", 2),
     * initiator_v2("initiator_v2", "发起人自己", 2),
     * initiatorLeader_v2("initiatorLeader_v2", "发起人主管", 2),
     * fixedPerson_v2("fixedPerson_v2", "固定人员", 2),
     * pre_all_node_approver_v2("pre_all_node_approver_v2", "所有前序节点审批人", 2),
     */
    @ApiModelProperty(value = "审批人指定")
    private ApproverSpecifyEnum approverSpecifyEnum;

    /**
     * self_and_children_in_project("self_and_children_in_project", "项目内本组织及其下属组织所有成员"),
     * self_in_project("self_in_project", "项目内本组织所有成员"),
     * in_project("in_project", "项目内所有成员"),
     * in_ent("in_ent", "企业内所有成员"),
     */
    @ApiModelProperty(value = "任务节点: 当选择approverSpecifyEnum的值为 initiatorSpecified_v2，做的范围选择的值")
    private InitiatorSpecifiedRangeEnum initiatorSpecifyRange;

    @ApiModelProperty(value = "是否开起发起人的筛选策略")
    private Boolean initiatorSpecifiedFilter;
    /**
     * 需要排除的身份类型
     */
    @ApiModelProperty(value = "需要排除的身份类型")
    private List<String> excludeIdentityTypes;
    /**
     * 需要排查的参建单位类型
     */
    @ApiModelProperty(value = "需要排除的参建单位类型")
    private List<String> excludeCooperateShipTypes;
    /**
     * 审批人为空时的处理方式
     * <p>
     * autoPassed("autoPassed", "自动通过"),
     * autoRejection("autoRejection", "自动驳回"),
     * autoSkipped("autoSkipped", "自动跳过"),
     * transferToAdmin("transferToAdmin", "转交给管理员"),
     * specifyAssignee("specifyAssignee", "指定审批人"),
     */
    @ApiModelProperty(value = "审批人为空时的处理方式")
    private ApproverEmptyHandleTypeEnum approverEmptyHandleTypeEnum;

    /**
     * 是否开启电子签名
     */
    @ApiModelProperty(value = "是否开启电子签名")
    private Boolean signature;

    /**
     * 签署确认节点审批人限制规则
     */
    @ApiModelProperty(value = "签署确认节点审批人限制规则")
    private BpmnSignApproverLimit signApproverLimit;

}
