Skip to content

Commit

Permalink
feat: 예약 종료 시간이 지났을 경우 면접 예약 불가하도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
gorapang committed Dec 23, 2024
1 parent 870374b commit b4be1b8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public CommonResponse<ApplicationListDto> getApplications(@PathVariable Long pos
})
public CommonResponse<String> createInterviewTimes(@RequestBody MeetingTimeRequestDTO request, HttpSession session) {
meetingTimeService.createMeetingTimes(request.getRecruitingId(), request, session);
return new CommonResponse<>("면접 가능 시간이 성공적으로 생성되었습니다.");
return new CommonResponse<>("면접 가능 시간 리스트가 설정되었습니다. 예약 가능 시간이 설정되었습니다.");
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -252,6 +253,13 @@ public MeetingTimeResponseDTO selectMeetingTime (MeetingTimeSelectionDto dto, Ht
throw new AllowedNumExceededException("면접 허용 인원을 초과했습니다.");
}

// 예약 종료 시간 확인
LocalDateTime reservationEndTime = meetingTime.getRecruiting().getReservationEndTime();
if (reservationEndTime != null && LocalDateTime.now().isAfter(reservationEndTime)) {
throw new IllegalStateException("면접 예약이 종료되었습니다.");
}

//면접 시간 설정
application.setMeetingTime(meetingTime);
applicationRepository.save(application);

Expand Down

0 comments on commit b4be1b8

Please sign in to comment.