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

import at.procon.dip.domain.time.entity.TimeEntrySourceLink;
import at.procon.dip.domain.time.entity.TimeSourceSystem;
import java.util.List;
import java.util.Optional;
import java.util.UUID;
import org.springframework.data.jpa.repository.JpaRepository;

public interface TimeEntrySourceLinkRepository extends JpaRepository<TimeEntrySourceLink, UUID> {

    List<TimeEntrySourceLink> findByTimeEntry_Id(UUID timeEntryId);

    Optional<TimeEntrySourceLink> findByTimeEntry_IdAndSourceSystemAndSourceEntityTypeAndSourceExternalId(
            UUID timeEntryId, TimeSourceSystem sourceSystem, String sourceEntityType, String sourceExternalId);
}
