Skip to content

[Feat] 탈퇴 API 수정 #220#221

Merged
hyomee2 merged 1 commit intodevelopfrom
feat/#220-member-delete
Mar 30, 2026
Merged

[Feat] 탈퇴 API 수정 #220#221
hyomee2 merged 1 commit intodevelopfrom
feat/#220-member-delete

Conversation

@eraser502
Copy link
Copy Markdown
Collaborator

@eraser502 eraser502 commented Mar 30, 2026

Related issue 🛠

Work Description 📝

  • 탈퇴 기능 정상 동작하도록 번역 테이블 삭제 메서드를 추가했어요.

ScreenShots 📷

To Reviewers 📢

Summary by CodeRabbit

Bug Fixes

  • 회원 계정 삭제 시 관련된 모든 데이터가 함께 정리되도록 개선했습니다. 삭제 시 회원과 연결된 모든 항목과 다국어 번역 내용이 완전히 제거되어 데이터 무결성이 보장됩니다.

Copy link
Copy Markdown
Collaborator

@hyomee2 hyomee2 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다~

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 30, 2026

📝 Walkthrough

Walkthrough

회원 탈퇴 시 다국어 번역 데이터를 포함한 관련 정보가 제대로 삭제되지 않는 문제를 수정합니다. MemberDeletionService에 여러 저장소를 주입하고, 회원 삭제 전에 MemberTerm 및 다양한 번역 엔티티의 레코드를 대량 삭제하도록 변경했습니다.

Changes

Cohort / File(s) Summary
Repository Deletion Methods
MemberTermRepository, PhaseTranslationRepository, PhaseActionTranslationRepository, PhaseActionGuidelineTranslationRepository, PhaseActionMistakeTranslationRepository, ActionItemTranslationRepository
회원 ID를 기준으로 연관된 데이터를 삭제하는 새로운 deleteAllBy... 메서드 추가. 중첩된 관계 경로를 통해 회원에 연결된 다국어 번역 및 회원 용어 데이터 대량 삭제 지원.
Member Deletion Service
MemberDeletionService
6개의 새로운 저장소 의존성 주입 및 회원 삭제 전에 MemberTerm과 5가지 번역 엔티티(Phase, PhaseAction, PhaseActionGuideline, PhaseActionMistake, ActionItem 번역)를 계층적으로 삭제하도록 수정.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • [Feat] 회원 탈퇴 API 구현 #193: 멤버 삭제 흐름에서 여러 deleteAllBy... 저장소 메서드를 추가하고 MemberDeletionService를 수정하여 회원 관련 데이터의 대량 삭제를 수행하는 변경사항이 이번 PR과 직접적으로 관련됨.

Suggested reviewers

  • jeong1112
  • hyomee2

Poem

🐰 번역의 더미들이 무더기로 쌓여
회원 탈퇴할 때 남겨져 있다니
이제 깔끔하게 모두 치워져
다국어의 바다도 함께 흘러가고
완벽한 이별을 맞이하네! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 PR의 주요 변경사항인 탈퇴 API 수정을 명확하게 요약하고 있으며, 연관 이슈 #220을 참조하여 구체적입니다.
Linked Issues check ✅ Passed PR은 이슈 #220의 목표인 다국어 처리(번역 테이블) 구조와 함께 탈퇴 기능이 정상 동작하도록 수정했습니다.
Out of Scope Changes check ✅ Passed 모든 변경사항은 탈퇴 기능의 번역 테이블 삭제를 위한 저장소 메서드 추가와 삭제 서비스 수정으로 이슈 범위 내입니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/#220-member-delete

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/main/java/org/sopt/kareer/domain/member/service/MemberDeletionService.java (1)

41-59: 성능 최적화 고려사항 (선택 사항)

Spring Data JPA의 파생 deleteAllBy... 메서드는 내부적으로 엔티티를 먼저 조회한 후 개별적으로 삭제합니다. 회원당 번역 레코드가 많은 경우 성능 저하가 발생할 수 있습니다.

대량 데이터가 예상되는 경우 @Modifying @Query``를 사용한 벌크 DELETE 쿼리로 전환을 고려해 볼 수 있습니다:

