feat(Order): 오픈시간, 공지 칼럼 추가#155
Hidden character warning
Conversation
Walkthrough
Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Controller
participant Service
participant StoreEntity
Client->>Controller: Store 생성/수정 요청 (notice, openTime 포함)
Controller->>Service: StoreCreateRequest/StoreUpdateRequest 전달
Service->>StoreEntity: 생성자/ updateInfo 호출 (notice, openTime 포함)
StoreEntity-->>Service: Store 인스턴스 반환/업데이트
Service-->>Controller: StoreCreateResponse/StoreReadDto 반환 (notice, openTime 포함)
Controller-->>Client: 응답 반환 (notice, openTime 포함)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches
🧪 Generate unit tests
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.
Actionable comments posted: 2
🧹 Nitpick comments (2)
nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/store/dto/StoreUpdateRequest.java (1)
16-17: openTime 필드의 데이터 타입을 검토해주세요.
openTime필드가 시간 정보를 나타내는 것으로 보이는데 String 타입으로 정의되어 있습니다. 시간 형식의 일관성과 유효성 검증을 위해 다음을 고려해보세요:
LocalTime타입 사용을 검토- String을 사용한다면 시간 형식에 대한 validation 추가 (예:
@Pattern어노테이션)-private String openTime; +@Pattern(regexp = "^([0-1][0-9]|2[0-3])[0-5][0-9][0-5][0-9]$", message = "시간 형식이 올바르지 않습니다 (HHMMSS)") +private String openTime;nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/store/entity/Store.java (1)
84-84: 불필요한 빈 줄을 제거해주세요.파일 끝에 추가된 빈 줄이 코드 스타일을 해칩니다.
-
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/store/dto/StoreCreateRequest.java(1 hunks)nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/store/dto/StoreCreateResponse.java(2 hunks)nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/store/dto/StoreReadDto.java(2 hunks)nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/store/dto/StoreUpdateRequest.java(1 hunks)nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/store/service/StoreServiceImpl.java(1 hunks)nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/store/entity/Store.java(2 hunks)
🔇 Additional comments (7)
nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/store/service/StoreServiceImpl.java (1)
82-88: 새로운 필드 전달이 올바르게 구현되었습니다.
notice와openTime필드가 요청 DTO에서 엔터티의updateInfo메서드로 올바르게 전달되고 있습니다. 기존 패턴과 일관성을 유지하고 있어 좋습니다.nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/store/dto/StoreCreateResponse.java (2)
21-22: 새로운 필드 추가가 올바르게 구현되었습니다.
notice와openTime필드가 기존 패턴과 일관성 있게 추가되었습니다.
35-36: fromEntity 메서드가 올바르게 업데이트되었습니다.새로운 필드들이 엔터티에서 응답 DTO로 올바르게 매핑되고 있습니다.
nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/store/dto/StoreReadDto.java (2)
22-23: 새로운 필드가 일관성 있게 추가되었습니다.
notice와openTime필드가 다른 DTO들과 일관된 패턴으로 추가되었습니다.
48-49: 엔터티 매핑이 올바르게 구현되었습니다.
fromEntity메서드에서 새로운 필드들이 엔터티로부터 올바르게 매핑되고 있습니다.nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/store/entity/Store.java (2)
43-47: 새로운 필드 선언이 올바르게 추가되었습니다.
notice와openTime필드가 JPA 규칙에 맞게 정의되었으며, nullable=true와 적절한 길이 제한(200자)이 설정되어 있습니다.
69-75: updateInfo 메서드가 올바르게 확장되었습니다.새로운 필드들에 대한 null 체크와 조건부 업데이트 로직이 기존 패턴과 일관되게 구현되었습니다.
| .notice("") | ||
| .openTime("00002359") |
There was a problem hiding this comment.
🛠️ Refactor suggestion
기본값 설정에 대한 검토가 필요합니다.
하드코딩된 기본값들에 대해 몇 가지 우려사항이 있습니다:
openTime의 기본값 "00002359"가 직관적이지 않습니다 (23:59를 의미하는 것으로 보임)- 상수로 정의하여 의미를 명확하게 하는 것이 좋겠습니다
상수 클래스나 enum을 만들어 기본값을 관리하는 것을 제안합니다:
public class StoreDefaults {
public static final String DEFAULT_NOTICE = "";
public static final String DEFAULT_OPEN_TIME = "00002359"; // 00:00-23:59 (24시간 운영)
}그리고 다음과 같이 사용:
-.notice("")
-.openTime("00002359")
+.notice(StoreDefaults.DEFAULT_NOTICE)
+.openTime(StoreDefaults.DEFAULT_OPEN_TIME)🤖 Prompt for AI Agents
In
nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/store/dto/StoreCreateRequest.java
around lines 32 to 33, the hardcoded default value for openTime ("00002359") is
not intuitive and should be replaced with a named constant. Create a separate
constants class or enum, for example StoreDefaults, to define DEFAULT_NOTICE and
DEFAULT_OPEN_TIME with clear names and comments. Then replace the hardcoded
values in the code with these constants to improve readability and
maintainability.
| public Store(LocalDateTime createdAt, Long storeId, Long departmentId, String name, String location, | ||
| String description, Boolean isActive, Boolean deleted) { | ||
| String description,String notice,String openTime, Boolean isActive, Boolean deleted) { | ||
| super(createdAt); | ||
| this.storeId = storeId; | ||
| this.departmentId = departmentId; | ||
| this.name = name; | ||
| this.location = location; | ||
| this.description = description; | ||
| this.notice = notice; | ||
| this.openTime = openTime; | ||
| this.isActive = isActive; | ||
| this.deleted = deleted; | ||
| } |
There was a problem hiding this comment.
🛠️ Refactor suggestion
생성자 매개변수 순서와 포맷팅을 개선해주세요.
생성자가 새로운 필드를 포함하도록 올바르게 업데이트되었지만, 몇 가지 개선이 필요합니다.
다음 diff를 적용하여 매개변수 포맷팅을 개선하고 순서를 논리적으로 정리해주세요:
- public Store(LocalDateTime createdAt, Long storeId, Long departmentId, String name, String location,
- String description,String notice,String openTime, Boolean isActive, Boolean deleted) {
+ public Store(LocalDateTime createdAt, Long storeId, Long departmentId, String name, String location,
+ String description, String notice, String openTime, Boolean isActive, Boolean deleted) {📝 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.
| public Store(LocalDateTime createdAt, Long storeId, Long departmentId, String name, String location, | |
| String description, Boolean isActive, Boolean deleted) { | |
| String description,String notice,String openTime, Boolean isActive, Boolean deleted) { | |
| super(createdAt); | |
| this.storeId = storeId; | |
| this.departmentId = departmentId; | |
| this.name = name; | |
| this.location = location; | |
| this.description = description; | |
| this.notice = notice; | |
| this.openTime = openTime; | |
| this.isActive = isActive; | |
| this.deleted = deleted; | |
| } | |
| public Store(LocalDateTime createdAt, Long storeId, Long departmentId, String name, String location, | |
| String description, String notice, String openTime, Boolean isActive, Boolean deleted) { | |
| super(createdAt); | |
| this.storeId = storeId; | |
| this.departmentId = departmentId; | |
| this.name = name; | |
| this.location = location; | |
| this.description = description; | |
| this.notice = notice; | |
| this.openTime = openTime; | |
| this.isActive = isActive; | |
| this.deleted = deleted; | |
| } |
🤖 Prompt for AI Agents
In
nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/store/entity/Store.java
between lines 55 and 67, the constructor parameters need reordering and
formatting for better readability and logical grouping. Adjust the parameter
order to group related fields together, such as placing all String fields
consecutively, and format the parameters with consistent spacing and line breaks
if necessary. Update the constructor signature and the corresponding assignments
inside the constructor accordingly to reflect this improved order and
formatting.
작업 요약
Issue Link
문제점 및 어려움
해결 방안
Reference
Summary by CodeRabbit