From 4a737a8ce9e8792d95fd16404fe79ff36917523e Mon Sep 17 00:00:00 2001 From: "Jaemin.Park" Date: Sun, 6 Aug 2023 20:09:19 +0900 Subject: [PATCH] Fix checking first attendance api --- .../com/mashup/moit/domain/attendance/AttendanceRepository.kt | 2 +- .../com/mashup/moit/domain/attendance/AttendanceService.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/moit-domain/src/main/kotlin/com/mashup/moit/domain/attendance/AttendanceRepository.kt b/moit-domain/src/main/kotlin/com/mashup/moit/domain/attendance/AttendanceRepository.kt index 58b420bc..cac7bb35 100644 --- a/moit-domain/src/main/kotlin/com/mashup/moit/domain/attendance/AttendanceRepository.kt +++ b/moit-domain/src/main/kotlin/com/mashup/moit/domain/attendance/AttendanceRepository.kt @@ -8,5 +8,5 @@ interface AttendanceRepository : JpaRepository { fun findByUserIdAndStudyId(userId: Long, studyId: Long): AttendanceEntity? fun findAllByStudyIdOrderByAttendanceAtAsc(studyId: Long): List fun findAllByStudyIdAndStatus(studyId: Long, status: AttendanceStatus): List - fun existsByStudyIdAndStatus(studyId: Long, status: AttendanceStatus): Boolean + fun existsByStudyIdAndStatusNot(studyId: Long, status: AttendanceStatus): Boolean } diff --git a/moit-domain/src/main/kotlin/com/mashup/moit/domain/attendance/AttendanceService.kt b/moit-domain/src/main/kotlin/com/mashup/moit/domain/attendance/AttendanceService.kt index 236ae8f9..4f6bc4dc 100644 --- a/moit-domain/src/main/kotlin/com/mashup/moit/domain/attendance/AttendanceService.kt +++ b/moit-domain/src/main/kotlin/com/mashup/moit/domain/attendance/AttendanceService.kt @@ -57,7 +57,7 @@ class AttendanceService( } fun existFirstAttendanceByStudyId(studyId: Long): Boolean { - return attendanceRepository.existsByStudyIdAndStatus(studyId, AttendanceStatus.ATTENDANCE) + return attendanceRepository.existsByStudyIdAndStatusNot(studyId, AttendanceStatus.UNDECIDED) } @Transactional