v20260622.0#94
Conversation
…iod-validation [application] 신청 기간 종료 후 취소 차단 검증 추가
There was a problem hiding this comment.
Code Review
This pull request introduces a validation check to prevent application cancellations after the registration deadline has passed, and optimizes the database query by eagerly fetching the associated activity using an EntityGraph. The review feedback suggests using LocalDateTime.now() instead of hardcoding the 'Asia/Seoul' timezone to prevent potential timezone mismatch issues depending on the server and database configurations.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| ApplicationJpaEntity application = applicationRepository.findByActivity_IdAndUser_Id(activityId, userId) | ||
| .orElseThrow(() -> new ExpectedException("신청 내역을 찾을 수 없습니다.", HttpStatus.NOT_FOUND)); | ||
|
|
||
| LocalDateTime now = LocalDateTime.now(ZoneId.of("Asia/Seoul")); |
There was a problem hiding this comment.
서버 환경(예: AWS, Docker 등)의 시스템 기본 시간대(Timezone)가 UTC로 설정되어 있고 데이터베이스에 UTC 기준으로 시간이 저장되는 경우, LocalDateTime.now(ZoneId.of("Asia/Seoul"))를 사용하면 시간대 불일치(Timezone Mismatch)로 인한 오동작이 발생할 수 있습니다.
예를 들어, 마감 시간이 KST 18:00(UTC 09:00)이고 DB에 09:00으로 저장되어 있다면, now는 KST 기준인 18:00이 되어 실제 마감 시간보다 9시간 일찍 취소가 불가능해집니다.
애플리케이션의 JVM 기본 시간대를 Asia/Seoul로 설정하는 방식을 사용하고 있다면, 특정 서비스에서만 ZoneId를 명시하는 대신 LocalDateTime.now()를 사용하는 것이 일관성 있고 안전합니다.
| LocalDateTime now = LocalDateTime.now(ZoneId.of("Asia/Seoul")); | |
| LocalDateTime now = LocalDateTime.now(); |
#93 을 main에 머지하는 pr을 올렸습니다.