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 @@ -54,7 +54,7 @@ class MentorDashboardController(
summary = "학습 미이행(업로드 미제출) 멘티 전체 조회",
description = """
멘토가 담당하는 멘티 중,
오늘에 해당하는 과제는 존재하지만 인증 사진을 아직 업로드하지 않은 멘티를 조회합니다.
오늘에 해당하는 과제는 존재하지만 아직 완료하지 않은 멘티를 조회합니다.

[요청]
date: 기준 날짜(yyyy-MM-dd)
Expand All @@ -70,7 +70,7 @@ class MentorDashboardController(
@RequestParam @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) date: LocalDate
): ResponseEntity<TaskUnfinishedSummaryResponse> {
val mentorId = principal.userId
val response = mentorDashboardService.getTaskUnfinishedMentees(mentorId, date)
val response = mentorDashboardService.getTaskIncompletedMentees(mentorId, date)
return ResponseEntity.ok(response)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ class MentorDashboardService(
}

@Transactional(readOnly = true)
fun getTaskUnfinishedMentees(
fun getTaskIncompletedMentees(
mentorId: Long,
date: LocalDate
): TaskUnfinishedSummaryResponse {
userRepository.findById(mentorId)
.orElseThrow { IllegalArgumentException(USER_NOT_FOUND.message) }

val taskCount = taskRepository.countUnfinishedTasks(mentorId, date)
val mentees = taskRepository.findTaskUnfinishedMentees(
val mentees = taskRepository.findTaskIncompletedMentees(
mentorId = mentorId,
date = date
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package goodspace.bllsoneshot.notification.dto.response

import goodspace.bllsoneshot.entity.assignment.NotificationStatus
import goodspace.bllsoneshot.entity.assignment.NotificationType
import goodspace.bllsoneshot.entity.assignment.Subject
import java.time.LocalDate
import java.time.LocalDateTime

Expand All @@ -12,6 +13,8 @@ data class NotificationResponse(
val message: String,
val status: NotificationStatus,
val taskId: Long?,
val taskSubject: Subject?,
val taskName: String?,
val learningReportId: Long?,
val learningReportStartDate: LocalDate?,
val learningReportEndDate: LocalDate?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ class NotificationMapper {
message = notification.message,
status = notification.status,
taskId = notification.task?.id,
taskSubject = notification.task?.subject,
taskName = notification.task?.name,
learningReportId = notification.learningReport?.id,
learningReportStartDate = notification.learningReport?.startDate,
learningReportEndDate = notification.learningReport?.endDate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,14 @@ interface TaskRepository : JpaRepository<Task, Long> {
)
FROM Task t
JOIN t.mentee m
LEFT JOIN t.proofShots ps
WHERE m.mentor.id = :mentorId
AND t.date = :date
AND t.isResource = false
AND ps.id IS NULL
AND t.completed = false
ORDER BY m.name
"""
)
fun findTaskUnfinishedMentees(
fun findTaskIncompletedMentees(
mentorId: Long,
date: LocalDate
): List<PendingUploadMenteeResponse>
Expand All @@ -137,11 +136,10 @@ interface TaskRepository : JpaRepository<Task, Long> {
"""
SELECT COUNT(DISTINCT t.id)
FROM Task t
LEFT JOIN t.proofShots ps
WHERE t.mentee.mentor.id = :mentorId
AND t.date = :date
AND t.isResource = false
AND ps.id IS NULL
AND t.completed = false
"""
)
fun countUnfinishedTasks(mentorId: Long, date: LocalDate): Long
Expand Down