package com.mosquito.project.permission;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

/**
 * 审批流程配置Repository
 */
@Repository
public interface ApprovalFlowRepository extends JpaRepository<SysApprovalFlow, Long> {

    Optional<SysApprovalFlow> findByFlowCodeAndStatus(String flowCode, String status);

    List<SysApprovalFlow> findByStatus(String status);

    Optional<SysApprovalFlow> findByTriggerEvent(String triggerEvent);

    Optional<SysApprovalFlow> findByTriggerEventAndStatus(String triggerEvent, String status);
}
