package com.agendaestudantil.repositorio; import com.agendaestudantil.entidade.Tarefa; import org.springframework.data.mongodb.repository.MongoRepository; import org.springframework.data.mongodb.repository.Query; import org.springframework.stereotype.Repository; import java.time.LocalDate; import java.util.List; @Repository public interface TarefaRepositorio extends MongoRepository { List findByEstudanteId(String estudanteId); List findByEstudanteIdAndStatus(String estudanteId, Tarefa.StatusTarefa status); List findByDisciplinaId(String disciplinaId); @Query("{'estudanteId': ?0, 'dataEntrega': ?1}") List findByEstudanteIdAndDataEntrega(String estudanteId, LocalDate data); @Query("{'estudanteId': ?0, 'dataEntrega': {$gte: ?1, $lte: ?2}}") List findByEstudanteIdAndDataEntregaBetween(String estudanteId, LocalDate inicio, LocalDate fim); @Query("{'estudanteId': ?0, 'status': {$ne: ?1}}") List findTarefasPendentesByEstudanteId(String estudanteId, Tarefa.StatusTarefa status); @Query("{'status': {$ne: 'CONCLUIDA'}, 'dataEntrega': {$gte: ?0, $lte: ?1}}") List findTarefasNaoConcluidasComDataEntre(LocalDate inicio, LocalDate fim); void deleteByEstudanteId(String estudanteId); }