diff --git a/src/main/kotlin/uoslife/servermeeting/match/dao/MatchedDao.kt b/src/main/kotlin/uoslife/servermeeting/match/dao/MatchedDao.kt index a5aed6e7..8c0bec01 100644 --- a/src/main/kotlin/uoslife/servermeeting/match/dao/MatchedDao.kt +++ b/src/main/kotlin/uoslife/servermeeting/match/dao/MatchedDao.kt @@ -50,8 +50,7 @@ class MatchedDao(private val queryFactory: JPAQueryFactory) { .mapValues { (_, userTeams) -> userTeams.all { userTeam -> val payments = userTeam.team.payments - payments?.isNotEmpty() == true && - payments.all { it.status == PaymentStatus.SUCCESS } + payments?.any { it.status == PaymentStatus.SUCCESS } ?: false } } diff --git a/src/main/kotlin/uoslife/servermeeting/match/service/MatchingService.kt b/src/main/kotlin/uoslife/servermeeting/match/service/MatchingService.kt index 96f565c1..6c1fcc37 100644 --- a/src/main/kotlin/uoslife/servermeeting/match/service/MatchingService.kt +++ b/src/main/kotlin/uoslife/servermeeting/match/service/MatchingService.kt @@ -49,10 +49,10 @@ class MatchingService( ?: throw MeetingTeamNotFoundException() val meetingTeam = userTeam.team - val hasInvalidPayment = - meetingTeam.payments?.any { payment -> payment.status != PaymentStatus.SUCCESS } + val hasValidPayment = + meetingTeam.payments?.any { payment -> payment.status == PaymentStatus.SUCCESS } ?: false - if (hasInvalidPayment) { + if (!hasValidPayment) { throw PaymentNotFoundException() }