Skip to content

Conversation

@rlajm1203
Copy link
Contributor

@rlajm1203 rlajm1203 commented Sep 21, 2025

📌 관련 이슈

✒️ 작업 내용

  • Calendar Response 의 id 키를 calendarId 로 변경합니다.
  • DeniedCalendarTypeException 의 예외 메세지를, 한글 부서 이름이 출력되도록 변경하였습니다.

스크린샷 🏞️ (선택)

💬 REVIEWER에게 요구사항 💬

Summary by CodeRabbit

  • Refactor
    • 캘린더 API 응답의 식별자 필드명이 id → calendarId로 변경되었습니다. 기타 필드와 구조는 동일합니다. 클라이언트는 해당 필드 참조를 calendarId로 업데이트해야 하며, 구버전 클라이언트는 배포 전 점검을 권장합니다.
  • Bug Fixes
    • 캘린더 관련 예외 메시지가 부서를 한국어명으로 표시하도록 변경되어 오류 메시지가 더 명확해졌습니다.

@rlajm1203 rlajm1203 self-assigned this Sep 21, 2025
@coderabbitai
Copy link

coderabbitai bot commented Sep 21, 2025

Walkthrough

DTO 레코드 컴포넌트명 변경과 예외 메시지 포맷 수정이 이루어졌습니다: CalendarResponse의 첫 필드명이 id에서 calendarId로 변경되었고, DeniedCalendarTypeException의 메시지 출력은 department.name() 대신 department.getKoName()을 사용하도록 바뀌었습니다.

Changes

Cohort / File(s) Summary
DTO 필드명 변경
eeos/src/main/java/com/blackcompany/eeos/calendar/application/dto/CalendarResponse.java
레코드 선언의 첫 번째 컴포넌트 이름을 idcalendarId로 변경. 팩토리 메서드(toResponse)는 여전히 model.getId()를 동일 위치에 전달하여 런타임 매핑은 유지.
예외 메시지 포맷 수정
eeos/src/main/java/com/blackcompany/eeos/calendar/application/exception/DeniedCalendarTypeException.java
예외 메시지 생성 시 부서명 출력에 department.name() 대신 department.getKoName()을 사용하도록 변경 (메서드 시그니처/제어흐름 변경 없음).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

🔧refactor

Suggested reviewers

  • kssumin
  • Daae-Kim

Poem

작은 발로 톡톡, 이름을 살짝 바꿨네
id는 손을 흔들고, calendarId가 고개를 숙여요
예외도 한국말로 더 다정하게 말하네
깡충깡충 확인하고, 커밋 위로 뛰어올라 🐰
오늘도 깃밭엔 조용히 변화가 자라요

Pre-merge checks and finishing touches

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed PR 제목 "[REFACTOR] Calendar Response ID 키 변경"은 CalendarResponse에서 id를 calendarId로 변경한 주요 변경을 명확하고 간결하게 요약하고 있어 변경사항과 완전히 일치합니다. 불필요한 단어나 모호한 표현 없이 핵심을 잘 전달하므로 리뷰어가 의도를 빠르게 파악할 수 있습니다.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/BM/#282/calendar

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0419a6d and 7de7dc5.

