package org.raddatz.familienarchiv.document.annotation;

import org.raddatz.familienarchiv.document.annotation.DocumentAnnotation;
import org.springframework.data.jpa.repository.JpaRepository;

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

public interface AnnotationRepository extends JpaRepository<DocumentAnnotation, UUID> {

    List<DocumentAnnotation> findByDocumentId(UUID documentId);

    List<DocumentAnnotation> findByDocumentIdAndPageNumber(UUID documentId, int pageNumber);

    Optional<DocumentAnnotation> findByIdAndDocumentId(UUID id, UUID documentId);

    List<DocumentAnnotation> findByDocumentIdAndFileHashIsNull(UUID documentId);
}
