Skip to content

fix: 파트별 평가기준 카운트 로직 수정#170

Merged
SeongHo5356 merged 1 commit into
developfrom
fix/169-evaluated
Jan 26, 2026
Merged

fix: 파트별 평가기준 카운트 로직 수정#170
SeongHo5356 merged 1 commit into
developfrom
fix/169-evaluated

Conversation

@SeongHo5356
Copy link
Copy Markdown
Member

@SeongHo5356 SeongHo5356 commented Jan 26, 2026

✨ Related Issue


📌 Task Details

  • Task 1
  • Task 2

💬 Review Requirements (Optional)

Summary by CodeRabbit

  • Chores

    • .gitignore에 문서 디렉토리 무시 패턴 추가
  • New Features

    • 조직 역할 기반 서류 평가 필터링 기능 추가: 사용자의 조직 역할에 따라 관련된 평가 기준과 평가 데이터를 선별적으로 제공하도록 개선

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 26, 2026

Walkthrough

.gitignore 파일에 /docs/ 패턴을 추가하여 문서 디렉토리를 Git에서 제외하고, ApplicationResponseDTO의 SummaryForUser 클래스에 조직 역할 기반 필터링 로직을 도입하여 평가 기준과 사용자 문서 평가를 조직 역할 일치 여부에 따라 필터링합니다.

Changes

Cohort / File(s) 변경 내용
Git 설정
.gitignore
/docs/ 디렉토리 무시 패턴 추가
평가 필터링 로직
src/main/java/KUSITMS/WITHUS/domain/application/application/dto/ApplicationResponseDTO.java
SummaryForUser.from 메서드에 OrganizationRole 기반 필터링 추가; 새로운 private static 헬퍼 메서드 matchesOrganizationRole 구현으로 평가 기준과 사용자 문서 평가를 조직 역할로 필터링

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 문서 폴더는 숨겨두고, 역할로 걸러낸 평가들!
조직과 맞춰 춤을 추네,
정렬과 필터의 아름다운 무도 ✨
작고 섬세한 변화가
코드를 더 우아하게 만든답!

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
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.
Description check ❓ Inconclusive PR 설명이 템플릿 구조를 따르고 있지만, 관련 이슈 번호와 구체적인 작업 내용이 누락되어 있어 불완전합니다. Related Issue에 이슈 번호를 추가하고, Task Details의 일반적인 '작업 1, 2' 대신 구체적인 변경 내용을 명시해주세요.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed 제목이 변경사항의 주요 내용과 직접적으로 관련되어 있으며, 조직 역할 기반 평가기준 필터링 로직 수정을 명확히 요약합니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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 and usage tips.

@SeongHo5356 SeongHo5356 merged commit 0784b61 into develop Jan 26, 2026
2 of 3 checks passed
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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/

Comment on lines +293 to 307
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();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 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"
done

Repository: 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/java

Repository: WITHUS-K/WITHUS-BE

Length of output: 44


🏁 Script executed:

#!/bin/bash
# Check matchesOrganizationRole method implementation
rg -n 'matchesOrganizationRole' -A 10 src/main/java

Repository: 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant