package at.procon.dip.clustering.service;

import at.procon.dip.clustering.dto.EmbeddingSelectionSpec;
import at.procon.dip.clustering.dto.SelectedEmbeddingRow;
import at.procon.dip.clustering.repository.DocumentEmbeddingClusterSelectionRepository;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class EmbeddingSelectionService {

    private final DocumentEmbeddingClusterSelectionRepository selectionRepository;

    public long count(EmbeddingSelectionSpec spec) {
        return selectionRepository.countSelection(spec);
    }

    public List<SelectedEmbeddingRow> load(EmbeddingSelectionSpec spec) {
        return selectionRepository.findSelection(spec);
    }
}
