-
Notifications
You must be signed in to change notification settings - Fork 0
refactor(order): 주문 내역 리스트 반환 값 수정 #246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
The head ref may contain hidden characters: "feature/#245-store\uC8FC\uBB38\uB0B4\uC5ED\uB9AC\uC2A4\uD2B8\uBC18\uD658\uAC12\uC218\uC815"
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/order/dto/MenuDetail.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| package com.nowait.applicationadmin.order.dto; | ||
|
|
||
| import lombok.AllArgsConstructor; | ||
| import lombok.Getter; | ||
|
|
||
| @Getter | ||
| @AllArgsConstructor | ||
| public class MenuDetail { | ||
| private int quantity; | ||
| private int price; | ||
| } |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
동일 메뉴명의 서로 다른 가격 처리 로직을 검증해주세요.
현재 구현에서 잠재적인 문제가 있습니다:
Line 39의 주석에서 "단가는 동일하다는 가정"을 하고 있지만, 실제로 동일한 메뉴명이지만 다른 가격을 가진 경우(예: 사이즈별 가격 차이, 프로모션 등)에 대한 처리가 부족합니다.
다음 스크립트로 동일 메뉴명에 대한 서로 다른 가격 케이스가 존재하는지 확인해보세요:
만약 동일 메뉴명에 다른 가격이 있을 수 있다면, merge 로직을 다음과 같이 개선하는 것을 고려해보세요:
🏁 Script executed:
Length of output: 99
동일 메뉴명에 대한 가격 차이 여부를 확인하기 위해
Menu클래스 정의를 조회해 주세요.🏁 Script executed:
Length of output: 1906
동일 메뉴명 그룹화 시 가격 차이 처리 검증 및 개선 제안
현재
OrderResponseDto.java(28–42행)의 merge 로직은 “단가는 동일하다는 가정” 하에 이름(name)만으로만 그룹화하기 때문에, 동일한 메뉴명으로 가격이 다른 경우(예: 프로모션, 사이즈별 옵션 미반영 등) 잘못된 합산 결과를 낼 수 있습니다.코드베이스 상에서
Menu엔티티에는 이름(name)에 대한 유니크 제약이 없고, 가격(price) 필드가Integer타입으로 선언되어 있어 실제로 같은 이름의 메뉴에 서로 다른 가격이 부여될 가능성이 존재합니다.점을 확인해 보시고, 아래 중 하나 이상의 조치를 고려해 주세요:
menu.getId()) 또는 이름+가격 조합으로 변경예시 개선안:
🤖 Prompt for AI Agents