Skip to content

feat(product): add bundle flag to product catalog#50

Merged
popeye0618 merged 1 commit into
mainfrom
feat/product-catalog-bundle
May 15, 2026
Merged

feat(product): add bundle flag to product catalog#50
popeye0618 merged 1 commit into
mainfrom
feat/product-catalog-bundle

Conversation

@popeye0618
Copy link
Copy Markdown
Member

개요

상품 카탈로그에 isBundle 여부를 추가하고, 사용자/관리자 상품 조회에서 번들 여부 optional 필터를 지원합니다.

Closes #49

@codex

변경 사항

  • Product, 관리자 등록 요청, 상품 응답에 isBundle 필드 추가
  • 사용자/관리자 상품 목록 조회에 isBundle query parameter 추가
  • 초기 상품 데이터의 번들 여부 명시
  • docs/payment-order-api-spec.md 및 Swagger 설명 갱신

테스트

  • 테스트를 실행했습니다. ./gradlew :item-service:test (BUILD SUCCESSFUL)
  • 관련 수동 검증을 완료했습니다.
  • 테스트가 필요 없는 변경입니다.

체크리스트

  • 브랜치명이 규칙을 따릅니다.
  • 커밋 메시지가 컨벤션을 따릅니다.
  • 이슈와 PR이 연결되어 있습니다.
  • 작업 완료 후 merge 가능한 상태입니다.

스크린샷 / 참고 자료

  • 없음

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new isBundle field to the Product domain, enabling bundle-based filtering across the shop and admin APIs. It also adds a comprehensive API specification for the payment and order system. A review comment suggests improving the test suite by parameterizing the displayOrder in test helper methods within ShopServiceImplTest to better verify sorting behavior, ensuring consistency with other test classes.

Comment on lines 235 to 248
private Product product(String name, int price, boolean isActive) {
return product(name, price, isActive, false);
}

private Product product(String name, int price, boolean isActive, boolean isBundle) {
return Product.builder()
.name(name)
.description("상품 설명")
.price(price)
.displayOrder(1)
.isActive(isActive)
.isBundle(isBundle)
.build();
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

테스트 헬퍼 메서드 productdisplayOrder1로 하드코딩되어 있습니다. 이로 인해 shouldGetActiveProductsOrderedByDisplayOrderAndId와 같은 테스트에서 displayOrder에 따른 정렬을 제대로 검증하기 어렵습니다. 현재는 id에 의한 2차 정렬만 검증되고 있습니다.

다른 테스트 클래스(ProductRepositoryTest, AdminProductServiceImplTest)에서는 displayOrder를 파라미터로 받아 설정하고 있습니다. 일관성을 유지하고 테스트의 정확성을 높이기 위해 이 메서드에도 displayOrder 파라미터를 추가하는 것을 고려해 보세요.

이렇게 수정하면 shouldGetActiveProductsOrderedByDisplayOrderAndId 테스트에서 displayOrder 값을 다르게 설정하여 정렬 기능(행위)이 올바르게 동작하는지 더 명확하게 검증할 수 있습니다. (이 변경을 적용하려면 헬퍼 메서드를 호출하는 부분의 수정이 필요합니다.)

Suggested change
private Product product(String name, int price, boolean isActive) {
return product(name, price, isActive, false);
}
private Product product(String name, int price, boolean isActive, boolean isBundle) {
return Product.builder()
.name(name)
.description("상품 설명")
.price(price)
.displayOrder(1)
.isActive(isActive)
.isBundle(isBundle)
.build();
}
private Product product(String name, int price, boolean isActive) {
return product(name, price, 1, isActive, false);
}
private Product product(String name, int price, int displayOrder, boolean isActive, boolean isBundle) {
return Product.builder()
.name(name)
.description("상품 설명")
.price(price)
.displayOrder(displayOrder)
.isActive(isActive)
.isBundle(isBundle)
.build();
}
References
  1. 테스트가 구현 상세가 아닌 행위(Behavior)를 검증하는지, 그리고 테스트 메서드 이름이 의도를 잘 드러내는지 검토합니다. 현재 테스트명은 displayOrder 정렬을 암시하지만, 실제로는 검증되지 않고 있습니다. (link)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(product): add bundle flag to product catalog

1 participant