[Spring Core] 박채연 미션 제출합니다. #498
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
안녕하세요 ! 이번에도 리뷰 잘 부탁드립니다 🙇♂️
미션 회고
이전 미션에서 Reservation 도메인에서 필드 유효성 검사를 할 때, 각 검증 조건마다 다른 예외 메시지를 반환할 수 있도록 validate() 메서드를 만들었다.
이번 미션에서도 이와 유사하게 Time 객체를 검증했다.
js파일에서 선택된 시간의 값을 time이 아닌 timeId로 수정해 ReservationRequest DTO가 해당 값을 받을 수 있게 수정했다.
이로 인해 기존 예약 추가 API 스펙에 맞춰서 요청을 보낼 경우 에러가 발생한다.
Reservation 엔티티가 Time 엔티티와 연관 관계를 갖도록 수정하며, reservation 테이블에 time_id 외래 키를 추가하고, ReservationRepository에서는 예약 정보를 조회할 때 INNER JOIN을 사용했다.
이러한 객체 간 연관 관계가 생기면서 변경이 필요한 부분을 수정했다.