You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MypageProjectHistoryService의 프로젝트 히스토리 요약 계산 로직이 리팩토링되었다. DONE 상태 프로젝트 집계를 카운트 기반 조회에서 멤버십 목록 기반 조회로 변경하고, 평균 점수를 progressRate 평균값으로 계산하도록 개선했다.
변경사항
프로젝트 히스토리 요약 계산 로직 개선
Layer / File(s)
요약
DONE 프로젝트 요약 계산 리팩토링 src/main/java/com/capstone/pickIt/api/user/service/MypageProjectHistoryService.java
getProjectHistorySummary 메서드에서 DONE 프로젝트 관련 수 집계 방식을 변경했다. 기존 카운트 기반(countDoneConfirmedByUserId, countConfirmedByUserId의 비율)에서 findActiveConfirmedMembershipsWithTeamAndCourse(userId, ProjectTeamStatus.DONE)을 통한 멤버십 목록 직접 조회로 전환했으며, 각 팀의 progressRate를 평균내어 averageScore를 계산한다(널 처리: 0.0). 응답의 projectCount도 doneProjectCount 기반에서 members.size() 기반으로 변경되었고, averageContribution 계산 로직은 유지되었다.
progressRate 평균 계산의 의도: 기존 "완료한 프로젝트 수 / 전체 프로젝트 수" 비율이 아닌 "각 프로젝트의 진행률 평균"으로 변경된 것이 의도된 변경인지 확인 필요. 두 방식의 의미가 다를 수 있다.
null 처리 로직: progressRate가 null인 경우 0.0으로 처리하는 것이 비즈니스 요구사항과 일치하는지 검토 권장.
성능 고려: findActiveConfirmedMembershipsWithTeamAndCourse 호출이 countDoneConfirmedByUserId + countConfirmedByUserId 카운트 쿼리 대비 성능상 더 효율적인지 검토. 큰 목록 조회 시 메모리 사용량도 비교하면 좋다.
팀 영속성 설정: 반환된 멤버십 객체의 team 정보가 제대로 로드되어 있는지 확인 필요(지연 로딩 여부).
🎯 2 (Simple) | ⏱️ ~10분
점수 계산 방식이 비율에서 평균으로 갈아탔네요 🔄
더 이상 나눗셈의 노예가 아니라
평균의 자유를 찾았도다 ✨
(카운트 쿼리가 남기는 향수는 잠시 안녕) 👋
🚥 Pre-merge checks | ✅ 3 | ❌ 2
❌ Failed checks (2 warnings)
Check name
Status
Explanation
Resolution
Description check
⚠️ Warning
PR 설명이 필수 섹션 구조는 유지하지만 모든 항목이 비워져 있거나 미완성 상태입니다. 작업 내용, 테스트 결과, 관련 이슈 등 중요 정보가 기입되지 않았습니다.
관련 이슈 번호, 상세한 작업 내용(변경 전후 로직 비교), Postman 테스트 스크린샷, 필요시 참고 사항을 구체적으로 작성해주세요.
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 (3 passed)
Check name
Status
Explanation
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.
Title check
✅ Passed
제목이 PR의 주요 변경사항과 관련이 있으며, 완수율 로직 수정이라는 핵심 내용을 명확하게 전달합니다.
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ 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 refactor/mypage-168-project
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.
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
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.
🔗 관련 이슈
closes #
📌 작업 내용
🧪 테스트 결과
📸 스크린샷 (선택)
📎 참고 사항 (선택)
Summary by CodeRabbit
릴리스 노트