package kz.konturai.parser.repository;

import kz.konturai.parser.model.TargetingCampaign;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;
import java.util.List;

@Repository
public interface TargetingCampaignRepository extends MongoRepository<TargetingCampaign, String> {

    List<TargetingCampaign> findByUserId(String userId);

    Page<TargetingCampaign> findByUserIdOrderByCreatedAtDesc(String userId, Pageable pageable);

    List<TargetingCampaign> findByUserIdAndStatus(String userId, String status);

    List<TargetingCampaign> findByAnalysisId(String analysisId);

    List<TargetingCampaign> findByStrategyId(String strategyId);

    List<TargetingCampaign> findAllByStatusAndUpdatedAtBefore(String status, LocalDateTime date);
}
