-
Notifications
You must be signed in to change notification settings - Fork 8
fix: 지원자 목록을 모교 기준으로 조회하도록 수정 #826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,21 +60,29 @@ public ApplicationPreviewResponse getApplicantUniversityPreviews(long siteUserId | |
| applicationRepository.findApplicantUniversityPreviews( | ||
| VerifyStatus.APPROVED, | ||
| term.getId(), | ||
| siteUser.getHomeUniversityId()) | ||
| siteUser.getHomeUniversityId() | ||
| ) | ||
| ); | ||
| } | ||
|
|
||
| @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()); | ||
|
Comment on lines
+83
to
+85
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a user from another home university has an approved application whose choice points at one of this viewer's Useful? React with 👍 / 👎. |
||
| if (univApplyInfos.isEmpty()) { | ||
| return new ApplicationsResponse(List.of()); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
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.getApplicants는getApplicants전에validateSiteUserCanViewApplicants를 호출합니다. 모교가 없는 사용자는 Line 74의 검사 전에 다른 지원서 검증 처리 또는 예외를 받을 수 있습니다.validateSiteUserCanViewApplicants에서homeUniversityId를 먼저 검사하십시오. 컨트롤러 경로를 호출하는 테스트도 추가하십시오.🤖 Prompt for AI Agents