[fix] 회원 복구 시 비활성화된 사업장 재활성화#188
Conversation
- UserWithdrawService에 restoreEmployerWorkplaces() 추가 - restoreWithKakao에서 user.restore() 직후 사업장 재활성화 호출 - 탈퇴 후 복구 시 동일 사업자번호로 사업장 재등록할 수 없던 버그(#187) 해결
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
검토 개요고용주 계정의 회원 탈퇴 후 복구 시 비활성화된 사업장을 자동으로 재활성화하는 기능을 추가합니다. 이는 이슈 변경 사항고용주 사업장 복원
관련 가능성 있는 PR
🎯 2 (Simple) | ⏱️ ~15 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
🔖 관련 GitHub Issue
📝 변경 사항
주요 변경 내용
UserWithdrawService에restoreEmployerWorkplaces()메서드 추가AuthService.restoreWithKakao()에서user.restore()직후 사업장 재활성화 호출AuthServiceTest,UserWithdrawServiceTest)상세 설명
버그 원인
탈퇴 시
withdrawEmployer()가 고용주의 모든Workplace를isActive=false로 비활성화하지만, 복구 시restoreWithKakao()는User.deletedAt = null만 되돌리고 사업장을 재활성화하지 않았습니다.그 결과 복구 후 사업장 목록은 비어있는 것처럼 보이지만, DB에는
isActive=false인 row가 남아있어 동일business_number로 사업장을 재등록하려 하면 UNIQUE 제약 위반이 발생했습니다.수정 방법
UserWithdrawService.restoreEmployerWorkplaces(User user)를 추가하여 EMPLOYER 타입 복구 시workplaceRepository.findByEmployerIdAndIsActive(employerId, false)로 비활성 사업장을 조회해 일괄activate()합니다.Workplace.activate()메서드 및findByEmployerIdAndIsActive()쿼리는 기존 코드 재사용📸 스크린샷 (선택사항)
백엔드 버그 수정으로 해당 없음
✅ 체크리스트
🔗 관련 PR
Summary by CodeRabbit
릴리스 노트
새로운 기능
테스트