📒 Files selected for processing (1)
  • eeos/src/main/java/com/blackcompany/eeos/calendar/application/exception/DeniedCalendarTypeException.java (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: test
🔇 Additional comments (1)
eeos/src/main/java/com/blackcompany/eeos/calendar/application/exception/DeniedCalendarTypeException.java (1)

19-19: 문구 오탈자(칼렌더→캘린더) 수정 및 NPE 방지 권고

  • 확인: eeos/src/main/java/com/blackcompany/eeos/calendar/application/exception/DeniedCalendarTypeException.java의 getMessage()에 "칼렌더" 표기(레포 다른 파일들은 "캘린더" 사용). 문구를 일관되게 "캘린더"로 수정하세요.
  • NPE 위험: 생성자에서 department null 검증 없이 this.department = department; → getMessage()에서 department.getKoName() 호출 시 NPE 발생 가능. 생성자에 Objects.requireNonNull(department, "department") 또는 null-safe 처리 추가 권장.
  • HTTP 상태: 현재 super(..., HttpStatus.BAD_REQUEST) 사용. 권한 차단(허용되지 않음) 의미라면 403(FORBIDDEN) 검토 — 팀 규약/API 의도에 따라 결정하세요.

적용 diff(해당 라인만):

-		return String.format("%s 부서는 해당 타입의 칼렌더를 생성할 수 없습니다.", department.getKoName());
+		return String.format("%s 부서는 해당 타입의 캘린더를 생성할 수 없습니다.", department.getKoName());

생성자 방어 로직 예시:

import java.util.Objects;

public DeniedCalendarTypeException(Department department) {
    super(FAIL_CODE, HttpStatus.BAD_REQUEST); // 필요 시 HttpStatus.FORBIDDEN으로 변경
    this.department = Objects.requireNonNull(department, "department");
}

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.

@rlajm1203 rlajm1203 added the 🔧refactor 코드 수정 label Sep 21, 2025
@github-actions
Copy link

github-actions bot commented Sep 21, 2025

Test Results

101 tests  ±0   98 ✅ ±0   5s ⏱️ ±0s
 40 suites ±0    3 💤 ±0 
 40 files   ±0    0 ❌ ±0 

Results for commit 7de7dc5. ± Comparison against base commit 77a04b7.

♻️ This comment has been updated with latest results.

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)
eeos/src/main/java/com/blackcompany/eeos/calendar/application/dto/CalendarResponse.java (1)

8-10: (옵션) 직렬화 키 고정 및 문서화 주석 추가 제안

Jackson/스웨거 사용 시 명시적으로 키를 고정하면 팀 내/외부 계약 가독성이 좋아집니다. 적용은 선택 사항입니다.

-public record CalendarResponse(
-		Long calendarId, String title, String url, String type, Long startAt, Long endAt, String writer)
+public record CalendarResponse(
+		@io.swagger.v3.oas.annotations.media.Schema(name = "calendarId", description = "캘린더 식별자")
+		@com.fasterxml.jackson.annotation.JsonProperty("calendarId")
+		Long calendarId,
+		String title, String url, String type, Long startAt, Long endAt, String writer)

추가로, 아래 import를 파일 상단에 포함해주세요:

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 77a04b7 and 0419a6d.

📒 Files selected for processing (1)
  • eeos/src/main/java/com/blackcompany/eeos/calendar/application/dto/CalendarResponse.java (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: test
🔇 Additional comments (2)
eeos/src/main/java/com/blackcompany/eeos/calendar/application/dto/CalendarResponse.java (2)

17-19: toResponse 매핑 정상

model.getId()가 변경된 첫 컴포넌트(calendarId)로 그대로 매핑되어 런타임 의미는 유지됩니다.


9-9: calendarId로 리네임 — 직렬화 키/문서/테스트 영향 범위 확인 필요

  • 변경 요약: CalendarResponse 레코드 필드명이 id → calendarId로 바뀌어 Jackson 기본 직렬화 키가 "id" → "calendarId"로 변경됩니다.
  • 코드 검증: toResponse(...)는 여전히 new CalendarResponse(model.getId(), ...)로 생성하고 있으며, 컨트롤러는 @PathVariable("calendarId")를 사용합니다. (참고: eeos/src/main/java/.../CalendarResponse.java, CalendarController.java, CalendarQueryService.java)
  • 남은 리스크: 저장된 스냅샷, OpenAPI/Swagger 산출물, 프런트(직렬화 기대값) 및 문서에서 여전히 "id" 키를 기대하는지 전역 검색이 실패해 확증 불가 — 위 항목들을 수동으로 검증해 주세요.

@rlajm1203 rlajm1203 merged commit 9a1d2c9 into develop Sep 21, 2025
2 of 3 checks passed
@rlajm1203 rlajm1203 deleted the refactor/BM/#282/calendar branch September 21, 2025 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔧refactor 코드 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants