-
Notifications
You must be signed in to change notification settings - Fork 5
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
refactor : product 관련 설정 변경 #76
Conversation
… 등) , flyway 스크립트 변경 V1.1.1__alter_brand_and_product_table.sql ->> 실행 이력 지우고 다시 재실행 필요
entity.getReportNumber(), | ||
entity.getIsViolation(), | ||
entity.getSafetyStatus(), | ||
entity.getViewCount(), | ||
entity.getCreatedAt(), | ||
entity.getCreatedBy(), |
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.
Here are some observations and suggestions for your code patch:
-
Import Statement: You imported the
SafetyStatus
class, which is not mentioned in the code patch. Make sure you're using it correctly. -
ProductDto Constructor: In the constructor, you have
Long productNo
, but you should specify the appropriate type for the field. If it's a numeric ID, consider usingLong
orInteger
. -
Naming Convention: Follow the Java naming conventions. Class names should start with an uppercase letter, so
ProductDto
should beProductDTO
. Similarly, variable names likeproductNo
should start with a lowercase letter (productNo
). -
Commented Code: Remove commented-out code or TODO/FIXME comments that are no longer relevant or clear.
-
Field Name Change: It seems that the field
isViolation
has been replaced bysafetyStatus
. Ensure that this change is reflected in other parts of the code that use this field. -
Missing Setter Method: The
ProductDto
class defined as a record does not have setter methods. If you need mutability, consider converting it to a regular class or manually create setters. -
Usage of
entity.getImage()
: In thefrom
method, you callentity.getImage()
, but there is no corresponding field forimage
in the constructor or the fields list. Verify if this is intentional or if you missed adding it.
Overall, the provided code snippet looks mostly fine, but do carefully review the areas mentioned above based on the complete codebase and testing requirements.
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.
LGTM!
if (status == null) { | ||
return null; | ||
} | ||
return status.getCode(); |
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.
별 건 아니지만 코드 컨벤션 할 때, return 전에 빈 줄 하나 추가하기로 했었던 것 같아요~
product_no BIGSERIAL NOT NULL, | ||
product_no BIGINT NOT NULL, |
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.
여기는 BIGSERIAL이 맞지 않나요?
import java.time.LocalDate; | ||
|
||
/** | ||
* DTO for {@link com.kernel360.product.entity.Product} | ||
*/ | ||
// FIXME :: Product 테이블 변경에 따라서 toEntity 또한 변경되어야 함. | ||
public record ProductDto(Long productNo, | ||
String productName, | ||
String barcode, | ||
String description, |
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.
여기도 변경해야 할듯 합니다
@@ -26,7 +26,7 @@ public static ProductDto of( | |||
String barcode, | |||
String description, |
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.
여기도 변경해야 할듯 합니다
import jakarta.persistence.Converter; | ||
import java.util.stream.Stream; | ||
|
||
@Converter(autoApply = true) |
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.
이건 무슨 어노테이션인가요? 자동으로 convert 되는건가요?
V1.1.1__alter_brand_and_product_table.sql ->> 실행 이력 지우고 다시 재실행 필요
entity.getReportNumber(), | ||
entity.getIsViolation(), | ||
entity.getSafetyStatus(), | ||
entity.getViewCount(), | ||
entity.getCreatedAt(), | ||
entity.getCreatedBy(), |
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.
-
In the
ProductDto
class, there is a comment mentioning that thetoEntity
method needs to be changed due to changes in theProduct
table. It would be helpful to review and update thetoEntity
method accordingly. -
It seems that the variables
description
,declareNo
, andisViolation
have been removed from theProductDto
record. Make sure this change aligns with the required functionality. If these fields are still necessary, they need to be incorporated back into the record. -
Check if the parameter names in the
of
andfrom
methods match the field names in theProduct
entity class. It's important to ensure the correct mapping between the DTO and the entity. -
Verify if the variable
imageSource
corresponds to the propertyimage
in theProduct
entity, as it was referenced in thefrom
method. If they represent the same information, make sure to use consistent terminology. -
Confirm that the type of the
safetyStatus
field in theProductDto
andProduct
entity matches correctly. It appears to be of typeSafetyStatus
, so ensure this type is properly defined and implemented. -
Consider adding appropriate error handling or validation checks for the input parameters in the
of
method, if necessary.
Overall, it's important to carefully review and verify the changes made to ensure that the code behaves as expected and that all necessary fields are properly handled in the DTO and entity classes.
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.
LGTM
💡 Motivation and Context
Product 관련 세부 스펙 변경
🔨 Modified
🌟 More
📋 커밋 전 체크리스트
🤟🏻 PR로 완료된 이슈
closes #69