Skip to content

Conversation

@HyemIin
Copy link
Member

@HyemIin HyemIin commented Jul 22, 2025

작업 요약

  • order 조회 응답 데이터 구조 변경
  • 관리자 측 대기열 조회,변경 로직 구현

Issue Link

문제점 및 어려움

  • 사용자가 같은날 같은 주점에 한번더 예약할 경우, RDB와 redis에 둘 다 저장됨

해결 방안

Reference

Summary by CodeRabbit

  • 신규 기능

    • 대기 사용자 및 완료/취소된 예약 목록을 별도 엔드포인트로 조회할 수 있습니다.
    • 대기 사용자 정보에 점수(score) 및 생성일시가 추가되어 더 상세한 정보를 제공합니다.
    • 주문 내역이 주문별로 그룹화되어 반환되며, 주문 생성일시 등 추가 정보가 포함됩니다.
  • 기능 개선

    • 예약 상태 변경 및 호출 기능의 엔드포인트와 처리 방식이 개선되었습니다.
    • 주문 관련 DTO 및 서비스 구조가 주문 중심으로 리팩토링되었습니다.
  • 버그 수정

    • 일부 필드 및 엔드포인트의 파라미터 처리 방식이 일관성 있게 수정되었습니다.
  • 기타

    • 데이터베이스 테이블명 및 필드 일부가 변경되었습니다.

- order 조회 응답 데이터 구조 변경
- 관리자 측 대기열 조회,변경 로직 구현
@HyemIin HyemIin self-assigned this Jul 22, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jul 22, 2025

Caution

Review failed

An error occurred during the review process. Please try again later.

Walkthrough

예약 대기 리스트 및 상태 변경 기능이 대폭 리팩터링되었습니다. 예약 컨트롤러는 대기, 완료/취소 예약을 구분하여 조회하는 엔드포인트로 분리되었고, 상태 변경 엔드포인트가 POST 방식으로 변경되었습니다. Redis와 DB를 연동하여 대기자 관리가 강화되었으며, 관련 DTO 및 레포지토리, 서비스 로직이 추가 및 확장되었습니다. 주문 관련 DTO와 서비스도 그룹핑 기준이 주문 ID 중심으로 변경되었습니다.

Changes

파일/경로 요약 변경 요약
.../reservation/controller/ReservationController.java 예약 대기/완료 리스트 조회 엔드포인트 분리, 상태 변경 엔드포인트 POST 방식으로 변경, 파라미터 처리 방식 수정 등
.../reservation/service/ReservationService.java Redis와 DB 연동 대기자 조회/상태 변경/입장 처리 로직 추가, 기존 메서드 로직 확장 및 리팩터링
.../reservation/repository/WaitingRedisRepository.java 대기자 점수 기반 조회, 파티 사이즈 조회, 대기자 삭제 등 Redis 관련 메서드 추가 및 TTL 관리 로직 제거
.../reservation/dto/WaitingUserResponse.java 대기자 정보 응답용 DTO 신설, Reservation 엔티티 변환 팩토리 메서드 추가
.../order/controller/OrderController.java 주문 항목 조회시 그룹핑 기준 및 반환 DTO 변경
.../order/service/OrderService.java 주문 항목 그룹핑 기준을 주문 ID로 변경, 반환 DTO 및 내부 로직 수정
.../order/dto/OrderCreateResponseDto.java 주문 생성 응답 DTO에 createdAt 필드 추가, 팩토리 메서드 수정
.../order/dto/OrderMenuDto.java DTO명 및 필드명(orderId → menuId) 변경, 팩토리 메서드 수정
.../order/dto/OrderResponseDto.java DTO명 및 필드명 변경, orderId/createdAt 필드 추가, items 타입 변경
.../reservation/entity/Reservation.java JPA 테이블명 waiting_requests → reservation으로 변경
.../reservation/repository/ReservationRepository.java storeId, userId 기준 예약 단건/전체 조회 메서드 추가

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant ReservationController
    participant ReservationService
    participant WaitingRedisRepository
    participant ReservationRepository
    participant StoreRepository

    Client->>ReservationController: GET /stores/{storeId}/waiting
    ReservationController->>ReservationService: getAllWaitingUserDetails(storeId)
    ReservationService->>WaitingRedisRepository: getAllWaitingWithScore(storeId)
    ReservationService->>ReservationRepository: findByStore_StoreIdAndUserId(...)
    ReservationService-->>ReservationController: List<WaitingUserResponse>
    ReservationController-->>Client: 응답 반환

    Client->>ReservationController: POST /stores/{storeId}/waiting/{userId}/status/{status}
    ReservationController->>ReservationService: processEntryStatus(...)
    ReservationService->>ReservationRepository: findByStore_StoreIdAndUserId(...)
    ReservationService->>WaitingRedisRepository: deleteWaiting(...)
    ReservationService-->>ReservationController: 처리 결과 메시지
    ReservationController-->>Client: 응답 반환
Loading

Estimated code review effort

4 (~90분)

Possibly related PRs

Suggested labels

enhancement, refactor


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants