Skip to content

Conversation

@Jjiggu
Copy link
Contributor

@Jjiggu Jjiggu commented Aug 6, 2025

작업 요약

  • 관리자용 메뉴 이름 CRUD 및 DTO 응답 필드 수정

Issue Link

#250

문제점 및 어려움

어드민 영역 주문 조회 시 관리자 메뉴 이름으로 보여야 되는건지 확인 필요

해결 방안

Reference

Summary by CodeRabbit

  • 신규 기능
    • 메뉴에 관리자 전용 표시 이름(adminDisplayName) 필드가 추가되었습니다. 메뉴 생성, 조회, 수정 시 관리자 표시 이름을 별도로 입력하고 확인할 수 있습니다.
  • 버그 수정
    • 없음
  • 기타
    • 메뉴 관련 응답 및 요청 데이터에 관리자 표시 이름 정보가 반영되었습니다.

@Jjiggu Jjiggu self-assigned this Aug 6, 2025
@Jjiggu Jjiggu added the refactor 리팩토링 label Aug 6, 2025
@coderabbitai
Copy link

coderabbitai bot commented Aug 6, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

adminDisplayName 필드가 메뉴 관련 DTO 및 엔티티(Menu, MenuCreateRequest, MenuCreateResponse, MenuReadDto, MenuUpdateRequest)에 추가되었습니다. 생성, 조회, 응답, 수정 요청 및 응답 객체와 서비스, 엔티티에서 해당 필드가 생성 및 갱신 로직에 반영되도록 변경되었습니다.

Changes

Cohort / File(s) Change Summary
Menu DTO: 생성/응답/조회/수정
nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/menu/dto/MenuCreateRequest.java, nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/menu/dto/MenuCreateResponse.java, nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/menu/dto/MenuReadDto.java, nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/menu/dto/MenuUpdateRequest.java
모든 DTO에 adminDisplayName 필드가 추가되었고, 생성/조회/응답 시 해당 필드가 빌더 및 팩토리 메서드에 반영되었습니다.
MenuService
nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/menu/service/MenuService.java
updateMenu에서 메뉴 정보 수정 시 adminDisplayName이 추가로 반영되도록 내부 호출을 수정했습니다.
Menu Entity
nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/menu/entity/Menu.java
엔티티에 adminDisplayName 필드 추가, 생성자 및 updateInfo 메서드에 해당 필드 반영. updateInfo는 값이 null이 아닐 때만 갱신합니다.

Sequence Diagram(s)

sequenceDiagram
    participant Admin as Admin API
    participant Service as MenuService
    participant Entity as Menu Entity

    Admin->>Service: MenuCreateRequest(adminDisplayName, ...)
    Service->>Entity: Menu 생성자(adminDisplayName, ...)
    Entity-->>Service: Menu 객체 반환
    Service-->>Admin: MenuCreateResponse(adminDisplayName, ...)

    Admin->>Service: MenuUpdateRequest(adminDisplayName, ...)
    Service->>Entity: updateInfo(adminDisplayName, ...)
    Entity-->>Service: 메뉴 정보 갱신
    Service-->>Admin: 결과 반환
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15분

Possibly related PRs

Suggested reviewers

  • HyemIin

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e22d452 and 56b981e.

