Skip to content

fix: GPA 상태 조회에 모학교명 반환#799

Merged
lsy1307 merged 2 commits into
developfrom
fix/797-return-home-university-name-in-gpa
Jun 27, 2026
Merged

fix: GPA 상태 조회에 모학교명 반환#799
lsy1307 merged 2 commits into
developfrom
fix/797-return-home-university-name-in-gpa

Conversation

@lsy1307

@lsy1307 lsy1307 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

관련 이슈

작업 내용

  • GPA 점수 상태 조회 응답에 사용자의 모학교명(homeUniversityName)을 추가했습니다.
  • 사용자의 homeUniversityId가 존재하는 경우 HomeUniversity를 조회해 모학교명을 응답에 포함하도록 수정했습니다.
  • 사용자의 모학교 정보가 없는 경우 기존 GPA 상태 조회는 유지하면서 homeUniversityNamenull로 반환하도록 처리했습니다.
  • GPA 상태 조회 테스트를 검증 목적별로 분리했습니다.
    • GPA 점수 상태 목록 조회 검증
    • 모학교명이 응답에 포함되는지 검증
    • 모학교가 없는 사용자는 모학교명이 null인지 검증

특이 사항

  • 기존 GPA 점수 상태 목록 응답 구조에 homeUniversityName 필드가 추가되므로, 프론트엔드에서 해당 필드를 사용할 수 있습니다.
  • homeUniversityId가 저장되어 있는데 실제 모학교 데이터가 존재하지 않는 경우에는 기존 예외 정책에 맞춰 UNIVERSITY_NOT_FOUND 예외가 발생합니다.
  • 검증 결과
    • ./gradlew compileTestJava 통과
    • ./gradlew test --tests "com.example.solidconnection.score.service.ScoreServiceTest"는 Docker/Testcontainers 환경을 찾지 못해 실행 실패

리뷰 요구사항 (선택)

  • getGpaScoreStatus에서 GPA 상태 목록 조회와 모학교명 조회를 함께 수행하는 흐름이 API 응답 요구사항에 적절한지 확인 부탁드립니다.
  • 모학교가 없는 사용자의 homeUniversityName = null 처리 방식이 프론트엔드 기대값과 맞는지 확인 부탁드립니다.

- GPA 상태 조회 응답에 사용자의 모학교명을 포함

- 모학교가 없는 사용자는 모학교명을 null로 반환

- GPA 상태 조회 테스트를 검증 목적별로 분리
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

  1. 응답과 조회 경로 변경

    • GpaScoreStatusesResponsehomeUniversityName과 GPA 상태 목록을 받도록 확장됐습니다.
    • ScoreServiceMyPageService가 홈대학명을 공통 조회 서비스로 가져오도록 바뀌었습니다.
  2. 공통 조회 서비스와 오류 추가

    • HomeUniversityQueryService가 추가됐습니다.
    • SCHOOL_EMAIL_NOT_VERIFIED 오류 코드가 추가됐습니다.
  3. 테스트 갱신

    • ScoreServiceTest에 홈대학명 반환과 미등록 시 예외 검증이 추가됐습니다.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Suggested reviewers

  • wibaek
  • nayonsoso
  • Hexeong
  • JAEHEE25
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 7.14% 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 제목이 GPA 응답에 모학교명을 반환하도록 바뀐 핵심 변경을 정확히 요약합니다.
Description check ✅ Passed 필수 섹션이 모두 있어 템플릿을 대부분 충족합니다.
Linked Issues check ✅ Passed 이슈 #797의 핵심인 GPA 응답에 사용자의 모학교명을 포함하도록 수정되어 요구사항을 충족합니다.
Out of Scope Changes check ✅ Passed GPA 응답 변경과 이를 뒷받침하는 서비스·테스트·에러코드 추가만 있어 범위를 벗어난 변경은 보이지 않습니다.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/797-return-home-university-name-in-gpa

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.

@lsy1307 lsy1307 self-assigned this Jun 26, 2026
@lsy1307 lsy1307 added the 버그 Something isn't working label Jun 26, 2026
@lsy1307 lsy1307 marked this pull request as ready for review June 26, 2026 14:02

@Hexeong Hexeong left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

