Skip to content

[Feat/#190] 상품 임시저장을 마켓 목록 동기화 방식으로 변경 - #191

Merged
tnals0924 merged 1 commit into
mainfrom
feat/#190-sync-prepared-product-drafts
Jul 15, 2026
Merged

[Feat/#190] 상품 임시저장을 마켓 목록 동기화 방식으로 변경#191
tnals0924 merged 1 commit into
mainfrom
feat/#190-sync-prepared-product-drafts

Conversation

@tnals0924

Copy link
Copy Markdown
Contributor

#️⃣연관된 이슈

📝작업 내용

상품 임시저장(PUT /draft)이 이제 요청 바디를 마켓 임시저장 목록의 최종 상태로 취급한다. 바디에 없는 ID의 기존 임시저장 상품은 삭제하고, 있는 상품은 갱신한다.

  • PreparedProductRepository에 마켓의 임시저장 상품 ID 목록 조회 메서드(findAllIdsByMarketId) 추가 — 전체 엔티티 대신 ID projection 쿼리로 조회
  • PreparedProductUpdater.updateDraftssyncDrafts(marketId, commands)로 변경. 마켓 기존 임시저장 ID 중 바디에 없는 것은 softDeleteByIds로 삭제, 나머지는 갱신. 삭제·갱신을 @Transactional로 원자적으로 묶음 (PreparedProductConfirmer와 동일한 Implement Layer 패턴)
  • PreparedProductService.saveDrafts가 새 동기화 로직 호출
  • 기존 검증(validateOwnership, validateAllInMarket)은 유지 — 바디 ID는 여전히 해당 마켓의 임시저장 상품이어야 함(새 상품 생성 없음)

💬리뷰 요구사항(선택)

  • 삭제는 soft delete로 처리했습니다. (엔티티가 BaseSoftDeleteEntity, 기존 softDeleteByIds 재사용)
  • 빈 바디는 기존과 동일하게 거부합니다("빈 바디 = 전체 삭제"로 열지 않음).

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@tnals0924, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 4 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 95973562-a8f5-4385-92c7-6ce16fef653a

📥 Commits

Reviewing files that changed from the base of the PR and between 9c357de and a3fbe3c.

📒 Files selected for processing (5)
  • core/src/main/kotlin/kr/dongchimi/core/product/PreparedProductRepository.kt
  • core/src/main/kotlin/kr/dongchimi/core/product/PreparedProductService.kt
  • core/src/main/kotlin/kr/dongchimi/core/product/PreparedProductUpdater.kt
  • infrastructure/db/src/main/kotlin/kr/dongchimi/db/product/PreparedProductJpaRepository.kt
  • infrastructure/db/src/main/kotlin/kr/dongchimi/db/product/PreparedProductRepositoryImpl.kt

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@imddoy imddoy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM~

Comment on lines +20 to +22
val requestIds = commands.map { it.id }.toSet()
val idsToDelete = preparedProductRepository.findAllIdsByMarketId(marketId).filter { it !in requestIds }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

좋아여~

@tnals0924
tnals0924 merged commit 1258cd3 into main Jul 15, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

상품 임시저장을 마켓 목록 동기화 방식으로 변경

2 participants