package com.dne.ems.repository;

import com.dne.ems.dto.HeatmapPointDTO;
import com.dne.ems.dto.PollutionStatsDTO;
import com.dne.ems.model.Feedback;
import com.dne.ems.model.enums.FeedbackStatus;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

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

public interface FeedbackRepository {

    Feedback save(Feedback feedback);

    List<Feedback> saveAll(Iterable<Feedback> feedbacks);

    Optional<Feedback> findById(Long id);
    
    List<Feedback> findAll();

    void deleteAll();
    
    long count();

    Optional<Feedback> findByEventId(String eventId);

    List<Feedback> findByStatus(FeedbackStatus status);

    long countByStatus(FeedbackStatus status);

    List<HeatmapPointDTO> getHeatmapData();

    List<PollutionStatsDTO> countByPollutionType();
    
    Page<Feedback> findBySubmitterId(Long submitterId, Pageable pageable);

    List<Feedback> findBySubmitterId(Long submitterId);

    long countBySubmitterId(Long submitterId);

    long countByStatusAndSubmitterId(FeedbackStatus status, Long submitterId);
} // End of FeedbackRepository interface 