고생하십니다! 의견드립니다~

Comment thread src/main/java/com/example/solidconnection/score/service/ScoreService.java Outdated
Comment thread src/main/java/com/example/solidconnection/score/service/ScoreService.java Outdated
- 모학교 조회 로직을 HomeUniversityQueryService로 분리

- GPA 상태 조회 시 학교 미인증 사용자는 예외 처리

- 마이페이지는 미인증 사용자 모학교명을 null로 유지

- GPA 상태 조회 테스트를 학교 인증 정책에 맞게 수정

@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.

🧹 Nitpick comments (1)
src/main/java/com/example/solidconnection/university/service/HomeUniversityQueryService.java (1)

37-41: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

HomeUniversity 전용 오류 코드(HOME_UNIVERSITY_NOT_FOUND)를 사용하는 게 더 정확합니다.

이 메서드는 HomeUniversity를 조회하는데, 누락 시 일반적인 UNIVERSITY_NOT_FOUND("대학교를 찾을 수 없습니다.")를 던지고 있어요. ErrorCode에는 이미 HOME_UNIVERSITY_NOT_FOUND("협정 대학교를 찾을 수 없습니다.")라는 더 구체적인 코드가 마련되어 있으니, 이 쪽을 쓰면 협정 대학 조회 실패임을 한눈에 알 수 있어 추적과 클라이언트 처리가 편해집니다.

다만 homeUniversityId는 외래키로 보장되어 실제로는 거의 발생하지 않는 케이스이니, 우선순위는 높지 않은 다듬기 정도로 봐주세요.

♻️ 제안 변경
-import static com.example.solidconnection.common.exception.ErrorCode.UNIVERSITY_NOT_FOUND;
+import static com.example.solidconnection.common.exception.ErrorCode.HOME_UNIVERSITY_NOT_FOUND;
     private String findNameById(Long homeUniversityId) {
         HomeUniversity homeUniversity = homeUniversityRepository.findById(homeUniversityId)
-                .orElseThrow(() -> new CustomException(UNIVERSITY_NOT_FOUND));
+                .orElseThrow(() -> new CustomException(HOME_UNIVERSITY_NOT_FOUND));
         return homeUniversity.getName();
     }
🤖 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/university/service/HomeUniversityQueryService.java`
around lines 37 - 41, The findNameById method in HomeUniversityQueryService is
throwing the generic UNIVERSITY_NOT_FOUND error for a HomeUniversity lookup;
switch it to the more specific HOME_UNIVERSITY_NOT_FOUND CustomException so the
failure clearly matches the entity being queried. Update the orElseThrow in
findNameById to use the HomeUniversity-specific error code, keeping the rest of
the lookup and return flow unchanged.
🤖 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.

Nitpick comments:
In
`@src/main/java/com/example/solidconnection/university/service/HomeUniversityQueryService.java`:
- Around line 37-41: The findNameById method in HomeUniversityQueryService is
throwing the generic UNIVERSITY_NOT_FOUND error for a HomeUniversity lookup;
switch it to the more specific HOME_UNIVERSITY_NOT_FOUND CustomException so the
failure clearly matches the entity being queried. Update the orElseThrow in
findNameById to use the HomeUniversity-specific error code, keeping the rest of
the lookup and return flow unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 08e2f290-568a-4bbb-a747-b11ea3e7d3ec

📥 Commits

Reviewing files that changed from the base of the PR and between 804dcf0 and 79e1171.

📒 Files selected for processing (5)
  • src/main/java/com/example/solidconnection/common/exception/ErrorCode.java
  • src/main/java/com/example/solidconnection/score/service/ScoreService.java
  • src/main/java/com/example/solidconnection/siteuser/service/MyPageService.java
  • src/main/java/com/example/solidconnection/university/service/HomeUniversityQueryService.java
  • src/test/java/com/example/solidconnection/score/service/ScoreServiceTest.java

@lsy1307 lsy1307 added the 최종 리뷰 최소 1명 필수 label Jun 27, 2026
@lsy1307 lsy1307 merged commit d3409d5 into develop Jun 27, 2026
3 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 최종 리뷰 최소 1명 필수

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: gpa에서 사용자의 모학교 이름을 반환하도록 수정

3 participants