Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public Store toEntity() {
.name(name)
.location(location)
.description(description)
.notice("")
.openTime("00002359")
Comment on lines +32 to +33

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

기본값 설정에 대한 검토가 필요합니다.

하드코딩된 기본값들에 대해 몇 가지 우려사항이 있습니다:

  1. openTime의 기본값 "00002359"가 직관적이지 않습니다 (23:59를 의미하는 것으로 보임)
  2. 상수로 정의하여 의미를 명확하게 하는 것이 좋겠습니다

상수 클래스나 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.

.isActive(false)
.deleted(false)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public class StoreCreateResponse {
private String name;
private String location;
private String description;
private String notice;
private String openTime;
private Boolean isActive;
private Boolean deleted;
private LocalDateTime createdAt;
Expand All @@ -30,6 +32,8 @@ public static StoreCreateResponse fromEntity(Store store) {
.name(store.getName())
.location(store.getLocation())
.description(store.getDescription())
.notice(store.getNotice())
.openTime(store.getOpenTime())
.isActive(store.getIsActive())
.deleted(store.getDeleted())
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public class StoreReadDto {
private String name;
private String location;
private String description;
private String notice;
private String openTime;
private StoreImageUploadResponse profileImage;
private List<StoreImageUploadResponse> bannerImages;
private Boolean isActive;
Expand All @@ -43,6 +45,8 @@ public static StoreReadDto fromEntity(Store store, List<StoreImageUploadResponse
.name(store.getName())
.location(store.getLocation())
.description(store.getDescription())
.notice(store.getNotice())
.openTime(store.getOpenTime())
.isActive(store.getIsActive())
.deleted(store.getDeleted())
.profileImage(profile)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ public class StoreUpdateRequest {
private String name;
private String location;
private String description;
private String notice;
private String openTime;
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ public StoreReadDto updateStore(Long storeId, StoreUpdateRequest request, Member
store.updateInfo(
request.getName(),
request.getLocation(),
request.getDescription()
request.getDescription(),
request.getNotice(),
request.getOpenTime()
);

Store updatedStore = storeRepository.save(store);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,28 +40,38 @@ public class Store extends BaseTimeEntity {
@Column(nullable = true, length = 200)
private String description;

@Column(nullable = true, length = 200)
private String notice;

@Column(nullable = true, length = 200)
private String openTime;

@Column(name = "is_active", nullable = false)
private Boolean isActive;

@Column(nullable = false)
private Boolean deleted;

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;
}
Comment on lines 55 to 67

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ 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.

Suggested change
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.


public void updateInfo(String name, String location, String description) {
public void updateInfo(String name, String location, String description, String notice, String openTime) {
if (name != null) this.name = name;
if (location != null) this.location = location;
if (description != null) this.description = description;
if (notice != null) this.notice = notice;
if (openTime != null) this.openTime = openTime;
}

public void markAsDeleted() {
Expand All @@ -71,4 +81,5 @@ public void markAsDeleted() {
public void toggleActive() {
this.isActive = !this.isActive;
}

}