Skip to content

Conversation

@1winhyun
Copy link
Member

@1winhyun 1winhyun commented Nov 14, 2025

Related issue 🛠

작업 내용 💻

  • 지원서 조회 시 선택항목의 id와 title이 모두 반환되도록 수정했습니다.
  • 관리자 전용 지원서 조회 시 선택항목의 id와 title이 모두 반환되도록 수정했습니다.
  • 학생회 면접/서류 심사 리스트 조회 시 앤드포인트 및 조회 기준을 councilId가 아닌 recruitmentId로 수정했습니다.

스크린샷 📷

  • 지원서 조회 시 선택항목의 id, tite이 모두 반환됩니다.
image
  • 학생회 면접/서류 심사 리스트 조회 시 recruitmentId를 기준으로 조회되도록 수정했습니다.
image image

같이 얘기해보고 싶은 내용이 있다면 작성 📢

Summary by CodeRabbit

릴리스 노트

  • 새 기능

    • 선택형 응답에 선택지 ID 대신 옵션 제목을 함께 반환하도록 응답 형식 추가(옵션 id + 제목 포함).
  • 개선 사항

    • 지원자 조회 응답에 선택지 제목 매핑을 포함해 응답 가독성 향상.
    • 서류/면접 조회 관련 API 및 내부 호출이 협의회 ID 기반에서 채용 ID 기반으로 변경되어 식별이 명확해짐.

@coderabbitai
Copy link

coderabbitai bot commented Nov 14, 2025

Walkthrough

지원서 응답 DTO에 선택지 ID와 제목을 함께 포함하도록 응답 구조를 변경하고, 지원자 조회 흐름을 Council 기반에서 Recruitment 기반으로 리팩토링했습니다. SelectItem 옵션 ID→제목 맵을 생성해 관련 팩토리 메서드로 전달합니다.

Changes

코호트 / 파일(s) 변경 요약
응답 DTO 팩토리 시그니처 변경
\src/main/java/com/unionmate/backend/domain/applicant/application/dto/response/ApplicationAnswerResponse.java``
from(Item item)from(Item item, Map<Long,String> selectOptionTitleById)로 시그니처 변경. SelectItem 처리 시 selectOptionTitleById 전달.
선택 답변 구조 변경
\src/main/java/com/unionmate/backend/domain/applicant/application/dto/response/SelectAnswerResponse.java``
팩토리 시그니처 from(SelectItem)from(SelectItem, Map<Long,String>)로 변경. 필드 List<Long> selectedOptionIdsList<SelectOptionAnswerResponse> selectOptions로 대체해 ID+제목 반환.
선택 옵션 DTO 신규
\src/main/java/com/unionmate/backend/domain/applicant/application/dto/response/SelectOptionAnswerResponse.java``
신규 record SelectOptionAnswerResponse(Long optionId, String title) 추가(응답용).
응답 빌더에서 옵션 제목 맵 생성
\src/main/java/com/unionmate/backend/domain/applicant/application/dto/response/GetApplicationAdminResponse.java`, `src/main/java/com/unionmate/backend/domain/applicant/application/dto/response/GetApplicationResponse.java``
Recruitment의 SelectItem → SelectItemOption을 순회해 Map<Long,String>(optionId→title) 빌드하는 헬퍼 추가. 각 ApplicationAnswerResponse.from 호출에 해당 맵 전달하도록 변경.
저장소 쿼리 파라미터 변경
\src/main/java/com/unionmate/backend/domain/applicant/domain/repository/ApplicationRepository.java``
8개 쿼리 메서드의 JPQL에서 @Param("council")@Param("recruitment")로 변경하고 조건을 r = :recruitment 형태로 수정.
서비스 메서드명·시그니처 리팩토링
\src/main/java/com/unionmate/backend/domain/applicant/domain/service/ApplicationGetService.java``
getDocumentScreeningApplicantsForCouncil(Council,...)getDocumentScreeningApplicantsForRecruitment(Recruitment,...), getInterviewApplicantsForCouncil(...)getInterviewApplicantsForRecruitment(...)로 이름 및 파라미터 타입 변경. 내부 호출 recruitment 전달로 수정.
유스케이스 레이어 변경
\src/main/java/com/unionmate/backend/domain/council/application/usecase/CouncilManageUsecase.java``
RecruitmentGetService 의존성 추가. 메서드 파라미터를 councilIdrecruitmentId로 변경하고 Recruitment 조회 후 council 유도 및 recruitment 기반 서비스 호출로 변경.
컨트롤러 경로/파라미터 변경
\src/main/java/com/unionmate/backend/domain/council/presentation/CouncilController.java``
엔드포인트의 @PathVariable 이름을 councilIdrecruitmentId로 변경하고 내부 usecase 인자 업데이트.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Controller as CouncilController
    participant Usecase as CouncilManageUsecase
    participant RecruitService as RecruitmentGetService
    participant AppGetService as ApplicationGetService
    participant AppRepository as ApplicationRepository
    participant ResponseBuilder as GetApplicationAdminResponse

    Client->>Controller: GET /recruitments/{recruitmentId}/applicants
    Controller->>Usecase: getDocumentScreeningApplicants(memberId, recruitmentId)
    Usecase->>RecruitService: getRecruitmentById(recruitmentId)
    RecruitService-->>Usecase: Recruitment
    Usecase->>AppGetService: getDocumentScreeningApplicantsForRecruitment(Recruitment, status)
    AppGetService->>AppRepository: findDocumentList*(recruitment)
    AppRepository-->>AppGetService: List<CouncilApplicantQueryRow>
    AppGetService-->>Usecase: List<CouncilApplicantQueryRow>
    Usecase-->>Controller: List<Application>
    Controller->>ResponseBuilder: GetApplicationAdminResponse.from(Application)
    rect rgb(230, 245, 255)
    Note over ResponseBuilder: buildSelectOptionTitleMap(Recruitment) 실행
    ResponseBuilder->>ResponseBuilder: SelectItemOption ID → title Map 생성
    ResponseBuilder->>ResponseBuilder: ApplicationAnswerResponse.from(item, selectOptionTitleById) 호출
    ResponseBuilder->>ResponseBuilder: SelectAnswerResponse.from(selectItem, selectOptionTitleById) 호출
    ResponseBuilder->>ResponseBuilder: SelectOptionAnswerResponse 리스트(ID+title) 생성
    end
    ResponseBuilder-->>Controller: 응답 (선택지 제목 포함)
    Controller-->>Client: JSON 응답
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–25 minutes

주의 필요 영역:

  • ApplicationRepository의 JPQL 변경(조건 r = :recruitment)과 파라미터 타입이 도메인 모델과 일치하는지 검증
  • ApplicationAnswerResponse.from / SelectAnswerResponse.from 시그니처 변경에 따른 전체 호출 지점 점검
  • buildSelectOptionTitleMap의 null/빈 집합 처리 및 SelectItem→SelectItemOption 순회 안전성
  • CouncilManageUsecase에서 Recruitment 조회 실패(혹은 null) 시 동작 검증

Possibly related PRs

Suggested reviewers

  • soyesenna
  • rootTiket
  • huncozyboy

Poem

🐰 선택지에 이름을 곁들여 담았네
작은 id도 이제 말할 수 있어요
모집을 따라 길을 바꿔 달리니
응답은 더 반짝, 데이터는 더 친절해요 ✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning recruitmentId를 기준으로 조회하도록 변경한 사항(ApplicationRepository, ApplicationGetService, CouncilManageUsecase, CouncilController)은 이슈 #55의 범위를 벗어난 것으로 보입니다. CouncilController 및 관련 서비스 레이어의 recruitmentId 변경 사항을 별도의 PR로 분리하여 진행하는 것을 권장합니다.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목은 주요 변경 사항(선택항목의 id, title 반환)을 명확하게 설명하고 있으나, 추가 수정 사항(recruitmentId 변경)이 포함되어 있어 다소 포괄적입니다.
Description check ✅ Passed PR 설명은 필수 섹션(Related issue, 작업 내용, 스크린샷)을 모두 포함하고 있으며, 구체적인 변경 사항과 시각적 증거를 제시하고 있습니다.
Linked Issues check ✅ Passed PR의 모든 코드 변경 사항이 연결된 이슈 #55의 요구사항(selectOptionIds의 항목명 반환)을 충족하고 있습니다.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/#55

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.

Copy link

@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: 0

🧹 Nitpick comments (2)
src/main/java/com/unionmate/backend/domain/applicant/application/dto/response/GetApplicationResponse.java (1)

55-64: 코드 중복을 고려해보세요.

이 메서드는 GetApplicationAdminResponse의 동일한 메서드와 중복됩니다. 공통 유틸리티 클래스로 추출하면 유지보수성이 향상됩니다.

예시: 공통 헬퍼 클래스 생성

public final class SelectOptionTitleMapBuilder {
    private SelectOptionTitleMapBuilder() {}
    
    public static Map<Long, String> build(Recruitment recruitment) {
        return recruitment.getItems().stream()
            .filter(item -> item instanceof SelectItem)
            .map(item -> (SelectItem)item)
            .flatMap(selectItem -> selectItem.getSelectItemOptions().stream())
            .collect(Collectors.toMap(
                SelectItemOption::getId,
                SelectItemOption::getTitle
            ));
    }
}
src/main/java/com/unionmate/backend/domain/applicant/application/dto/response/SelectAnswerResponse.java (1)

31-46: Null 안전성과 변수명 개선이 필요합니다.

로직은 올바르지만 다음 개선 사항을 고려하세요:

  1. Null 안전성: 35번 라인의 selectOptionTitleById.get(optionId)는 맵에 해당 키가 없을 경우 null을 반환할 수 있습니다. 데이터 불일치 상황(예: 저장된 답변의 옵션 ID가 현재 모집 항목에 존재하지 않는 경우)에서 문제가 발생할 수 있습니다.

  2. 변수명 개선: 34번 라인의 selectOptionTitles는 실제로 SelectOptionAnswerResponse 객체 리스트이므로 오해의 소지가 있습니다.

다음 diff를 적용하여 개선하세요:

 public static SelectAnswerResponse from(SelectItem selectItem, Map<Long, String> selectOptionTitleById) {
 	List<Long> selectOptionIds = selectItem.getAnswer() == null ? List.of() : selectItem.getAnswer().answer();
 
-	List<SelectOptionAnswerResponse> selectOptionTitles = selectOptionIds.stream()
-		.map(optionId -> new SelectOptionAnswerResponse(optionId, selectOptionTitleById.get(optionId)))
+	List<SelectOptionAnswerResponse> selectOptions = selectOptionIds.stream()
+		.map(optionId -> new SelectOptionAnswerResponse(
+			optionId, 
+			selectOptionTitleById.getOrDefault(optionId, "Unknown Option")
+		))
 		.toList();
 
 	return new SelectAnswerResponse(
 		ItemType.SELECT,
 		selectItem.getTitle(),
 		selectItem.getOrder(),
 		selectItem.getDescription(),
 		selectItem.isMultiple(),
-		selectOptionTitles
+		selectOptions
 	);
 }

참고: 학습된 컨텍스트에 따르면 지원서 제출 후 모집 항목 필드가 불변으로 유지된다고 하므로, 데이터 불일치가 발생할 가능성은 낮지만 방어적 코딩을 위해 null 처리를 추가하는 것이 좋습니다.

Based on learnings

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c249286 and 46fde95.

📒 Files selected for processing (9)
  • src/main/java/com/unionmate/backend/domain/applicant/application/dto/response/ApplicationAnswerResponse.java (2 hunks)
  • src/main/java/com/unionmate/backend/domain/applicant/application/dto/response/GetApplicationAdminResponse.java (3 hunks)
  • src/main/java/com/unionmate/backend/domain/applicant/application/dto/response/GetApplicationResponse.java (3 hunks)
  • src/main/java/com/unionmate/backend/domain/applicant/application/dto/response/SelectAnswerResponse.java (2 hunks)
  • src/main/java/com/unionmate/backend/domain/applicant/application/dto/response/SelectOptionAnswerResponse.java (1 hunks)
  • src/main/java/com/unionmate/backend/domain/applicant/domain/repository/ApplicationRepository.java (2 hunks)
  • src/main/java/com/unionmate/backend/domain/applicant/domain/service/ApplicationGetService.java (1 hunks)
  • src/main/java/com/unionmate/backend/domain/council/application/usecase/CouncilManageUsecase.java (4 hunks)
  • src/main/java/com/unionmate/backend/domain/council/presentation/CouncilController.java (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-26T13:02:17.892Z
Learnt from: 1winhyun
Repo: UnionMate/UnionMate-BE PR: 24
File: src/main/java/com/unionmate/backend/domain/applicant/application/usecase/ApplicationUseCase.java:288-293
Timestamp: 2025-10-26T13:02:17.892Z
Learning: In the UnionMate-BE application system, recruitment item fields (title and order) will be made immutable after applications are submitted. This design constraint ensures that the ExistingAnswers matching logic in ApplicationUseCase (which matches by itemType, title, and order) remains valid and prevents inconsistencies between submitted applications and recruitment templates.

Applied to files:

  • src/main/java/com/unionmate/backend/domain/applicant/application/dto/response/GetApplicationResponse.java
  • src/main/java/com/unionmate/backend/domain/applicant/application/dto/response/SelectAnswerResponse.java
🧬 Code graph analysis (4)
src/main/java/com/unionmate/backend/domain/applicant/application/dto/response/ApplicationAnswerResponse.java (3)
src/main/java/com/unionmate/backend/domain/recruitment/domain/entity/item/SelectItem.java (1)
  • Entity (27-91)
src/main/java/com/unionmate/backend/domain/recruitment/application/dto/response/SelectOptionResponse.java (2)
  • from (17-23)
  • SelectOptionResponse (7-24)
src/main/java/com/unionmate/backend/domain/applicant/application/dto/request/SelectAnswerRequest.java (1)
  • SelectAnswerRequest (8-17)
src/main/java/com/unionmate/backend/domain/applicant/application/dto/response/SelectOptionAnswerResponse.java (3)
src/main/java/com/unionmate/backend/domain/recruitment/application/dto/response/SelectOptionResponse.java (2)
  • SelectOptionResponse (7-24)
  • from (17-23)
src/main/java/com/unionmate/backend/domain/applicant/application/dto/request/SelectAnswerRequest.java (1)
  • SelectAnswerRequest (8-17)
src/main/java/com/unionmate/backend/domain/recruitment/application/dto/response/SelectResponse.java (1)
  • SelectResponse (10-53)
src/main/java/com/unionmate/backend/domain/council/presentation/CouncilController.java (1)
src/main/java/com/unionmate/backend/domain/recruitment/presentation/RecruitmentController.java (2)
  • PatchMapping (47-56)
  • RestController (31-133)
src/main/java/com/unionmate/backend/domain/applicant/application/dto/response/GetApplicationResponse.java (2)
src/main/java/com/unionmate/backend/domain/recruitment/domain/entity/item/SelectItem.java (1)
  • Entity (27-91)
src/main/java/com/unionmate/backend/domain/recruitment/domain/entity/item/SelectItemOption.java (1)
  • Entity (20-58)
🔇 Additional comments (13)
src/main/java/com/unionmate/backend/domain/applicant/application/dto/response/GetApplicationResponse.java (1)

55-64: 선택 항목 제목 맵 구축 로직이 정확합니다.

SelectItem의 모든 SelectItemOption을 순회하여 ID를 키로, 제목을 값으로 하는 맵을 올바르게 생성하고 있습니다.

src/main/java/com/unionmate/backend/domain/applicant/application/dto/response/SelectOptionAnswerResponse.java (1)

1-12: 새로운 DTO 구조가 깔끔합니다.

선택 항목의 ID와 제목을 함께 반환하는 목적에 적합한 간결한 레코드 구조입니다. Swagger 문서화도 적절합니다.

src/main/java/com/unionmate/backend/domain/applicant/application/dto/response/ApplicationAnswerResponse.java (1)

22-29: 제목 맵 전파 로직이 올바릅니다.

SelectItem에만 selectOptionTitleById 맵을 전달하고, 다른 항목 타입에는 영향을 주지 않도록 적절히 구현되었습니다.

src/main/java/com/unionmate/backend/domain/applicant/application/dto/response/GetApplicationAdminResponse.java (1)

44-50: 제목 맵 구축 및 전달 로직이 정확합니다.

관리자용 응답에서도 선택 항목 제목을 올바르게 매핑하여 답변 변환에 사용하고 있습니다.

src/main/java/com/unionmate/backend/domain/council/presentation/CouncilController.java (2)

143-153: 면접 리스트 API 엔드포인트 변경도 일관성 있게 적용되었습니다.

서류 심사와 동일한 패턴으로 recruitmentId 기반으로 변경되어 일관성이 유지됩니다.


122-132: 백엔드 엔드포인트 변경 사항은 정상 적용되었으나 프론트엔드 업데이트 확인 불가

검증 결과 백엔드 코드에서는 경로 변수가 councilId에서 recruitmentId로 정상 변경되었습니다. 기존 엔드포인트 패턴에 대한 참조가 현재 저장소에 남아있지 않으며, CouncilController.java의 해당 엔드포인트들(lines 122, 143)이 올바르게 업데이트되었음을 확인했습니다.

그러나 이 저장소는 Java 백엔드 코드만 포함하고 있어, 프론트엔드 및 외부 API 소비자의 업데이트 여부는 이 저장소 내에서 검증할 수 없습니다. 프론트엔드 코드가 별도 저장소에 있다면 그곳에서 새로운 엔드포인트 경로(/{recruitmentId}/applications/document-screening, /{recruitmentId}/applications/interview)로의 업데이트를 확인하세요.

src/main/java/com/unionmate/backend/domain/council/application/usecase/CouncilManageUsecase.java (2)

118-135: Recruitment 기반 조회 로직이 올바르게 구현되었습니다.

recruitmentId로 Recruitment를 조회한 후 Council을 파생하는 흐름이 정확합니다. 기존의 권한 검증 로직도 유지되어 안전합니다.


137-154: 면접 지원자 조회 로직도 일관되게 리팩토링되었습니다.

서류 심사 메서드와 동일한 패턴으로 Recruitment 기반 조회를 구현하여 일관성이 유지됩니다.

src/main/java/com/unionmate/backend/domain/applicant/domain/service/ApplicationGetService.java (2)

54-67: 서비스 메서드 리네이밍 및 파라미터 변경이 정확합니다.

getDocumentScreeningApplicantsForCouncil에서 getDocumentScreeningApplicantsForRecruitment로의 변경이 명확하며, 모든 레포지토리 호출이 Recruitment 파라미터를 일관되게 사용합니다.


69-82: 면접 지원자 조회 메서드도 일관되게 리팩토링되었습니다.

서류 심사 메서드와 동일한 패턴으로 Recruitment 기반으로 변경되어 전체 리팩토링의 일관성이 유지됩니다.

src/main/java/com/unionmate/backend/domain/applicant/domain/repository/ApplicationRepository.java (1)

26-135: Recruitment 기반 쿼리로의 변환이 모든 계층에서 올바르게 구현되었습니다.

전체 호출 체인을 검증했으며, 모든 단계에서 일관되게 Recruitment 파라미터를 사용합니다:

  • ApplicationRepository의 모든 쿼리 메서드 (8개)가 Recruitment 파라미터 사용 ✓
  • ApplicationGetService의 두 메서드가 Recruitment을 수신하고 전달 ✓
  • CouncilManageUsecase가 recruitmentId에서 Recruitment를 올바르게 조회하고 전달 ✓
  • 레거시 Council 기반 메서드 호출 없음 ✓

모든 호출자가 정상적으로 업데이트되었습니다.

src/main/java/com/unionmate/backend/domain/applicant/application/dto/response/SelectAnswerResponse.java (2)

4-4: LGTM!

새로운 팩토리 메서드 시그니처에 필요한 import 추가입니다.


27-28: API 응답 구조 변경이 정상 적용되었으나, 클라이언트 호환성 검증이 필요합니다.

변경 사항 검증 결과:

  • SelectAnswerResponseselectOptions 필드가 List<Long> 에서 List<SelectOptionAnswerResponse> 로 변경됨 (각 선택지의 ID와 제목 포함)
  • 영향 범위: GetApplicationResponse(사용자 API)와 GetApplicationAdminResponse(관리자 API) 두 엔드포인트 모두에 적용됨
  • 구현은 올바르고 일관성 있게 적용됨

다만 이는 API 응답 구조의 breaking change이므로, 외부 클라이언트와 연동 시스템이 새로운 응답 형식({optionId, title})을 처리할 수 있도록 준비되었는지 확인 필요합니다.

Copy link

@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: 0

🧹 Nitpick comments (1)
src/main/java/com/unionmate/backend/domain/applicant/application/dto/response/SelectAnswerResponse.java (1)

31-36: 존재하지 않는 옵션 ID에 대한 방어 로직 필요

Line 35에서 selectOptionTitleById.get(optionId)가 null을 반환할 수 있습니다. 옵션이 삭제되었거나 데이터 불일치가 있는 경우 SelectOptionAnswerResponse가 null 제목을 가지게 됩니다.

학습된 내용에 따르면 지원서 제출 후 모집 항목 필드가 불변이지만, 과거 데이터나 예외 상황을 고려한 방어 코드가 권장됩니다.

다음과 같이 누락된 키에 대한 처리를 추가하세요:

 List<SelectOptionAnswerResponse> selectOptions = selectOptionIds.stream()
-	.map(optionId -> new SelectOptionAnswerResponse(optionId, selectOptionTitleById.get(optionId)))
+	.map(optionId -> {
+		String title = selectOptionTitleById.getOrDefault(optionId, "삭제된 옵션");
+		return new SelectOptionAnswerResponse(optionId, title);
+	})
 	.toList();

또는 더 엄격한 검증이 필요한 경우:

 List<SelectOptionAnswerResponse> selectOptions = selectOptionIds.stream()
-	.map(optionId -> new SelectOptionAnswerResponse(optionId, selectOptionTitleById.get(optionId)))
+	.map(optionId -> {
+		String title = selectOptionTitleById.get(optionId);
+		if (title == null) {
+			throw new IllegalStateException("SelectOption not found for ID: " + optionId);
+		}
+		return new SelectOptionAnswerResponse(optionId, title);
+	})
 	.toList();

Based on learnings

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 46fde95 and 1826f75.

📒 Files selected for processing (3)
  • src/main/java/com/unionmate/backend/domain/applicant/application/dto/response/GetApplicationAdminResponse.java (3 hunks)
  • src/main/java/com/unionmate/backend/domain/applicant/application/dto/response/GetApplicationResponse.java (3 hunks)
  • src/main/java/com/unionmate/backend/domain/applicant/application/dto/response/SelectAnswerResponse.java (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/java/com/unionmate/backend/domain/applicant/application/dto/response/GetApplicationResponse.java
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-26T13:02:17.892Z
Learnt from: 1winhyun
Repo: UnionMate/UnionMate-BE PR: 24
File: src/main/java/com/unionmate/backend/domain/applicant/application/usecase/ApplicationUseCase.java:288-293
Timestamp: 2025-10-26T13:02:17.892Z
Learning: In the UnionMate-BE application system, recruitment item fields (title and order) will be made immutable after applications are submitted. This design constraint ensures that the ExistingAnswers matching logic in ApplicationUseCase (which matches by itemType, title, and order) remains valid and prevents inconsistencies between submitted applications and recruitment templates.

Applied to files:

  • src/main/java/com/unionmate/backend/domain/applicant/application/dto/response/SelectAnswerResponse.java
🔇 Additional comments (3)
src/main/java/com/unionmate/backend/domain/applicant/application/dto/response/GetApplicationAdminResponse.java (2)

45-49: Map 생성 및 사용 로직 확인 완료

buildSelectOptionMap을 통해 선택지 옵션 ID→제목 매핑을 생성하고, 각 답변 항목에 전달하는 로직이 올바르게 구현되었습니다.


129-138: 리뷰 코멘트가 정확하지 않습니다.

검증 결과, SelectItemOptionBaseEntity를 상속하며, ID는 @GeneratedValue(strategy = GenerationType.IDENTITY)로 정의되어 있습니다. 이는 데이터베이스 시퀀스에서 각 레코드에 전역적으로 고유한 ID를 자동 생성한다는 의미입니다.

따라서:

  • 서로 다른 SelectItem에 속한 SelectItemOption들이 중복된 ID를 가질 수 없습니다.
  • Collectors.toMap에서 중복 키가 발생하여 IllegalStateException이 던져질 가능성은 없습니다.
  • 현재 코드는 안전합니다.

Likely an incorrect or invalid review comment.

src/main/java/com/unionmate/backend/domain/applicant/application/dto/response/SelectAnswerResponse.java (1)

27-28: API 응답 구조 변경 확인

선택지 필드가 List<Long> selectedOptionIds에서 List<SelectOptionAnswerResponse> selectOptions로 변경되어 ID와 제목을 함께 반환하도록 개선되었습니다. PR 목표와 일치합니다.

Copy link
Contributor

@rootTiket rootTiket left a comment

Choose a reason for hiding this comment

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

고생하셨습니다 👍

@1winhyun 1winhyun merged commit c76e04b into dev Nov 14, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REFACTOR] #55 지원서 조회 시 selectOptionIds에 해당하는 항목명도 반환되도록 수정

3 participants