Skip to content

Conversation

@Jjiggu
Copy link
Contributor

@Jjiggu Jjiggu commented Sep 3, 2025

작업 요약

  • 메뉴 랭킹 메뉴 이미지 필드 추가
  • 매출 조회 버그 수정

Issue Link

#308

문제점 및 어려움

해결 방안

Reference

Summary by CodeRabbit

  • 신기능
    • 인기 메뉴 TOP5에 메뉴 이미지 URL을 포함해 제공합니다. 첫 번째 이미지를 썸네일로 활용할 수 있습니다.
  • 버그 수정
    • 통계 집계 기간을 조정하여 목표/어제 매출이 실제 ‘어제’ 기준으로 정확히 계산되도록 수정했습니다.
    • 권한 검증 로직을 개선하여 SUPER_ADMIN이 아닌 사용자의 매장 식별자 검증 오류를 해결했습니다.

@Jjiggu Jjiggu self-assigned this Sep 3, 2025
@Jjiggu Jjiggu added bug Something isn't working refactor 리팩토링 labels Sep 3, 2025
@Jjiggu Jjiggu merged commit d2044a5 into develop Sep 3, 2025
1 check passed
@coderabbitai
Copy link

coderabbitai bot commented Sep 3, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

인기 메뉴 DTO에 imageUrl 필드를 추가하고, 인기 메뉴 조회 서비스에서 메뉴 이미지(첫 번째 이미지)를 조회해 DTO에 포함하도록 로직을 확장했다. MenuImageRepository에 일괄 조회 메서드를 추가했다. 통계 커스텀 리포지터리에서 전일 매출 합계 계산 구간을 [start-1day, start)로 정정했다.

Changes

Cohort / File(s) Summary of changes
DTO 확장 (imageUrl 추가)
nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/statistic/dto/PopularMenuDto.java
DTO에 imageUrl 필드 추가. Lombok 기반 AllArgsConstructor가 3→4개 인자로 변경. Getter 자동 생성.
인기메뉴 서비스: 이미지 조회 + 권한 로직 수정
nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/statistic/service/impl/PopularMenuRedisServiceImpl.java
MenuImageRepository 주입 및 사용. 메뉴별 첫 이미지 URL 매핑 후 DTO 생성 시 4-인자 생성자 사용. 권한 체크 로직에서 SUPER_ADMIN 외 사용자의 storeId null 여부로 검증하도록 수정.
메뉴 이미지 리포지터리 확장
nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/menu/repository/MenuImageRepository.java
findByMenuIdInOrderByIdAsc(List<Long> menuIds) 메서드 추가.
통계 쿼리 기간 정정 (전일 합계)
nowait-domain/domain-admin-rdb/src/main/java/com/nowait/domainadminrdb/statistic/repository/StatisticCustomRepositoryImpl.java
yesterDayStart = start.minusDays(1) 도입. targetSum, yesterdaySum 계산 구간을 [yesterDayStart, start)로 정정. 불필요해진 end 경계 사용 제거.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant AdminClient as Admin Client
    participant Service as PopularMenuRedisServiceImpl
    participant Redis as Redis/ZSet
    participant Repo as MenuImageRepository

    AdminClient->>Service: getTop5PopularMenus(storeId, date)
    Service->>Redis: ZREVRANGE top-5 (store/date)
    Redis-->>Service: [(menuId, sold), ...]
    Service->>Repo: findByMenuIdInOrderByIdAsc(menuIds)
    Repo-->>Service: List<MenuImage> (정렬됨)
    Note over Service: 메뉴별 첫 이미지 URL 매핑 (신규)
    Service-->>AdminClient: List<PopularMenuDto(menuId, name, sold, imageUrl)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • HyemIin

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 378c4fd and c3bf538.

📒 Files selected for processing (4)
  • nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/statistic/dto/PopularMenuDto.java (1 hunks)
  • nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/statistic/service/impl/PopularMenuRedisServiceImpl.java (3 hunks)
  • nowait-domain/domain-admin-rdb/src/main/java/com/nowait/domainadminrdb/statistic/repository/StatisticCustomRepositoryImpl.java (2 hunks)
  • nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/menu/repository/MenuImageRepository.java (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/#308-add-menu-image

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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

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

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit 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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

@github-actions github-actions bot requested a review from HyemIin September 3, 2025 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working refactor 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants