Skip to content

[FIX] 도서 상세 조회 시 미등록 상태를 UNREGISTERED로 반환#288

Merged
kjhyeon0620 merged 2 commits into
develop-demofrom
fix/#287-book-detail-unregistered-reading-status
Jun 9, 2026
Merged

[FIX] 도서 상세 조회 시 미등록 상태를 UNREGISTERED로 반환#288
kjhyeon0620 merged 2 commits into
develop-demofrom
fix/#287-book-detail-unregistered-reading-status

Conversation

@kjhyeon0620

@kjhyeon0620 kjhyeon0620 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

📄 작업 내용 요약

  • 도서 상세 조회 응답의 readingStatus 타입을 ReadingStatusResponse로 변경
  • 서재에 등록되지 않은 도서 상세 조회 시 readingStatusUNREGISTERED로 반환하도록 수정

📎 Issue 번호


✅ 작업 목록

  • 기능 구현
  • 코드 리뷰 반영
  • 테스트 코드 작성
  • 문서 업데이트

📝 기타 참고사항

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@kjhyeon0620, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 51 minutes and 9 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1d114f70-2ba4-44b8-b3fc-72aed5b1b817

📥 Commits

Reviewing files that changed from the base of the PR and between ab38391 and 560e12c.

📒 Files selected for processing (1)
  • src/test/java/app/nook/controller/book/BookControllerTest.java

Walkthrough

이 PR은 도서 상세 조회 시 서재에 미등록된 도서의 readingStatus 응답을 null에서 UNREGISTERED로 변경합니다. DTO 필드 타입을 ReadingStatus에서 ReadingStatusResponse로 변경하고, 변환 로직 및 관련 테스트를 업데이트합니다.

Changes

미등록 도서 readingStatus 응답값 표준화

Layer / File(s) Summary
응답 DTO 타입 정의
src/main/java/app/nook/book/dto/BookResponseDto.java
BookDetailDtoreadingStatus 필드 타입을 ReadingStatus에서 ReadingStatusResponse로 변경하고 import를 추가합니다.
도서 변환 로직 구현
src/main/java/app/nook/book/converter/BookConverter.java
BookConverter에서 bookDetailDtoreadingStatus 매핑을 수정하여 library가 없으면 UNREGISTERED를, 있으면 ReadingStatusResponse.from()으로 변환한 값을 설정합니다.
서비스 계층 테스트 검증
src/test/java/app/nook/book/service/BookServiceTest.java
BookServiceTest에서 다양한 도서 조회 시나리오의 readingStatus 기대값을 null에서 UNREGISTERED로 변경하고, import를 추가합니다.
컨트롤러 계층 테스트 검증
src/test/java/app/nook/controller/book/BookControllerTest.java
BookControllerTest에서 ISBN 조회, bookId 조회, 도서 등록/수정 테스트의 readingStatus 상수를 ReadingStatusResponse로 변경하고 응답 검증을 업데이트합니다.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • UMC-NOOK/Server#267: BookConverter와 BookResponseDto의 readingStatus 필드 변경이 이전 PR의 도서 상세 응답 추가 및 Library 기반 상태 매핑 로직과 직접 연결되어 있습니다.

Poem

🐰 서재에 없으면 UNREGISTERED, 있으면 상태 그대로
DTO 타입을 명확히 하고, null은 안녕
테스트들도 함께 춤을 춥니다 ✨
응답의 일관성이 피어난다!

🚥 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 제목이 주요 변경 사항(미등록 도서의 readingStatus를 UNREGISTERED로 반환)을 명확하고 간결하게 설명합니다.
Linked Issues check ✅ Passed PR의 모든 코드 변경이 Issue #287의 요구사항을 충족합니다: readingStatus 필드 타입을 ReadingStatusResponse로 변경하고, 미등록 도서 시 UNREGISTERED를 반환하도록 구현했습니다.
Out of Scope Changes check ✅ Passed 모든 변경 사항이 Issue #287의 범위 내 변경입니다: 도서 상세 조회 API의 readingStatus 처리 및 관련 테스트/문서 업데이트만 포함되어 있습니다.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ 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 fix/#287-book-detail-unregistered-reading-status

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.

@JiwonLee42

Copy link
Copy Markdown
Contributor
Overall Project 67.8% 🍏
Files changed 100% 🍏

File Coverage
BookConverter.java 71.43% 🍏

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

🧹 Nitpick comments (1)
src/test/java/app/nook/controller/book/BookControllerTest.java (1)

118-118: ⚡ Quick win

상세조회 응답의 readingStatus 문서 스키마를 required로 고정해 주세요.

상세조회 계약을 UNREGISTERED 포함 고정값으로 표준화했으니, REST Docs에서도 .optional()을 제거해 계약 회귀를 더 강하게 잡는 편이 좋습니다.

제안 diff
-                                  fieldWithPath("result.readingStatus").description("독서 상태 (서재에 없으면 UNREGISTERED)").optional()
+                                  fieldWithPath("result.readingStatus").description("독서 상태 (서재에 없으면 UNREGISTERED)")
-                                  fieldWithPath("result.readingStatus").description("독서 상태").optional()
+                                  fieldWithPath("result.readingStatus").description("독서 상태")

Also applies to: 195-195

🤖 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/app/nook/controller/book/BookControllerTest.java` at line 118,
Remove the .optional() qualifier from the REST Docs field descriptor for
readingStatus so the detailed view schema is required; locate the
fieldWithPath("result.readingStatus") usages in BookControllerTest (both
occurrences around the detailed-view test) and delete the .optional() call so
the descriptor is a required fieldWithPath(...).description(...).
🤖 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/test/java/app/nook/controller/book/BookControllerTest.java`:
- Line 118: Remove the .optional() qualifier from the REST Docs field descriptor
for readingStatus so the detailed view schema is required; locate the
fieldWithPath("result.readingStatus") usages in BookControllerTest (both
occurrences around the detailed-view test) and delete the .optional() call so
the descriptor is a required fieldWithPath(...).description(...).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: abbde2c0-7127-4c66-b0f7-050a92056dd2

📥 Commits

Reviewing files that changed from the base of the PR and between 505015b and ab38391.

📒 Files selected for processing (4)
  • src/main/java/app/nook/book/converter/BookConverter.java
  • src/main/java/app/nook/book/dto/BookResponseDto.java
  • src/test/java/app/nook/book/service/BookServiceTest.java
  • src/test/java/app/nook/controller/book/BookControllerTest.java

@JiwonLee42

Copy link
Copy Markdown
Contributor
Overall Project 67.8% 🍏
Files changed 100% 🍏

File Coverage
BookConverter.java 71.43% 🍏

@kjhyeon0620 kjhyeon0620 merged commit b77c466 into develop-demo Jun 9, 2026
5 checks passed
@kjhyeon0620 kjhyeon0620 deleted the fix/#287-book-detail-unregistered-reading-status branch June 9, 2026 09:22
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.

[BUG] 도서 상세 조회 시 미등록 도서의 readingStatus가 null로 반환됨

2 participants