[Fix] 지원서 전체 삭제 시 평가(applicant_eval) 미삭제로 인한 FK 위반 수정#179
Merged
Conversation
평가 어드민 기능(#170) 추가 후 applicant_eval.applicant_id NOT NULL FK가 생겼으나 deleteApplicants가 이를 정리하지 않아, 평가가 존재하는 공고는 지원서 전체 삭제가 FK 제약 위반으로 실패하던 문제를 수정. - ApplicantEvalRepository.deleteByRecruitmentId 서브쿼리 벌크 삭제 추가 - deleteApplicants 삭제 순서를 eval -> answer -> applicant 로 정정 - 단위/리포지토리/통합 테스트에 평가 존재 케이스 회귀 테스트 추가
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💡 개요
🪐 주요 변경 사항
deleteApplicants)가applicant_eval을 정리하지 않아, 평가가 존재하는 공고 삭제 시 FK 제약 위반으로 실패하던 버그 수정applicant_eval → applicant_answer → applicant)로 정정✅ 상세 내용
ApplicantEvalRepository:deleteByRecruitmentId서브쿼리 벌크 삭제 메서드 추가 (기존ApplicantAnswerRepository와 동일 패턴, 메모리 적재 없이 삭제)RecruitmentService.deleteApplicants: 기존answer → applicant순서 앞에applicant_eval삭제를 추가하여eval → answer → applicant순서로 정정applicant_eval.applicant_id(NOT NULL FK,ON DELETE CASCADE없음)가 생겼으나 삭제 로직이 미반영된 상태였음RecruitmentServiceTest:ApplicantEvalRepositorymock 추가, 삭제 순서 검증을eval → answer → applicant로 갱신ApplicantEvalRepositoryTest:deleteByRecruitmentId— 대상 공고 평가만 삭제하고 타 공고 평가는 유지하는지 검증RecruitmentIntegrationTest: end-to-end 삭제 테스트에 평가 데이터를 추가하여 평가 존재 공고도 FK 위반 없이 삭제되는지 실제 DB로 검증 (회귀 방지)🔔 참고 사항
./gradlew test, Testcontainers/Docker 기동 상태)docs/test/TC-REC-ADMIN-010.md)도 함께 갱신 (해당 경로는 gitignore 대상이라 커밋에는 미포함)