Skip to content

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

Open
wants to merge 74 commits into
base: main
Choose a base branch
from

Conversation

724thomas
Copy link
Collaborator

@724thomas 724thomas commented May 9, 2025

PR 유형

이 PR은 어떤 종류의 변경을 가져오나요?

  • 버그 수정
  • 새로운 기능 추가
  • 코드 스타일 업데이트 (서식, 로컬 변수)
  • 리팩터링 (기능 변경 없음, API 변경 없음)
  • 빌드 관련 변경
  • CI 관련 변경
  • 문서 내용 변경
  • 애플리케이션 / 인프라 변경
  • 기타... 설명:

현재 동작은 무엇인가요?

이슈 번호: resolves #4

새로운 동작은 무엇인가요?

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

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

  • 장바구니 제품 수량 수정:
    image

  • 장바구니 제품 삭제:
    image

기타 정보

724thomas and others added 30 commits April 18, 2025 19:48
Copy link

@jinspark-lab jinspark-lab left a 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()) {

Choose a reason for hiding this comment

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

이 부분이 재고 부족을 체크하는 로직인가요?

Choose a reason for hiding this comment

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

확인

@724thomas 724thomas changed the base branch from main to feat/#3_product_api May 13, 2025 16:29
@724thomas 724thomas changed the base branch from feat/#3_product_api to main May 16, 2025 09:59
@724thomas 724thomas changed the base branch from main to feat/#3_product_api May 16, 2025 10:00
@724thomas
Copy link
Collaborator Author

캐싱을 추가했습니다.

@724thomas 724thomas changed the base branch from feat/#3_product_api to main May 23, 2025 10:10
Copy link

@jinspark-lab jinspark-lab left a 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()) {

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()

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)

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);

Choose a reason for hiding this comment

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

Softdelete 가 좋을 것 같습니다

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants