-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/#4 장바구니 조회, 제품 등록, 수량 수정, 삭제 api #9
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
base: main
Are you sure you want to change the base?
Conversation
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.
다른 PR 들이랑 분리 부탁드립니다
status = CartProductStatus.DELETED; | ||
productSummaryDto = null; | ||
|
||
} else if (product.getStockQuantity() < cartProduct.getQuantity()) { |
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.
이 부분이 재고 부족을 체크하는 로직인가요?
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.
확인
캐싱을 추가했습니다. |
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.
피드백드렸습니다
status = CartProductStatus.DELETED; | ||
productSummaryDto = null; | ||
|
||
} else if (product.getStockQuantity() < cartProduct.getQuantity()) { |
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.
확인
.requestMatchers("/api/v1/auth/**").permitAll() | ||
.anyRequest().authenticated() | ||
//test purpose only | ||
.requestMatchers("/**").permitAll() |
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.
임시 코드가 반영된 것 같습니다
|
||
public static CartSummaryResponse of(List<CartProductDto> cartProductList) { | ||
Long totalPrice = cartProductList.stream() | ||
.mapToLong(CartProductDto::getProductTotalPrice) |
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.
이전에 말씀드린대로 BigDecimal 로 처리하시는게 좋습니다
Long quantity = req.getQuantity(); | ||
|
||
if (quantity <= 0) { | ||
cartProductApiRepository.delete(cartProduct); |
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.
Softdelete 가 좋을 것 같습니다
PR 유형
이 PR은 어떤 종류의 변경을 가져오나요?
현재 동작은 무엇인가요?
이슈 번호: resolves #4
새로운 동작은 무엇인가요?
장바구니 조회:

장바구니 조회시 제품 요약과 제품 수량 및 제품 총 가격, 총 제품 가격
삭제된 제품에 대한 요약정보는 null, status: DELETED
남은 제품 수량이 장바구니 수량보다 적으면: 수량 = 제품 현재 수량, status: SHORTAGE
장바구니 제품 추가:

제품이 존재할 경우, 수량 증가.
장바구니 제품 수량 수정:

장바구니 제품 삭제:

기타 정보