Skip to content

fix: 삭제된 상점 혜택 조회 제외 (main)#2243

Merged
dh2906 merged 4 commits into
mainfrom
hotfix/delete-shop-benefit-maps
May 14, 2026
Merged

fix: 삭제된 상점 혜택 조회 제외 (main)#2243
dh2906 merged 4 commits into
mainfrom
hotfix/delete-shop-benefit-maps

Conversation

@dh2906
Copy link
Copy Markdown
Contributor

@dh2906 dh2906 commented May 14, 2026

🔍 개요

  • 삭제된 상점의 혜택 매핑이 남아 있어도 혜택 상점 조회가 정상 응답하도록 수정했습니다.
  • shop_benefit_category_map 데이터는 삭제하지 않고, 조회 단계에서 삭제된 상점 매핑을 제외합니다.

🚀 주요 변경 내용

  • 혜택 상점 조회 시 삭제되지 않은 상점 매핑만 조회하도록 필터링합니다.
  • 상점 목록의 혜택 상세 조회도 삭제되지 않은 상점 매핑만 반영하도록 맞췄습니다.
  • 삭제된 상점 매핑이 남아 있는 회귀 케이스를 추가했습니다.

💬 참고 사항

  • 검증: ./gradlew test --tests 'in.koreatech.koin.acceptance.domain.BenefitApiTest' --tests 'in.koreatech.koin.acceptance.admin.AdminShopApiTest.어드민이_상점을_삭제한다' --rerun-tasks
  • 결과: BenefitApiTest 2개, AdminShopApiTest.어드민이_상점을_삭제한다 통과, failures 0, errors 0

✅ Checklist (완료 조건)

  • 코드 스타일 가이드 준수
  • 테스트 코드 포함됨
  • Reviewers / Assignees / Labels 지정 완료
  • 보안 및 민감 정보 검증 (API 키, 환경 변수, 개인정보 등)

Compound Engineering
GPT-5

- 상점 soft delete 시 남아 있는 혜택 매핑을 함께 삭제한다
- 삭제된 상점의 혜택 매핑이 조회 오류로 이어지지 않도록 데이터 정합성을 맞춘다
- 상점 삭제 API 회귀 테스트에 혜택 매핑 삭제 검증을 추가한다
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f012f478-8a9a-4ca9-aef9-2639a834f45f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hotfix/delete-shop-benefit-maps

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 and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 14, 2026

Unit Test Results

691 tests   688 ✔️  2m 13s ⏱️
169 suites      3 💤
169 files        0

Results for commit ac1a3a1.

♻️ This comment has been updated with latest results.

@dh2906 dh2906 self-assigned this May 14, 2026
@dh2906 dh2906 added the 버그 정상적으로 동작하지 않는 문제상황입니다. label May 14, 2026
Copy link
Copy Markdown
Collaborator

@Soundbar91 Soundbar91 left a comment

Choose a reason for hiding this comment

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

연관관계를 활용해서 삭제하는 방법은 별로일가요

    @OneToMany(mappedBy = "shop", orphanRemoval = true, cascade = {PERSIST, REFRESH, MERGE, REMOVE})
    private List<BenefitCategoryMap> benefitCategoryMaps = new ArrayList<>();

Copy link
Copy Markdown
Collaborator

@Soundbar91 Soundbar91 left a comment

Choose a reason for hiding this comment

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

아 소프트 딜리트이구나

Copy link
Copy Markdown
Collaborator

@Soundbar91 Soundbar91 left a comment

Choose a reason for hiding this comment

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

Shop가 소프트딜리트로 구현이 되어 있으니, BenefitCategoryMap도 컬럼을 추가해서 소프트 딜리트로 구현을 해야할 거 같아요. 하드 딜리트로 구현을 해버리면, Shop를 복구했을 때 데이터가 모두 삭제되는 문제가 발생할 거 같습니당

지금은 임시로 혜택 조회 과정에서 삭제된 상점에 대해서는 조회를 하지 않는 방향으로 가는 게 좋아보여요 ! flyway를 추가하면 지금 develop 브랜치의 flyway 버전이랑 꼬이는 문제가 있어서 쉽지 않아질 거 같아요.

@dh2906
Copy link
Copy Markdown
Contributor Author

dh2906 commented May 14, 2026

원래는 소프트 딜리트된 상점의 혜택은 안보이게 필터링 하려 했는데 그냥 지우는게 어떻냐고 해서 혜택은 하드 딜리트로 해놨습니당
그럼 일단 이전처럼 필터링되게 핫픽스 하고 develop 브랜치에는 소프트 딜리트 방식으로 들어가게 추가 작업 해두겠습니닷

- 기존 매핑 데이터가 남아 있어도 삭제된 상점은 혜택 상점 조회에서 제외한다
- 상점 목록의 혜택 상세 조회도 삭제되지 않은 상점 매핑만 반영하도록 맞춘다
- 삭제된 상점 매핑이 남아 있는 회귀 케이스를 추가해 조회 오류를 방지한다
@dh2906
Copy link
Copy Markdown
Contributor Author

dh2906 commented May 14, 2026

아 그리고 지금 main, develop 브랜치의 커밋 해시가 꼬인 것 같아 핫픽스를 develop에 적용할땐 main -> develop 으로 해야할 것 같아요

Copy link
Copy Markdown
Collaborator

@Soundbar91 Soundbar91 left a comment

Choose a reason for hiding this comment

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

고생하셨습니당
하드 딜리트 코드만 삭제해주시면 될 거 같아요 !

제가 배포할 때 main에 체리픽으로 올려야했는데, 배포를 잘못했네요 ;;

- 상점 soft delete 시 혜택 매핑을 삭제하지 않도록 되돌린다
- 기존 매핑 데이터는 조회 단계의 삭제 상점 필터링으로 방어한다
- 상점 삭제 API 테스트는 soft delete 상태만 검증하도록 복원한다
@dh2906 dh2906 changed the title fix: 상점 삭제 시 혜택 매핑 정리 (main) fix: 삭제된 상점 혜택 조회 제외 (main) May 14, 2026
- 혜택 매핑 삭제 처리 제거 과정에서 남은 import 순서와 공백 변경을 되돌린다
- 최종 변경 범위를 삭제된 상점 혜택 조회 필터링으로 한정한다
Copy link
Copy Markdown

@hgjwilly-koreatech hgjwilly-koreatech left a comment

Choose a reason for hiding this comment

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

고생하셨습니다~!

@dh2906 dh2906 merged commit 779cc83 into main May 14, 2026
6 checks passed
@dh2906 dh2906 deleted the hotfix/delete-shop-benefit-maps branch May 14, 2026 06:18
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.

3 participants