Skip to content

Commit

Permalink
[feat] 서류 결과 확인하기 기능 500 해결 (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
wjdtkdgns authored Aug 2, 2023
1 parent afc71dd commit 18ce0ca
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public enum ApplicationErrorCode implements BaseErrorCode {
NOT_PASS_FINAL(BAD_REQUEST, "APPLICATION_400_5", "최종 합격 상태가 아닙니다."),
ALREADY_CHECK_FINAL(BAD_REQUEST, "APPLICATION_400_6", "활동 여부를 이미 선택했습니다."),
SAME_PASS_STATUS(BAD_REQUEST, "APPLICATION_400_7", "같은 상태로 변경할 수 없습니다."),
NOT_SET_INTERVIEW_TIME(BAD_REQUEST, "APPLICATION_400_8", "면접 시간이 정해지지 않았습니다."),

APPLICANT_NOT_FOUND(BAD_REQUEST, "APPLICATION_404_3", "존재하지 않는 지원자입니다."),

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package ceos.backend.domain.application.exception;


import ceos.backend.global.error.BaseErrorException;

public class NotSetInterviewTime extends BaseErrorException {

public static final NotSetInterviewTime EXCEPTION =
new NotSetInterviewTime();

private NotSetInterviewTime() {
super(ApplicationErrorCode.NOT_SET_INTERVIEW_TIME);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ public void updateApplicationQuestion(UpdateApplicationQuestion updateApplicatio
public GetResultResponse getDocumentResult(String uuid, String email) {
recruitmentValidator.validateBetweenResultDateDocAndResultDateFinal(); // 서류 합격 기간 검증
applicationValidator.validateApplicantAccessible(uuid, email); // 유저 검증
applicationValidator.validateInterviewTimeExist(uuid, email); // 유저 검증

final Application application = applicationHelper.getApplicationByUuidAndEmail(uuid, email);
final Recruitment recruitment = recruitmentHelper.takeRecruitment();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,16 @@ public void validateQAMatching(CreateApplicationRequest createApplicationRequest
throw NotMatchingQnA.EXCEPTION;
}
}

public void validateInterviewTimeExist(String uuid, String email) {
Application application = applicationRepository
.findByUuidAndEmail(uuid, email)
.orElseThrow(
() -> {
throw ApplicantNotFound.EXCEPTION;
});
if (application.getInterviewDatetime() == null) {
throw NotSetInterviewTime.EXCEPTION;
}
}
}

0 comments on commit 18ce0ca

Please sign in to comment.