📒 Files selected for processing (1)
  • nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/menu/entity/Menu.java (2 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 refoctor#250-admin-menuName

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.
  • 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.

Support

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

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 generate unit tests to generate unit tests for 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.

@github-actions github-actions bot requested a review from HyemIin August 6, 2025 07:49
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/menu/dto/MenuCreateResponse.java (1)

7-7: 사용하지 않는 import 제거 필요

@NotNull import가 추가되었지만 코드에서 사용되지 않습니다.

-import jakarta.validation.constraints.NotNull;
nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/menu/dto/MenuReadDto.java (1)

7-7: 사용하지 않는 import 제거 필요

@NotNull import가 추가되었지만 코드에서 사용되지 않습니다.

-import jakarta.validation.constraints.NotNull;
nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/menu/entity/Menu.java (1)

53-53: 생성자 매개변수 순서를 검토하세요.

생성자에 adminDisplayName 매개변수가 추가되었지만, 매개변수 순서가 논리적으로 적절한지 확인이 필요합니다. 일반적으로 관련 필드들(adminDisplayName, name)을 인접하게 배치하는 것이 가독성에 좋습니다.

매개변수 순서를 다음과 같이 조정하는 것을 고려해보세요:

-public Menu(LocalDateTime createdAt, Long id, Long storeId, String adminDisplayName, String name, String description, Integer price, Boolean isSoldOut, Boolean deleted) {
+public Menu(LocalDateTime createdAt, Long id, Long storeId, String name, String adminDisplayName, String description, Integer price, Boolean isSoldOut, Boolean deleted) {

Also applies to: 57-57

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 887c367 and e22d452.

📒 Files selected for processing (6)
  • nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/menu/dto/MenuCreateRequest.java (2 hunks)
  • nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/menu/dto/MenuCreateResponse.java (3 hunks)
  • nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/menu/dto/MenuReadDto.java (3 hunks)
  • nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/menu/dto/MenuUpdateRequest.java (1 hunks)
  • nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/menu/service/MenuService.java (1 hunks)
  • nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/menu/entity/Menu.java (2 hunks)
🔇 Additional comments (8)
nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/menu/dto/MenuUpdateRequest.java (1)

13-13: adminDisplayName 필드 추가 확인됨

업데이트 요청에서 adminDisplayName 필드가 올바르게 추가되었습니다. 다른 DTO들과 달리 @NotNull 어노테이션이 없는데, 업데이트 시 부분 업데이트를 허용하려는 의도로 보입니다.

nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/menu/dto/MenuCreateRequest.java (1)

30-30: 기본값 설정 로직 확인

adminDisplayName이 null일 때 name을 기본값으로 사용하는 로직이 있습니다. 이 비즈니스 로직이 의도된 것인지 확인이 필요합니다.

adminDisplayName의 기본값을 name으로 설정하는 것이 비즈니스 요구사항에 맞는지 검토해 주세요.

nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/menu/service/MenuService.java (1)

110-110: updateInfo 메서드 호출 업데이트 확인됨

adminDisplayName 파라미터가 updateInfo 메서드 호출에 올바르게 추가되었습니다. 파라미터 순서가 논리적으로 배치되어 있습니다.

nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/menu/dto/MenuCreateResponse.java (1)

18-18: adminDisplayName 필드 매핑 확인됨

adminDisplayName 필드가 올바르게 추가되고 fromEntity 메서드에서 적절히 매핑되었습니다.

Also applies to: 31-31

nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/menu/dto/MenuReadDto.java (1)

18-18: adminDisplayName 필드 매핑 확인됨

adminDisplayName 필드가 올바르게 추가되고 fromEntity 메서드에서 적절히 매핑되었습니다.

Also applies to: 30-30

nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/menu/entity/Menu.java (3)

34-35: 필드 제약 조건이 적절합니다.

adminDisplayName 필드가 nullable = false로 설정되어 관리자용 메뉴명이 항상 존재하도록 보장합니다. 이는 관리자 화면에서 메뉴를 표시할 때 일관성을 유지하는 데 도움이 됩니다.


65-66: null 체크 로직이 일관성 있게 적용되었습니다.

updateInfo 메서드에서 adminDisplayName에 대한 null 체크가 다른 필드들과 동일한 패턴으로 구현되어 일관성이 유지됩니다. 이는 부분 업데이트 시나리오에서 기존 값을 유지할 수 있도록 합니다.


65-70: updateInfo 메서드 시그니처 및 DTO 일관성 확인 완료

  • MenuService.updateInfo 호출부에서 4개 인자(adminDisplayName, name, description, price)를 올바르게 전달함
  • MenuUpdateRequest, MenuCreateRequest, MenuReadDto, MenuCreateResponse 등 DTO에 private Integer price 필드 선언 및 서비스 호출부 매핑(getPrice())이 정상적으로 이루어짐

위 검증 결과, 변경된 엔티티 메서드 시그니처에 맞춰 서비스 레이어와 DTO 모두 올바르게 업데이트되었으므로 별도 수정할 사항이 없습니다.

@Jjiggu Jjiggu merged commit eb3743f into develop Aug 6, 2025
1 check was pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants