Skip to content

✨ OMF-336 설문 기본정보 조회 시 섹션 개수 반환하도록 수정#156

Merged
wonjuneee merged 3 commits into
developfrom
feat/OMF-336
May 10, 2026
Merged

✨ OMF-336 설문 기본정보 조회 시 섹션 개수 반환하도록 수정#156
wonjuneee merged 3 commits into
developfrom
feat/OMF-336

Conversation

@wonjuneee

@wonjuneee wonjuneee commented May 10, 2026

Copy link
Copy Markdown
Collaborator

✨ Related Issue


📌 Task Details

  • 설문 정보 조회 시, 설문의 섹션 개수를 추가로 반환하도록 수정
  • 미사용 API 및 메서드 제거

💬 Review Requirements (Optional)

Summary by CodeRabbit

릴리스 노트

  • Refactor
    • 설문 참여 관련 레거시 API 엔드포인트 제거
    • 설문 참여 정보 데이터 구조 및 조회 방식 개선

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: ASSERTIVE

Plan: Pro

Run ID: ed303f77-94c0-45cf-accd-03f112d2af4e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

이 PR은 설문 참여 정보 조회 흐름을 통합 VO 패턴으로 재설계합니다. 새로운 ParticipationInfoVO 레코드는 설문 메타데이터와 참여 상태를 단일 데이터 전송 객체로 결합하며, 저장소와 서비스 계층은 이제 분리된 SurveyParticipationStatus 조회 대신 이 VO를 사용합니다. 사용되지 않는 레거시 API 엔드포인트와 DeprecatedQuestionResponse 타입이 제거됩니다.

Changes

Participation Metadata VO Consolidation

Layer / File(s) Summary
Data Contract
src/main/java/OneQ/OnSurvey/domain/survey/model/dto/ParticipationInfoVO.java
ParticipationInfoVO 레코드가 추가되어 설문 ID, 제목, 설명, 섹션 수, 마감일, 관심사, 참여 상태, 유료/무료 플래그를 포함하는 참여 메타데이터를 정의합니다. 스크리닝 ID와 부울 플래그로부터 ParticipationStatus를 계산하는 보조 생성자가 추가됩니다.
Response Models
src/main/java/OneQ/OnSurvey/domain/survey/model/response/ParticipationInfoResponse.java, src/main/java/OneQ/OnSurvey/domain/survey/model/response/DeprecatedQuestionResponse.java
ParticipationInfoResponsetotalSections 필드를 추가하고 팩토리 메서드가 Survey 대신 ParticipationInfoVO를 입력으로 받도록 변경됩니다. DeprecatedQuestionResponse 전체 클래스 및 팩토리 메서드가 제거됩니다.
Repository Interface
src/main/java/OneQ/OnSurvey/domain/survey/repository/SurveyRepository.java
getParticipationStatus(...) 메서드가 getParticipationInfoVO(...) 메서드로 교체되어 집계된 참여 메타데이터를 반환합니다.
Repository Implementation
src/main/java/OneQ/OnSurvey/domain/survey/repository/SurveyRepositoryImpl.java
getParticipationInfoVO(Long surveyId, Long memberId) 메서드가 구현되어 설문, 섹션, 관심사, 스크리닝, 응답 테이블을 조인하고 그룹화하여 생성자 프로젝션으로 ParticipationInfoVO를 반환합니다. 기존 getParticipationStatus 메서드가 제거됩니다.
Service Interface
src/main/java/OneQ/OnSurvey/domain/survey/service/query/SurveyQuery.java
권장 설문 및 마감일 기반 필터링을 위한 두 getParticipationSurveyList(...) 오버로드 메서드 선언이 제거됩니다.
Service Implementation
src/main/java/OneQ/OnSurvey/domain/survey/service/query/SurveyQueryService.java
getParticipationSurveyList(...) 구현이 제거됩니다. getParticipationInfo(...) 메서드가 저장소로부터 ParticipationInfoVO를 조회하고 새로운 팩토리 메서드를 통해 응답을 구성하도록 리팩터링됩니다.
Controller Cleanup
src/main/java/OneQ/OnSurvey/domain/survey/controller/ParticipationController.java
진행 중/권장/임박한 설문 목록 조회 엔드포인트와 전체 설문 정보 엔드포인트(GET /surveys)가 제거됩니다. 대응하는 주입된 의존성(QuestionQueryService, SurveyRepository)과 사용되지 않는 임포트가 제거됩니다.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • On-Survey/Backend#108: 참여/진행 중 설문 목록 조회 흐름을 수정하며, ParticipationController 엔드포인트와 저장소/서비스 참여 목록 API를 변경합니다.
  • On-Survey/Backend#95: #95는 ParticipationStatus 타입을 추가하고, 이 PR은 그 흐름을 ParticipationInfoVO로 교체하며 ParticipationStatus 기반 메서드를 제거합니다.
  • On-Survey/Backend#109: 저장소 쿼리 로직(SurveyRepositoryImpl)을 수정하여 스크리닝/응답 주변 조인과 술어를 변경합니다.

Suggested labels

🌟feature

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

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.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목은 주요 변경사항인 설문 기본정보 조회 시 섹션 개수 반환 기능을 명확하게 설명하고 있습니다.
Description check ✅ Passed PR 설명은 템플릿의 모든 필수 섹션을 포함하며, 관련 이슈, 작업 세부사항, 체크리스트가 완성되어 있습니다.
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.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/OMF-336

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.

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main/java/OneQ/OnSurvey/domain/survey/service/query/SurveyQueryService.java (1)

18-27: 🧹 Nitpick | 🔵 Trivial | 💤 Low value

중복된 임포트 정리 권고.

26번 줄에서 OneQ.OnSurvey.domain.survey.model.dto.* 와일드카드 임포트가 추가되어, 18~25번 줄의 동일 패키지 단일 클래스 임포트들이 모두 중복됩니다. IDE의 자동 임포트 정리(Optimize Imports)로 한쪽만 남기시는 것을 권장합니다.

♻️ 제안 정리
-import OneQ.OnSurvey.domain.survey.model.dto.OngoingSurveyStats;
-import OneQ.OnSurvey.domain.survey.model.dto.ScreeningIntroData;
-import OneQ.OnSurvey.domain.survey.model.dto.ScreeningViewData;
-import OneQ.OnSurvey.domain.survey.model.dto.SurveyDetailData;
-import OneQ.OnSurvey.domain.survey.model.dto.SurveyListView;
-import OneQ.OnSurvey.domain.survey.model.dto.SurveySearchQuery;
-import OneQ.OnSurvey.domain.survey.model.dto.SurveySegmentation;
-import OneQ.OnSurvey.domain.survey.model.dto.SurveyWithEligibility;
 import OneQ.OnSurvey.domain.survey.model.dto.*;

(또는 반대로 와일드카드를 제거하고 ParticipationInfoVO만 단일 임포트로 추가)

