Skip to content

feat(booking): 예매 조회(주문, 목록, 상세) API 및 비즈니스 로직 구현#89

Merged
YeKim1 merged 8 commits intodevfrom
feat/#52-get-reservation
Mar 23, 2026
Merged

feat(booking): 예매 조회(주문, 목록, 상세) API 및 비즈니스 로직 구현#89
YeKim1 merged 8 commits intodevfrom
feat/#52-get-reservation

Conversation

@YeKim1
Copy link
Contributor

@YeKim1 YeKim1 commented Mar 21, 2026

변경 사항


유틸 패키지 위치 변경 및 LocalDateTime 포맷 유틸 추가

service 패키지 내에 있던 util 패키지를 밖으로 꺼냈습니다.

  • NumberGenerator: (임의의 예매 번호, 티켓 번호를 생성하는 유틸) 위치 이동 및 컴포넌트 -> 정적 클래스로 변경
  • DateTimeUtil: DateTime 포맷 유틸

예매 조회 API 추가

(결제 전) 주문 조회, 목록 조회, 상세 조회 API를 추가했습니다.

  • Reservation, Ticket 엔티티 메서드 추가: 상태 확인 및 데이터 조회성 메서드들을 추가했습니다.

  • BookingResponse: 관련 DTO 작성

  • 전체 테스트 코드 성공 여부

관련 이슈


  • Notion Ticket: #

참고사항 (선택)

DTO가 너무 조잡해졌는데 차차 리팩토링 해보겠습니다 🥲


YeKim1 added 8 commits March 21, 2026 21:11
- 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 변환 팩토리 메서드 구현
@YeKim1 YeKim1 requested review from l-lyun and seungh22 March 21, 2026 14:32
@YeKim1 YeKim1 self-assigned this Mar 21, 2026
@YeKim1 YeKim1 added the ✨ Feature 기능 개발 label Mar 21, 2026
Comment on lines +165 to +168
return DateTimeUtil.formatDuration(LocalDateTime.now(), deadline, "입금 마감 ", "전");
else
return DateTimeUtil.formatDuration(LocalDateTime.now(), deadline, "입장까지 ", "남음");
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이렇게도 사용이 가능하네요 감사합니다

Copy link
Contributor

@l-lyun l-lyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여유가 된다면 booking도 뗴어낸다면 좋을 것 같기는 하네요 ㅋㅋㅋ
고생하셨습니다~!

@YeKim1 YeKim1 merged commit e247080 into dev Mar 23, 2026
@YeKim1 YeKim1 deleted the feat/#52-get-reservation branch March 23, 2026 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Feature 기능 개발

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants