package br.gov.sigefp.rh.repository;

import br.gov.sigefp.rh.domain.Agent;
import br.gov.sigefp.rh.domain.AgentBankAccount;
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 AgentBankAccountRepository extends JpaRepository<AgentBankAccount, UUID> {

    List<AgentBankAccount> findByAgentId(UUID agentId);

    Optional<AgentBankAccount> findByAgentIdAndIsPrimaryTrue(UUID agentId);

    Optional<AgentBankAccount> findByAgentAndIsPrimaryTrue(Agent agent);

    List<AgentBankAccount> findAllByAgentIdInAndIsPrimaryTrue(List<UUID> agentIds);
}
