-
Notifications
You must be signed in to change notification settings - Fork 0
feat(APIAdmin,Order): order칼럼 추가 #42
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
The head ref may contain hidden characters: "feat/#41-order\uCE7C\uB7FC\uCD94\uAC00"
Conversation
- order에 입금자명 추가 - reservation exception 디렉토리 위치 변경
|
""" Walkthrough이 변경사항은 예약 관련 패키지의 스프링 컴포넌트 스캔 범위 확장, 주문 생성 DTO 및 엔티티에 예치자명(depositorName) 필드 추가, 주문 생성 응답에 해당 필드 반영, 예외 클래스 위치 및 import 정리, 새로운 예외 처리 추가, 그리고 예약 예외 클래스의 통합 삭제를 포함합니다. Changes
Sequence Diagram(s)sequenceDiagram
participant User as 사용자
participant Controller as OrderController
participant Service as OrderService
participant Entity as UserOrder
participant DTO as OrderCreateRequestDto/ResponseDto
User->>Controller: 주문 생성 요청 (depositorName 포함)
Controller->>Service: 주문 생성 서비스 호출
Service->>Service: depositorName 유효성 검사
Service->>Entity: UserOrder 엔티티 생성 (depositorName 세팅)
Service->>DTO: OrderCreateResponseDto.fromEntity(UserOrder)
Controller->>User: 주문 생성 응답 (depositorName 포함)
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 3
🧹 Nitpick comments (1)
application-user/src/main/java/com/nowait/applicationuser/order/dto/OrderCreateResponseDto.java (1)
19-19: 개인정보 노출에 대한 고려사항을 검토해보세요.depositorName이 응답에 포함되도록 구현되었습니다. 만약 이 API가 public하게 노출되거나 로깅된다면, 개인정보 보호 관점에서 마스킹 처리나 접근 권한 제어를 고려해야 할 수 있습니다.
필요에 따라 depositorName을 마스킹하는 유틸리티 메서드를 고려해보세요:
private String maskDepositorName(String depositorName) { if (depositorName == null || depositorName.length() <= 2) { return depositorName; } return depositorName.charAt(0) + "*".repeat(depositorName.length() - 2) + depositorName.charAt(depositorName.length() - 1); }Also applies to: 28-28
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
application-admin/src/main/java/com/nowait/applicationadmin/ApiAdminApplication.java(1 hunks)application-admin/src/main/java/com/nowait/applicationadmin/reservation/service/ReservationService.java(1 hunks)application-user/src/main/java/com/nowait/applicationuser/exception/GlobalExceptionHandler.java(2 hunks)application-user/src/main/java/com/nowait/applicationuser/order/dto/OrderCreateRequestDto.java(1 hunks)application-user/src/main/java/com/nowait/applicationuser/order/dto/OrderCreateResponseDto.java(2 hunks)application-user/src/main/java/com/nowait/applicationuser/order/service/OrderService.java(1 hunks)application-user/src/main/java/com/nowait/applicationuser/reservation/exception/ReservationNotFoundException.java(0 hunks)domain-order/src/main/java/com/nowait/order/entity/UserOrder.java(1 hunks)
💤 Files with no reviewable changes (1)
- application-user/src/main/java/com/nowait/applicationuser/reservation/exception/ReservationNotFoundException.java
🧰 Additional context used
🧬 Code Graph Analysis (1)
application-user/src/main/java/com/nowait/applicationuser/exception/GlobalExceptionHandler.java (1)
domain-reservation/src/main/java/com/nowait/reservation/exception/ReservationNotFoundException.java (1)
ReservationNotFoundException(5-9)
🔇 Additional comments (4)
application-admin/src/main/java/com/nowait/applicationadmin/reservation/service/ReservationService.java (1)
13-13: import 순서 정리 승인ReservationStatus enum의 import 순서를 다른 reservation 관련 import들 위로 이동시킨 것은 코드 정리에 도움이 됩니다.
application-admin/src/main/java/com/nowait/applicationadmin/ApiAdminApplication.java (1)
14-14: 예약 모듈 컴포넌트 스캔 추가 승인
com.nowait.reservation패키지를 컴포넌트 스캔에 추가한 것은 예약 예외 클래스의 패키지 재배치에 따른 필요한 변경사항입니다. 모듈화 개선에 도움이 됩니다.application-user/src/main/java/com/nowait/applicationuser/exception/GlobalExceptionHandler.java (2)
5-5: HttpStatus wildcard import 승인여러 HttpStatus 상수들을 사용하고 있어 wildcard import로 변경한 것이 적절합니다.
29-29: 예약 예외 클래스 import 경로 변경 승인ReservationNotFoundException이
com.nowait.applicationuser.reservation.exception에서com.nowait.reservation.exception으로 이동한 것은 모듈 구조 개선을 위한 적절한 변경사항입니다. 공유 모듈로 이동하여 재사용성이 향상됩니다.
|
|
||
| private String sessionId; | ||
|
|
||
| private String depositorName; |
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.
🛠️ Refactor suggestion
데이터베이스 제약사항 추가를 고려해보세요.
depositorName 필드에 적절한 데이터베이스 제약사항을 추가하는 것을 권장합니다. 다른 String 필드(signature)와의 일관성을 위해 길이 제한을 설정하고, 개인정보 보호 관점에서도 적절한 제약을 두는 것이 좋겠습니다.
- private String depositorName;
+ @Column(length = 100) // 예약자 이름 길이 제한
+ private String depositorName;또한 필드 순서를 고려하여 sessionId 다음에 배치하는 것도 고려해보세요:
private String sessionId;
+ @Column(length = 100)
private String depositorName;
-
- private String depositorName;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| private String depositorName; | |
| private String sessionId; | |
| @Column(length = 100) // 예약자 이름 길이 제한 | |
| private String depositorName; |
🤖 Prompt for AI Agents
In domain-order/src/main/java/com/nowait/order/entity/UserOrder.java at line 50,
add appropriate database constraints to the depositorName field by specifying a
length limit consistent with other String fields like signature to ensure data
integrity and privacy. Also, reorder the depositorName field to be declared
immediately after the sessionId field to maintain logical grouping of related
fields.
application-user/src/main/java/com/nowait/applicationuser/order/service/OrderService.java
Show resolved
Hide resolved
| @AllArgsConstructor | ||
| @Builder | ||
| public class OrderCreateRequestDto { | ||
| private final String depositorName; // 예약자 이름 |
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.
🛠️ Refactor suggestion
Bean Validation 어노테이션 추가를 고려해보세요.
depositorName 필드에 유효성 검증을 위한 Bean Validation 어노테이션을 추가하는 것을 권장합니다. 이를 통해 컨트롤러 레벨에서 자동으로 검증할 수 있습니다.
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.Size;
@Getter
@AllArgsConstructor
@Builder
public class OrderCreateRequestDto {
- private final String depositorName; // 예약자 이름
+ @NotBlank(message = "예약자 이름은 필수입니다")
+ @Size(max = 100, message = "예약자 이름은 100자 이하여야 합니다")
+ private final String depositorName; // 예약자 이름📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| private final String depositorName; // 예약자 이름 | |
| // --- at the top of OrderCreateRequestDto.java --- | |
| package com.nowait.applicationuser.order.dto; | |
| import lombok.Getter; | |
| import lombok.AllArgsConstructor; | |
| import lombok.Builder; | |
| +import jakarta.validation.constraints.NotBlank; | |
| +import jakarta.validation.constraints.Size; | |
| @Getter | |
| @AllArgsConstructor | |
| @Builder | |
| public class OrderCreateRequestDto { | |
| + @NotBlank(message = "예약자 이름은 필수입니다") | |
| + @Size(max = 100, message = "예약자 이름은 100자 이하여야 합니다") | |
| private final String depositorName; // 예약자 이름 | |
| // ... other fields and methods ... | |
| } |
🤖 Prompt for AI Agents
In
application-user/src/main/java/com/nowait/applicationuser/order/dto/OrderCreateRequestDto.java
at line 13, the depositorName field lacks Bean Validation annotations. Add
appropriate validation annotations such as @NotBlank or @NotNull to this field
to enable automatic validation at the controller level, ensuring the
depositorName is properly validated when requests are received.
- order에 입금자명 추가 - reservation exception 디렉토리 위치 변경
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
application-user/src/main/java/com/nowait/applicationuser/exception/GlobalExceptionHandler.java(3 hunks)application-user/src/main/java/com/nowait/applicationuser/order/dto/OrderCreateRequestDto.java(2 hunks)application-user/src/main/java/com/nowait/applicationuser/order/service/OrderService.java(2 hunks)common/src/main/java/com/nowait/common/exception/ErrorMessage.java(1 hunks)domain-order/src/main/java/com/nowait/order/entity/UserOrder.java(1 hunks)domain-order/src/main/java/com/nowait/order/exception/DepositorNameTooLongException.java(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- common/src/main/java/com/nowait/common/exception/ErrorMessage.java
🚧 Files skipped from review as they are similar to previous changes (4)
- domain-order/src/main/java/com/nowait/order/entity/UserOrder.java
- application-user/src/main/java/com/nowait/applicationuser/order/dto/OrderCreateRequestDto.java
- application-user/src/main/java/com/nowait/applicationuser/order/service/OrderService.java
- application-user/src/main/java/com/nowait/applicationuser/exception/GlobalExceptionHandler.java
domain-order/src/main/java/com/nowait/order/exception/DepositorNameTooLongException.java
Outdated
Show resolved
Hide resolved
- order에 입금자명 추가 - reservation exception 디렉토리 위치 변경
작업 요약
Issue Link
#41
문제점 및 어려움
해결 방안
Reference
Summary by CodeRabbit
신규 기능
버그 수정
기타