fix: 지원자 목록을 모교 기준으로 조회하도록 수정 - #826
Conversation
지원자 목록 조회 시 모교 필터가 없어 다른 학교의 지원 대학과 지원자까지 조회되던 문제를 수정한다. 모교가 등록되지 않은 사용자는 지원 현황 미리보기와 동일하게 예외를 반환한다.
|
Warning Review limit reached
Next review available in: 57 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Walkthrough
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@src/main/java/com/example/solidconnection/application/service/ApplicationQueryService.java`:
- Around line 68-85: Update validateSiteUserCanViewApplicants to check the
requesting SiteUser’s homeUniversityId before performing any other
applicant-validation logic, throwing SCHOOL_EMAIL_NOT_VERIFIED when it is
absent. Ensure the ApplicationController.getApplicants path invokes this
validation first, and add coverage for a controller request from a user without
a home university.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 17c40ee2-b827-47b6-b81b-8f042e88b681
📒 Files selected for processing (5)
src/main/java/com/example/solidconnection/application/service/ApplicationQueryService.javasrc/main/java/com/example/solidconnection/university/repository/custom/UnivApplyInfoFilterRepository.javasrc/main/java/com/example/solidconnection/university/repository/custom/UnivApplyInfoFilterRepositoryImpl.javasrc/test/java/com/example/solidconnection/application/service/ApplicationQueryServiceTest.javasrc/test/java/com/example/solidconnection/siteuser/fixture/SiteUserFixture.java
| @Transactional(readOnly = true) | ||
| public ApplicationsResponse getApplicants(long siteUserId, String regionCode, String keyword) { | ||
| SiteUser siteUser = siteUserRepository.findById(siteUserId) | ||
| .orElseThrow(() -> new CustomException(USER_NOT_FOUND)); | ||
| Long homeUniversityId = siteUser.getHomeUniversityId(); | ||
|
|
||
| if (homeUniversityId == null) { | ||
| throw new CustomException(SCHOOL_EMAIL_NOT_VERIFIED); | ||
| } | ||
|
|
||
| List<String> keywords = StringUtils.isNotBlank(keyword) ? List.of(keyword) : List.of(); | ||
|
|
||
| Term term = termRepository.findByIsCurrentTrue() | ||
| .orElseThrow(() -> new CustomException(CURRENT_TERM_NOT_FOUND)); | ||
|
|
||
| List<UnivApplyInfo> univApplyInfos = universityFilterRepository | ||
| .findAllByRegionCodeAndKeywordsAndTermId(regionCode, keywords, term.getId()); | ||
| .findAllByRegionCodeAndKeywordsAndTermIdAndHomeUniversityId( | ||
| regionCode, keywords, term.getId(), siteUser.getHomeUniversityId()); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
1. API 예외 순서를 보장하십시오.
ApplicationController.getApplicants는 getApplicants 전에 validateSiteUserCanViewApplicants를 호출합니다. 모교가 없는 사용자는 Line 74의 검사 전에 다른 지원서 검증 처리 또는 예외를 받을 수 있습니다.
validateSiteUserCanViewApplicants에서 homeUniversityId를 먼저 검사하십시오. 컨트롤러 경로를 호출하는 테스트도 추가하십시오.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@src/main/java/com/example/solidconnection/application/service/ApplicationQueryService.java`
around lines 68 - 85, Update validateSiteUserCanViewApplicants to check the
requesting SiteUser’s homeUniversityId before performing any other
applicant-validation logic, throwing SCHOOL_EMAIL_NOT_VERIFIED when it is
absent. Ensure the ApplicationController.getApplicants path invokes this
validation first, and add coverage for a controller request from a user without
a home university.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3eb0cf2660
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| List<UnivApplyInfo> univApplyInfos = universityFilterRepository | ||
| .findAllByRegionCodeAndKeywordsAndTermId(regionCode, keywords, term.getId()); | ||
| .findAllByRegionCodeAndKeywordsAndTermIdAndHomeUniversityId( | ||
| regionCode, keywords, term.getId(), siteUser.getHomeUniversityId()); |
There was a problem hiding this comment.
Filter applicants by the viewer's home as well
When a user from another home university has an approved application whose choice points at one of this viewer's UnivApplyInfo IDs, this path still includes that applicant because only the university list is scoped by homeUniversityId; ApplicationSubmissionService.getValidUnivApplyInfos currently accepts any existing choice ID, and the later findAllByUnivApplyInfoIds query does not join/filter the applicant's SiteUser.homeUniversityId. Please also enforce the home-university match at submission or filter the returned applications by the applicant's home so /applications cannot still expose other-home applicants for in-scope university IDs.
Useful? React with 👍 / 👎.
관련 이슈
작업 내용
지원자 목록 조회(
GET /applications)에 모교 필터가 없어, 다른 학교의 지원 대학과 지원자까지 함께 조회되던 문제를 수정했습니다.UnivApplyInfoFilterRepository.findAllByRegionCodeAndKeywordsAndTermIdAndHomeUniversityId— 지원 대학 조회 조건에 모교 아이디를 추가했습니다. 모교는 필수 조건이 되었으므로leftJoin을join으로 변경했습니다.ApplicationQueryService.getApplicants— 모교가 등록되지 않은 사용자는 지원 현황 미리보기(/applications/preview)와 동일하게SCHOOL_EMAIL_NOT_VERIFIED예외를 반환합니다.특이 사항
한 파견 대학을 여러 모교가 동시에 제공하는 경우(예: A대와 B대가 모두 도쿄대학을 제공), 수정 전에는 A대 사용자에게 B대의 지원 대학과 지원자가 함께 노출되었습니다.
3개 모교에 각각 지원 대학과 지원자를 만들어 로컬에서 수동 검증했습니다.
max_choice_count를 따름 (3지망 / 5지망)region필터,APPROVED상태 필터, 현재 학기 필터 정상 동작SCHOOL_EMAIL_NOT_VERIFIED반환리뷰 요구사항 (선택)
leftJoin→join변경으로home_university_id가NULL인 기존 지원 대학 데이터는 조회 대상에서 제외됩니다. 운영 데이터에 해당 케이스가 있는지 확인이 필요합니다.🤖 Generated with Claude Code