feat(booking): 예매 조회(주문, 목록, 상세) API 및 비즈니스 로직 구현#89
Merged
Conversation
- NumberGenerator 클래스를 Spring 컴포넌트에서 정적 유틸리티 클래스로 전환 - NumberGenerator의 모든 메서드를 정적 메서드로 변경하고 private 생성자 추가 - BookingService에서 NumberGenerator 의존성 제거 및 정적 메서드 호출로 수정 - NumberGenerator 패키지를 service.util에서 util로 이동 - BookingServiceTest에서 NumberGenerator mocking 관련 코드 제거
- LocalDateTime 포맷을 위한 formatDate 메서드 추가 - 두 LocalDateTime 간의 기간을 포맷하는 formatDuration 메서드 구현
- ReservationRepository의 findByNumber 메서드에 @EntityGraph 적용 - tickets 연관 엔티티를 즉시 로딩하도록 설정 - N+1 쿼리 방지 및 Reservation 조회 성능 개선
- Reservation 엔티티에 refundFee, canceledAt 필드 추가 및 초기화 - Reservation 엔티티에 예약 상태 확인 및 취소 관련 여러 헬퍼 메서드 구현 - Reservation 엔티티에 티켓 목록 처리, 환불 금액 계산 및 마감 기한 조회 로직 보완 - Ticket 엔티티에 취소 상태 확인을 위한 isCanceled 메서드 추가
- `BookingResponse` 내부에 `Order`, `Summary`, `ReservationDetail` DTO 추가 - 예매 주문, 요약, 상세 정보 응답에 필요한 필드 및 구조 정의 - 공통 상세 정보를 캡슐화하는 `Detail` 내부 클래스 도입 - `Reservation` 엔티티 기반 DTO 변환 팩토리 메서드 구현
l-lyun
reviewed
Mar 23, 2026
Comment on lines
+165
to
+168
| return DateTimeUtil.formatDuration(LocalDateTime.now(), deadline, "입금 마감 ", "전"); | ||
| else | ||
| return DateTimeUtil.formatDuration(LocalDateTime.now(), deadline, "입장까지 ", "남음"); | ||
| } |
l-lyun
approved these changes
Mar 23, 2026
Contributor
l-lyun
left a comment
There was a problem hiding this comment.
여유가 된다면 booking도 뗴어낸다면 좋을 것 같기는 하네요 ㅋㅋㅋ
고생하셨습니다~!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
변경 사항
유틸 패키지 위치 변경 및 LocalDateTime 포맷 유틸 추가
service 패키지 내에 있던 util 패키지를 밖으로 꺼냈습니다.
NumberGenerator: (임의의 예매 번호, 티켓 번호를 생성하는 유틸) 위치 이동 및 컴포넌트 -> 정적 클래스로 변경DateTimeUtil: DateTime 포맷 유틸예매 조회 API 추가
(결제 전) 주문 조회, 목록 조회, 상세 조회 API를 추가했습니다.
Reservation, Ticket 엔티티 메서드 추가: 상태 확인 및 데이터 조회성 메서드들을 추가했습니다.
BookingResponse: 관련 DTO 작성
전체 테스트 코드 성공 여부
관련 이슈
참고사항 (선택)
DTO가 너무 조잡해졌는데 차차 리팩토링 해보겠습니다 🥲