Skip to content

fix: 지원자 목록을 모교 기준으로 조회하도록 수정 - #826

Merged
sukangpunch merged 3 commits into
developfrom
hotfix/scope-applicants-by-home-university
Aug 4, 2026
Merged

fix: 지원자 목록을 모교 기준으로 조회하도록 수정#826
sukangpunch merged 3 commits into
developfrom
hotfix/scope-applicants-by-home-university

Conversation

@sukangpunch

Copy link
Copy Markdown
Contributor

관련 이슈

  • resolves: #

작업 내용

지원자 목록 조회(GET /applications)에 모교 필터가 없어, 다른 학교의 지원 대학과 지원자까지 함께 조회되던 문제를 수정했습니다.

  • UnivApplyInfoFilterRepository.findAllByRegionCodeAndKeywordsAndTermIdAndHomeUniversityId — 지원 대학 조회 조건에 모교 아이디를 추가했습니다. 모교는 필수 조건이 되었으므로 leftJoinjoin으로 변경했습니다.
  • ApplicationQueryService.getApplicants — 모교가 등록되지 않은 사용자는 지원 현황 미리보기(/applications/preview)와 동일하게 SCHOOL_EMAIL_NOT_VERIFIED 예외를 반환합니다.

특이 사항

한 파견 대학을 여러 모교가 동시에 제공하는 경우(예: A대와 B대가 모두 도쿄대학을 제공), 수정 전에는 A대 사용자에게 B대의 지원 대학과 지원자가 함께 노출되었습니다.

3개 모교에 각각 지원 대학과 지원자를 만들어 로컬에서 수동 검증했습니다.

  • 각 모교 사용자에게 자신의 모교 지원 대학만 응답됨 (공유 파견 대학이 있어도 분리됨)
  • 지망 배열 길이가 모교별 max_choice_count를 따름 (3지망 / 5지망)
  • region 필터, APPROVED 상태 필터, 현재 학기 필터 정상 동작
  • 모교 미등록 사용자는 SCHOOL_EMAIL_NOT_VERIFIED 반환

리뷰 요구사항 (선택)

leftJoinjoin 변경으로 home_university_idNULL인 기존 지원 대학 데이터는 조회 대상에서 제외됩니다. 운영 데이터에 해당 케이스가 있는지 확인이 필요합니다.

🤖 Generated with Claude Code

지원자 목록 조회 시 모교 필터가 없어 다른 학교의 지원 대학과 지원자까지
조회되던 문제를 수정한다. 모교가 등록되지 않은 사용자는 지원 현황
미리보기와 동일하게 예외를 반환한다.
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@sukangpunch, you've reached your PR review limit, so we couldn't start this review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 11cb40a0-228c-441c-9aa4-495dcb203579

📥 Commits

Reviewing files that changed from the base of the PR and between 3eb0cf2 and db6c30d.

📒 Files selected for processing (1)
  • src/main/java/com/example/solidconnection/application/service/ApplicationQueryService.java

Walkthrough

  1. 모교 기반 지원자 조회
    사용자의 모교 ID를 확인하고, 모교가 없으면 SCHOOL_EMAIL_NOT_VERIFIED 예외를 발생시킵니다.

  2. 저장소 필터 변경
    지역, 키워드, 학기 조건에 모교 ID 조건을 추가했습니다. 모교를 inner join으로 조회합니다.

  3. 테스트 및 fixture 보강
    모교별 지원 대학·지원자 필터링과 모교 미등록 사용자 예외를 검증하는 테스트를 추가했습니다.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: gyuhyeok99, whqtker, wibaek

🚥 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
Title check ✅ Passed 제목이 지원자 목록을 모교 기준으로 조회하도록 수정한 핵심 변경 사항을 정확하고 간결하게 설명합니다.
Description check ✅ Passed 작업 내용, 특이 사항, 검증 결과, 운영 데이터 확인 사항을 포함해 대부분의 템플릿 요구사항을 충족합니다.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hotfix/scope-applicants-by-home-university

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.

@sukangpunch sukangpunch self-assigned this Aug 4, 2026
@sukangpunch sukangpunch added the 버그 Something isn't working label Aug 4, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between a69ca4b and 3eb0cf2.

📒 Files selected for processing (5)
  • src/main/java/com/example/solidconnection/application/service/ApplicationQueryService.java
  • src/main/java/com/example/solidconnection/university/repository/custom/UnivApplyInfoFilterRepository.java
  • src/main/java/com/example/solidconnection/university/repository/custom/UnivApplyInfoFilterRepositoryImpl.java
  • src/test/java/com/example/solidconnection/application/service/ApplicationQueryServiceTest.java
  • src/test/java/com/example/solidconnection/siteuser/fixture/SiteUserFixture.java

Comment on lines +68 to +85
@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());

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

1. API 예외 순서를 보장하십시오.

ApplicationController.getApplicantsgetApplicants 전에 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +83 to +85
List<UnivApplyInfo> univApplyInfos = universityFilterRepository
.findAllByRegionCodeAndKeywordsAndTermId(regionCode, keywords, term.getId());
.findAllByRegionCodeAndKeywordsAndTermIdAndHomeUniversityId(
regionCode, keywords, term.getId(), siteUser.getHomeUniversityId());

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@sukangpunch sukangpunch added the 진행 중 자유롭게 merge 가능 label Aug 4, 2026
@sukangpunch
sukangpunch merged commit 2a8ec34 into develop Aug 4, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

버그 Something isn't working 진행 중 자유롭게 merge 가능

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant