Skip to content

Commit 5405ede

Browse files
committed
Refactor: 데브,테스트 환겨에서 예약 시각 검증 스킵
1 parent 7bc986d commit 5405ede

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

back/src/main/java/com/back/domain/mentoring/reservation/entity/Reservation.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.back.domain.mentoring.reservation.constant.ReservationStatus;
88
import com.back.domain.mentoring.reservation.error.ReservationErrorCode;
99
import com.back.domain.mentoring.slot.entity.MentorSlot;
10+
import com.back.global.app.AppConfig;
1011
import com.back.global.exception.ServiceException;
1112
import com.back.global.jpa.BaseEntity;
1213
import jakarta.persistence.*;
@@ -132,6 +133,10 @@ private void ensureCanComplete() {
132133
if(!this.status.canComplete()) {
133134
throw new ServiceException(ReservationErrorCode.CANNOT_COMPLETE);
134135
}
136+
// 개발·테스트 환경에서는 검증 스킵 (Swagger 테스트 허용)
137+
if (AppConfig.isDev() || AppConfig.isTest()) {
138+
return;
139+
}
135140
// 시작 이후 완료 가능 (조기 종료 허용)
136141
if (!mentorSlot.isPast()) {
137142
throw new ServiceException(ReservationErrorCode.MENTORING_NOT_STARTED);

0 commit comments

Comments
 (0)