package at.procon.dip.domain.document.repository;

import at.procon.dip.domain.document.SourceType;
import at.procon.dip.domain.document.entity.DocumentSource;
import java.util.List;
import java.util.Optional;
import java.util.UUID;
import org.springframework.data.jpa.repository.JpaRepository;

public interface DocumentSourceRepository extends JpaRepository<DocumentSource, UUID> {

    List<DocumentSource> findByDocument_Id(UUID documentId);

    List<DocumentSource> findBySourceType(SourceType sourceType);

    Optional<DocumentSource> findByExternalSourceId(String externalSourceId);

    Optional<DocumentSource> findBySourceTypeAndExternalSourceId(SourceType sourceType, String externalSourceId);
}
