package com.mooctest.dao;

import com.mooctest.model.MasterReport;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional
public interface MasterReportDao extends MongoRepository<MasterReport, Long> {

    List<MasterReport> findByMasterId(String masterId);

    List<MasterReport> findByMasterIdIn(List<String> masterIds);

    List<MasterReport> findByExamIdAndCaseId(long examId, long caseId);

    List<MasterReport> findByBugIdIn(List<String> bugIds);

    MasterReport findByBugId(String bugId);

    long countByExamIdAndCaseId(long examId, long caseId);

    long countByExamIdAndCaseIdAndStatus(long examId, long caseId, int status);

    void deleteByExamIdAndCaseId(long examId, long caseId);
}
