diff --git a/src/main/java/com/pickple/server/api/moimsubmission/repository/MoimSubmissionRepository.java b/src/main/java/com/pickple/server/api/moimsubmission/repository/MoimSubmissionRepository.java index 88be28ed..5cb4dec4 100644 --- a/src/main/java/com/pickple/server/api/moimsubmission/repository/MoimSubmissionRepository.java +++ b/src/main/java/com/pickple/server/api/moimsubmission/repository/MoimSubmissionRepository.java @@ -8,7 +8,7 @@ import org.springframework.data.repository.query.Param; public interface MoimSubmissionRepository extends JpaRepository { - boolean existsByMoimAndMoimSubmissionStateAndGuestId(Moim moim, String moimSubmissionState, Long guestId); + boolean existsByMoimAndGuestId(Moim moim, Long guestId); List findAllByGuestId(Long guestId); diff --git a/src/main/java/com/pickple/server/api/moimsubmission/service/MoimSubmissionCommandService.java b/src/main/java/com/pickple/server/api/moimsubmission/service/MoimSubmissionCommandService.java index 29cddc0c..5a60d7e8 100644 --- a/src/main/java/com/pickple/server/api/moimsubmission/service/MoimSubmissionCommandService.java +++ b/src/main/java/com/pickple/server/api/moimsubmission/service/MoimSubmissionCommandService.java @@ -28,15 +28,15 @@ public void createMoimSubmission(Long moimId, Long guestId, MoimSubmitRequest re .moim(moim) .answerList(request.answerList()) .accountList(request.accountList()) - .moimSubmissionState(MoimSubmissionState.PENDING_PAYMENT.getMoimSubmissionState()) + .moimSubmissionState(MoimSubmissionState.PENDING_APPROVAL.getMoimSubmissionState()) .build(); isDuplicatedMoimSubmission(moimSubmission); moimSubmissionRepository.save(moimSubmission); } private void isDuplicatedMoimSubmission(MoimSubmission moimSubmission) { - if (moimSubmissionRepository.existsByMoimAndMoimSubmissionStateAndGuestId(moimSubmission.getMoim(), - moimSubmission.getMoimSubmissionState(), moimSubmission.getGuestId())) { + if (moimSubmissionRepository.existsByMoimAndGuestId(moimSubmission.getMoim(), + moimSubmission.getGuestId())) { throw new BadRequestException(ErrorCode.DUPLICATION_MOIM_SUBMISSION); } }