package kz.konturai.parser.repository;

import kz.konturai.parser.model.MarketingAnalysisV2Document;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

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

@Repository
public interface MarketingAnalysisV2Repository extends MongoRepository<MarketingAnalysisV2Document, String> {
    Optional<MarketingAnalysisV2Document> findById(String id);

    List<MarketingAnalysisV2Document> findByUserIdOrderByCreatedAtDesc(String userId);

    Optional<MarketingAnalysisV2Document> findByIdAndUserId(String id, String userId);

    Optional<MarketingAnalysisV2Document> findByAnalysisId(String analysisId);

    List<MarketingAnalysisV2Document> findByUserId(String userId);
}
