Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ class MentorDashboardService(

val menteeIds = mentees.map { it.id!! }

val unsubmittedMenteeIds = taskRepository
.findMenteeIdsWithUnsubmittedTasks(menteeIds, date)
val incompletedMenteeIds = taskRepository
.findMenteeIdsWithIncompletedTasks(menteeIds, date)
.toSet()

val recentTaskByMenteeId = taskRepository
Expand All @@ -98,7 +98,7 @@ class MentorDashboardService(
subjects = mentee.subjects.map { it.subject },
recentTaskDate = recentTask?.date,
recentTaskName = recentTask?.name,
submitted = mentee.id!! !in unsubmittedMenteeIds
submitted = mentee.id!! !in incompletedMenteeIds
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,13 @@ interface TaskRepository : JpaRepository<Task, Long> {
"""
SELECT DISTINCT t.mentee.id
FROM Task t
LEFT JOIN t.proofShots ps
WHERE t.mentee.id IN :menteeIds
AND t.date = :date
AND t.isResource = false
AND ps.id IS NULL
AND t.completed = false
"""
)
fun findMenteeIdsWithUnsubmittedTasks(menteeIds: List<Long>, date: LocalDate): List<Long>
fun findMenteeIdsWithIncompletedTasks(menteeIds: List<Long>, date: LocalDate): List<Long>

@Query(
"""
Expand Down