package br.gov.sigefp.rh.repository;

import br.gov.sigefp.rh.domain.Agent;
import br.gov.sigefp.rh.domain.AgentContract;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

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

@Repository
public interface AgentContractRepository extends JpaRepository<AgentContract, UUID> {
    List<AgentContract> findByAgentId(UUID agentId);

    List<AgentContract> findByAgentIdAndIsActiveTrue(UUID agentId);

    Optional<AgentContract> findByAgentAndIsActiveTrue(Agent agent);

    List<AgentContract> findByAgentIdIn(List<UUID> agentIds);

    List<AgentContract> findAllByAgentIdInAndIsActiveTrue(List<UUID> agentIds);
}