♻️ 예시: 벌크 DELETE 쿼리
// Repository 예시
`@Modifying`
`@Query`("DELETE FROM PhaseTranslation pt WHERE pt.phase.member.id = :memberId")
void bulkDeleteByMemberId(`@Param`("memberId") Long memberId);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/org/sopt/kareer/domain/member/service/MemberDeletionService.java`
around lines 41 - 59, The current deleteMember flow uses Spring Data derived
deleteAllBy... methods
(phaseActionGuidelineTranslationRepository.deleteAllByGuideline_PhaseAction_Phase_Member_Id,
phaseActionMistakeTranslationRepository.deleteAllByMistake_PhaseAction_Phase_Member_Id,
actionItemTranslationRepository.deleteAllByActionItem_Member_Id,
phaseActionTranslationRepository.deleteAllByPhaseAction_Phase_Member_Id,
phaseTranslationRepository.deleteAllByPhase_Member_Id,
phaseActionGuidelineRepository.deleteAllByPhaseAction_Phase_Member_Id,
phaseActionMistakeRepository.deleteAllByPhaseAction_Phase_Member_Id,
actionItemRepository.deleteAllByMemberId,
phaseActionRepository.deleteAllByPhase_Member_Id,
phaseRepository.deleteAllByMember_Id,
jobPostingBookmarkRepository.deleteAllByMemberId,
memberTermRepository.deleteAllByMemberId,
memberVisaRepository.deleteAllByMemberId) which can trigger N+1 loads; replace
the heavy ones with repository bulk delete methods using `@Modifying` `@Query`
JPQL/SQL that performs DELETE ... WHERE ... = :memberId (e.g. add
bulkDeleteByMemberId variants in the corresponding repositories), annotate those
repository methods with `@Modifying` and `@Transactional` (or call them from the
service transaction), and call the new bulk methods from deleteMember instead of
the derived deleteAllBy... methods to avoid loading entities into memory.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@src/main/java/org/sopt/kareer/domain/member/service/MemberDeletionService.java`:
- Around line 41-59: The current deleteMember flow uses Spring Data derived
deleteAllBy... methods
(phaseActionGuidelineTranslationRepository.deleteAllByGuideline_PhaseAction_Phase_Member_Id,
phaseActionMistakeTranslationRepository.deleteAllByMistake_PhaseAction_Phase_Member_Id,
actionItemTranslationRepository.deleteAllByActionItem_Member_Id,
phaseActionTranslationRepository.deleteAllByPhaseAction_Phase_Member_Id,
phaseTranslationRepository.deleteAllByPhase_Member_Id,
phaseActionGuidelineRepository.deleteAllByPhaseAction_Phase_Member_Id,
phaseActionMistakeRepository.deleteAllByPhaseAction_Phase_Member_Id,
actionItemRepository.deleteAllByMemberId,
phaseActionRepository.deleteAllByPhase_Member_Id,
phaseRepository.deleteAllByMember_Id,
jobPostingBookmarkRepository.deleteAllByMemberId,
memberTermRepository.deleteAllByMemberId,
memberVisaRepository.deleteAllByMemberId) which can trigger N+1 loads; replace
the heavy ones with repository bulk delete methods using `@Modifying` `@Query`
JPQL/SQL that performs DELETE ... WHERE ... = :memberId (e.g. add
bulkDeleteByMemberId variants in the corresponding repositories), annotate those
repository methods with `@Modifying` and `@Transactional` (or call them from the
service transaction), and call the new bulk methods from deleteMember instead of
the derived deleteAllBy... methods to avoid loading entities into memory.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ae39bc03-79d3-4fd5-87e0-1141db656742

📥 Commits

Reviewing files that changed from the base of the PR and between 859efe4 and 6be8ed2.

📒 Files selected for processing (7)
  • src/main/java/org/sopt/kareer/domain/member/repository/MemberTermRepository.java
  • src/main/java/org/sopt/kareer/domain/member/service/MemberDeletionService.java
  • src/main/java/org/sopt/kareer/domain/roadmap/repository/ActionItemTranslationRepository.java
  • src/main/java/org/sopt/kareer/domain/roadmap/repository/PhaseActionGuidelineTranslationRepository.java
  • src/main/java/org/sopt/kareer/domain/roadmap/repository/PhaseActionMistakeTranslationRepository.java
  • src/main/java/org/sopt/kareer/domain/roadmap/repository/PhaseActionTranslationRepository.java
  • src/main/java/org/sopt/kareer/domain/roadmap/repository/PhaseTranslationRepository.java

@hyomee2 hyomee2 merged commit a9fd2b1 into develop Mar 30, 2026
2 checks passed
@hyomee2 hyomee2 deleted the feat/#220-member-delete branch March 30, 2026 15:41
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.

[Feat] 탈퇴 API 수정

2 participants