package br.gov.sigefp.org.repository;

import br.gov.sigefp.org.domain.Ministry;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.Optional;
import java.util.UUID;

@Repository
public interface MinistryRepository extends JpaRepository<Ministry, UUID> {
    
    Optional<Ministry> findByCode(String code);
    
    boolean existsByCode(String code);

    Page<Ministry> findAllByIsActiveTrue(Pageable pageable);
}

