[Feat] 선택 문항 응답에 직접 추가 여부 추가#83
Conversation
- QuestionResponse에 custom 필드 추가 - 선택 문항 조회 응답에서 기본 문항과 직접 추가 문항을 구분하도록 수정 - 선택 문항 저장 및 답변 저장 응답에도 custom 값이 포함되도록 반영 - 선택 문항 조회 시 custom 값 반환 테스트 추가
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughAdds a ChangesQuestion Response Custom Flag Enhancement
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/main/java/com/jobdri/jobdri_api/domain/analysis/dto/response/QuestionResponse.java (1)
12-14: ⚡ Quick winMake
customexplicit at the factory boundary.The single-arg factory silently hardcodes
custom=false, which can mislabel responses if reused later. Prefer removing this overload (or renaming it to an explicit default-only variant) so callers must provide intent.🤖 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/jobdri/jobdri_api/domain/analysis/dto/response/QuestionResponse.java` around lines 12 - 14, The one-arg factory method QuestionResponse.from(Question) silently hardcodes custom=false; remove this overload so callers must call QuestionResponse.from(Question, boolean) with an explicit custom value (or alternatively rename the single-arg variant to something like fromDefaultForTests to signal the hardcoded intent). Update all call sites that used QuestionResponse.from(Question) to pass an explicit boolean to QuestionResponse.from(Question, boolean) (or to the new explicit-name method) and delete the original one-arg from(Question) to eliminate the implicit default.src/test/java/com/jobdri/jobdri_api/domain/analysis/service/QuestionServiceTest.java (1)
129-131: ⚡ Quick winAssert
content-to-custompairs instead of index-only flags.These checks are order-coupled and don’t validate which question each flag belongs to. Asserting tuples (
content,custom) will make regressions much clearer.Suggested test assertion update
- assertThat(response.questions()).hasSize(2); - assertThat(response.questions().get(0).custom()).isFalse(); - assertThat(response.questions().get(1).custom()).isTrue(); + assertThat(response.questions()) + .extracting(q -> org.assertj.core.api.Assertions.tuple(q.content(), q.custom())) + .containsExactly( + org.assertj.core.api.Assertions.tuple("지원 동기와 입사 후 목표를 작성해주세요.", false), + org.assertj.core.api.Assertions.tuple("직접 추가한 문항입니다.", true) + );🤖 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/test/java/com/jobdri/jobdri_api/domain/analysis/service/QuestionServiceTest.java` around lines 129 - 131, In QuestionServiceTest, replace the index-coupled assertions on response.questions() with tuple-based assertions that pair each question's content and custom flag; e.g. use AssertJ's extracting("content","custom") or map each question to a (content, custom) pair and assert containsExactlyInAnyOrder(...) so the test verifies which content has which custom value instead of relying on list order (locate where response.questions() is asserted and update those assertions).
🤖 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/jobdri/jobdri_api/domain/analysis/dto/response/QuestionResponse.java`:
- Around line 12-14: The one-arg factory method QuestionResponse.from(Question)
silently hardcodes custom=false; remove this overload so callers must call
QuestionResponse.from(Question, boolean) with an explicit custom value (or
alternatively rename the single-arg variant to something like
fromDefaultForTests to signal the hardcoded intent). Update all call sites that
used QuestionResponse.from(Question) to pass an explicit boolean to
QuestionResponse.from(Question, boolean) (or to the new explicit-name method)
and delete the original one-arg from(Question) to eliminate the implicit
default.
In
`@src/test/java/com/jobdri/jobdri_api/domain/analysis/service/QuestionServiceTest.java`:
- Around line 129-131: In QuestionServiceTest, replace the index-coupled
assertions on response.questions() with tuple-based assertions that pair each
question's content and custom flag; e.g. use AssertJ's
extracting("content","custom") or map each question to a (content, custom) pair
and assert containsExactlyInAnyOrder(...) so the test verifies which content has
which custom value instead of relying on list order (locate where
response.questions() is asserted and update those assertions).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 363894e8-8966-4c21-afd9-0e91fb5ac8f0
📒 Files selected for processing (3)
src/main/java/com/jobdri/jobdri_api/domain/analysis/dto/response/QuestionResponse.javasrc/main/java/com/jobdri/jobdri_api/domain/analysis/service/QuestionService.javasrc/test/java/com/jobdri/jobdri_api/domain/analysis/service/QuestionServiceTest.java
- QuestionResponse의 단일 인자 from 메서드 제거 - QuestionResponse 생성 시 custom 값을 명시적으로 전달하도록 정리 - 선택 문항 조회 테스트를 문항 내용과 custom 값 쌍으로 검증하도록 수정 - 리스트 순서에 의존하지 않도록 테스트 assertion 개선
✨ 어떤 이유로 PR를 하셨나요?
📋 세부 내용 - 왜 해당 PR이 필요한지 작업 내용을 자세하게 설명해주세요
📸 작업 화면 스크린샷
🚨 관련 이슈 번호 [#39 ]
Summary by CodeRabbit
New Features
customflag so clients can tell user-added questions from defaults.customflag.Tests
customflag for questions.