fix: 파트별 평가기준 카운트 로직 수정#170
Conversation
Walkthrough.gitignore 파일에 Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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
🤖 Fix all issues with AI agents
In
`@src/main/java/KUSITMS/WITHUS/domain/application/application/dto/ApplicationResponseDTO.java`:
- Around line 293-307: application.getOrganizationRole() may be null which
causes matchesOrganizationRole(...) to exclude all role-scoped criteria; update
the filtering to treat a null appRole as "no role filter" so role-scoped
criteria are not accidentally dropped: when computing documentCriteriaCount and
when building userDocsEvaluations, change the role checks to short-circuit
accept when appRole == null (e.g. replace filter(... matchesOrganizationRole(c,
appRole)) with a condition like appRole == null ||
matchesOrganizationRole(...)), ensuring documentMaxScore and evaluation filters
use this adjusted logic; reference Application.getOrganizationRole(), appRole,
matchesOrganizationRole(...), documentCriteriaCount, userDocsEvaluations, and
documentMaxScore.
🧹 Nitpick comments (1)
.gitignore (1)
52-52: 중복된/docs/패턴은 하나만 남겨주세요.
Line 45에 이미/docs/가 있어서 Line 52 추가는 중복입니다. 유지보수 혼선을 줄이기 위해 한 줄만 남기는 게 좋습니다.♻️ 제안 변경
-/docs/
| OrganizationRole appRole = application.getOrganizationRole(); | ||
|
|
||
| int documentCriteriaCount = (int) recruitment | ||
| .getEvaluationCriteriaList() | ||
| .stream() | ||
| .filter(c -> c.getEvaluationType() == EvaluationType.DOCUMENT) | ||
| .filter(c -> matchesOrganizationRole(c, appRole)) | ||
| .count(); | ||
| int documentMaxScore = documentCriteriaCount * 10; | ||
|
|
||
| List<Evaluation> userDocsEvaluations = application.getEvaluations().stream() | ||
| .filter(e -> e.getUser().getId().equals(currentUserId)) | ||
| .filter(e -> e.getCriteria().getEvaluationType() == EvaluationType.DOCUMENT) | ||
| .filter(e -> matchesOrganizationRole(e.getCriteria(), appRole)) | ||
| .toList(); |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Find Application.java file
APP_FILES=$(find . -type f -name "Application.java" 2>/dev/null | grep -E 'domain|entity' | head -5)
if [ -z "$APP_FILES" ]; then
echo "Searching for Application.java more broadly..."
APP_FILES=$(find . -type f -name "Application.java" 2>/dev/null | head -5)
fi
if [ -z "$APP_FILES" ]; then
echo "Application.java not found"
exit 0
fi
echo "$APP_FILES" | while read -r f; do
echo "=== Found: $f ==="
# Show file size to determine read strategy
wc -l "$f"
doneRepository: WITHUS-K/WITHUS-BE
Length of output: 252
🏁 Script executed:
#!/bin/bash
# Once we know the file, let's examine the organizationRole field definition
find . -type f -name "Application.java" 2>/dev/null | grep -E 'domain|entity' | head -1 | xargs -I {} bash -c 'cat -n {} | grep -A 10 -B 2 "organizationRole"'Repository: WITHUS-K/WITHUS-BE
Length of output: 2429
🏁 Script executed:
#!/bin/bash
# Search for `@NotNull`, `@NonNull`, or other nullability annotations on organizationRole
rg -n '@(NotNull|NonNull|Nullable|Column|JoinColumn).*organizationRole|organizationRole.*@(NotNull|NonNull|Nullable)' -A 2 -B 2 src/main/javaRepository: WITHUS-K/WITHUS-BE
Length of output: 44
🏁 Script executed:
#!/bin/bash
# Check matchesOrganizationRole method implementation
rg -n 'matchesOrganizationRole' -A 10 src/main/javaRepository: WITHUS-K/WITHUS-BE
Length of output: 4146
organizationRole이 null일 때 역할 기반 기준이 완전히 제외되는 문제 확인됨.
Application.organizationRole 필드에는 @NotNull 또는 @NonNull 제약이 없어 null이 될 수 있습니다. matchesOrganizationRole() 메서드를 보면 appRole == null일 때 false를 반환하므로, 역할이 지정된 모든 기준이 필터링되어 documentCriteriaCount가 0이 될 수 있습니다. 이는 documentMaxScore와 평가 완료 여부 판단 로직에 직접 영향을 미칩니다. 다음 중 하나를 고려해주세요:
organizationRole필드에@NotNull제약 추가appRole이 null일 때 필터 로직 조정- null 상황에 대한 명시적 처리 추가
🤖 Prompt for AI Agents
In
`@src/main/java/KUSITMS/WITHUS/domain/application/application/dto/ApplicationResponseDTO.java`
around lines 293 - 307, application.getOrganizationRole() may be null which
causes matchesOrganizationRole(...) to exclude all role-scoped criteria; update
the filtering to treat a null appRole as "no role filter" so role-scoped
criteria are not accidentally dropped: when computing documentCriteriaCount and
when building userDocsEvaluations, change the role checks to short-circuit
accept when appRole == null (e.g. replace filter(... matchesOrganizationRole(c,
appRole)) with a condition like appRole == null ||
matchesOrganizationRole(...)), ensuring documentMaxScore and evaluation filters
use this adjusted logic; reference Application.getOrganizationRole(), appRole,
matchesOrganizationRole(...), documentCriteriaCount, userDocsEvaluations, and
documentMaxScore.
✨ Related Issue
📌 Task Details
💬 Review Requirements (Optional)
Summary by CodeRabbit
Chores
New Features
✏️ Tip: You can customize this high-level summary in your review settings.