🤖 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/OneQ/OnSurvey/domain/survey/service/query/SurveyQueryService.java`
around lines 18 - 27, There are duplicate imports: both explicit imports (e.g.,
OngoingSurveyStats, ScreeningIntroData, ScreeningViewData, SurveyDetailData,
SurveyListView, SurveySearchQuery, SurveySegmentation, SurveyWithEligibility)
and a wildcard import OneQ.OnSurvey.domain.survey.model.dto.*; remove the
redundancy by either deleting the explicit single-class imports and keeping the
wildcard or (preferably) removing the wildcard and keeping explicit imports (or
adding only the missing ParticipationInfoVO explicitly), then run your IDE's
"Optimize Imports" to apply the cleanup consistently.
🤖 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.

Inline comments:
In
`@src/main/java/OneQ/OnSurvey/domain/survey/repository/SurveyRepositoryImpl.java`:
- Around line 297-328: The current inner join on section in SurveyRepositoryImpl
(the .join(section).on(survey.id.eq(section.surveyId))) causes ONGOING surveys
with zero sections to be filtered out; change that to a left join
(.leftJoin(section).on(...)) and replace the section count expression passed to
ParticipationInfoVO (currently section.sectionId.countDistinct().intValue())
with a coalesced expression so zero is returned when no sections exist (e.g.
coalesce(section.sectionId.countDistinct(), 0).intValue()); alternatively, if
zero-section ONGOING surveys are invalid, add a clear comment near the join to
document that intent.

In
`@src/main/java/OneQ/OnSurvey/domain/survey/service/query/SurveyQueryService.java`:
- Around line 181-187: 로그 메시지가 실제 원인 범위를 좁게 표현하고 있으니 SurveyQueryService의
surveyRepository.getParticipationInfoVO 반환값(vo) == null 분기에서 사용하는 로그를 더 일반화하세요;
현재 "[SURVEY:QUERY] 마감된 설문 참여 불가 - surveyId: {}" 대신 "조회 불가/존재하지 않는 설문 또는 관련 데이터
누락 - surveyId: {}"와 같이 섹션 누락, 엔티티 미존재, 상태 불일치 등 다양한 원인을 포괄하도록 수정해 주세요.

---

Outside diff comments:
In
`@src/main/java/OneQ/OnSurvey/domain/survey/service/query/SurveyQueryService.java`:
- Around line 18-27: There are duplicate imports: both explicit imports (e.g.,
OngoingSurveyStats, ScreeningIntroData, ScreeningViewData, SurveyDetailData,
SurveyListView, SurveySearchQuery, SurveySegmentation, SurveyWithEligibility)
and a wildcard import OneQ.OnSurvey.domain.survey.model.dto.*; remove the
redundancy by either deleting the explicit single-class imports and keeping the
wildcard or (preferably) removing the wildcard and keeping explicit imports (or
adding only the missing ParticipationInfoVO explicitly), then run your IDE's
"Optimize Imports" to apply the cleanup consistently.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8637e4fe-da7e-4bee-88c6-8ee58807bda3

📥 Commits

Reviewing files that changed from the base of the PR and between 1ce6463 and 6fd3212.

📒 Files selected for processing (8)
  • src/main/java/OneQ/OnSurvey/domain/survey/controller/ParticipationController.java
  • src/main/java/OneQ/OnSurvey/domain/survey/model/dto/ParticipationInfoVO.java
  • src/main/java/OneQ/OnSurvey/domain/survey/model/response/DeprecatedQuestionResponse.java
  • src/main/java/OneQ/OnSurvey/domain/survey/model/response/ParticipationInfoResponse.java
  • src/main/java/OneQ/OnSurvey/domain/survey/repository/SurveyRepository.java
  • src/main/java/OneQ/OnSurvey/domain/survey/repository/SurveyRepositoryImpl.java
  • src/main/java/OneQ/OnSurvey/domain/survey/service/query/SurveyQuery.java
  • src/main/java/OneQ/OnSurvey/domain/survey/service/query/SurveyQueryService.java
💤 Files with no reviewable changes (3)
  • src/main/java/OneQ/OnSurvey/domain/survey/service/query/SurveyQuery.java
  • src/main/java/OneQ/OnSurvey/domain/survey/model/response/DeprecatedQuestionResponse.java
  • src/main/java/OneQ/OnSurvey/domain/survey/controller/ParticipationController.java

@wonjuneee wonjuneee requested a review from KJaeKwan May 10, 2026 06:45
@wonjuneee wonjuneee self-assigned this May 10, 2026
@wonjuneee wonjuneee added the 🌟feature 새로운 기능 label May 10, 2026
@wonjuneee wonjuneee merged commit fc84efc into develop May 10, 2026
2 checks passed
@wonjuneee wonjuneee deleted the feat/OMF-336 branch May 10, 2026 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🌟feature 새로운 기능

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant