Skip to content

Conversation

@move-hoon
Copy link
Member

@move-hoon move-hoon commented Aug 7, 2025

🔗 관련 이슈

📘 작업 유형

  • ✨ Feature (기능 추가)
  • 🐞 Bugfix (버그 수정)
  • 🔧 Refactor (코드 리팩토링)
  • ⚙️ Chore (환경 설정)
  • 📝 Docs (문서 작성 및 수정)
  • ✅ Test (기능 테스트)
  • 🎨 style (코드 스타일 수정)

📙 작업 내역

  • 모든 ISBN 사용 로직을 ISBN13을 사용하도록 변경했습니다.

🧪 테스트 내역

  • 브라우저/기기에서 동작 확인
  • 엣지 케이스 테스트 완료
  • 기존 기능 영향 없음

🎨 스크린샷 또는 시연 영상 (선택)

기능 미리보기 기능 미리보기
기능 설명 기능 설명

✅ PR 체크리스트

  • 커밋 메시지가 명확합니다
  • PR 제목이 컨벤션에 맞습니다
  • 관련 이슈 번호를 작성했습니다
  • 기능이 정상적으로 작동합니다
  • 불필요한 코드를 제거했습니다

💬 추가 설명 or 리뷰 포인트 (선택)

Summary by CodeRabbit

  • Refactor

    • 모든 API, 도메인, 인프라 계층에서 도서 식별자를 기존 ISBN에서 ISBN13으로 명확하게 통일하였습니다.
    • 관련 필드, 메서드, DTO, 엔티티, 레포지토리, 서비스의 이름 및 검증 로직이 ISBN13 기준으로 변경되었습니다.
    • ISBN13 입력값에 대해 13자리 형식의 유효성 검사가 강화되었습니다.
  • Bug Fixes

    • 404 오류 응답 설명이 "ISBN 오류"에서 "ISBN13 오류"로 명확하게 수정되었습니다.

@move-hoon move-hoon requested a review from minwoo1999 August 7, 2025 10:06
@move-hoon move-hoon self-assigned this Aug 7, 2025
@coderabbitai
Copy link

coderabbitai bot commented Aug 7, 2025

Warning

Rate limit exceeded

@hoonyworld has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 4 minutes and 27 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 3bb5b25 and 272d036.

📒 Files selected for processing (5)
  • apis/src/main/kotlin/org/yapp/apis/book/dto/request/UserBooksByIsbn13sRequest.kt (2 hunks)
  • apis/src/main/kotlin/org/yapp/apis/book/service/AladinBookQueryService.kt (3 hunks)
  • domain/src/main/kotlin/org/yapp/domain/book/Book.kt (6 hunks)
  • domain/src/main/kotlin/org/yapp/domain/userbook/UserBook.kt (6 hunks)
  • global-utils/src/main/kotlin/org/yapp/globalutils/validator/IsbnValidator.kt (1 hunks)

Walkthrough

전체적으로 코드베이스의 모든 ISBN 관련 필드, 변수, 메서드, 클래스, 인터페이스, DTO, 엔티티, 레포지토리, 서비스, 유스케이스 등에서 기존의 isbn 혹은 bookIsbn 명칭을 isbn13 혹은 bookIsbn13으로 일괄 변경하였으며, 검증 로직 및 어노테이션, 스키마 설명, 예제 등도 모두 ISBN13 기준으로 수정되었습니다. 로직 변경 없이 명칭 및 인터페이스 일관성 확보가 목적입니다.

Changes

Cohort / File(s) Change Summary
컨트롤러 및 API 응답
apis/.../controller/BookControllerApi.kt
404 응답 메시지의 "ISBN 오류"를 "ISBN13 오류"로 수정
요청 DTO 및 검증
apis/.../dto/request/BookCreateRequest.kt,
apis/.../dto/request/BookDetailRequest.kt,
apis/.../dto/request/UpsertUserBookRequest.kt,
apis/.../dto/request/UserBookRegisterRequest.kt,
apis/.../dto/request/UserBooksByIsbn13sRequest.kt
모든 ISBN 관련 필드, 메서드, 파라미터, 스키마, 검증 어노테이션을 isbn → isbn13으로 변경 및 정규식 패턴 검증 추가
응답 DTO
apis/.../dto/response/BookCreateResponse.kt,
apis/.../dto/response/UserBookResponse.kt
응답 DTO 내 isbn → isbn13 필드명 및 파라미터 일괄 변경
서비스 계층
apis/.../service/AladinBookQueryService.kt,
apis/.../service/BookManagementService.kt,
apis/.../service/BookQueryService.kt,
apis/.../service/UserBookService.kt
내부 메서드, 파라미터, 호출부에서 isbn → isbn13 변경 및 관련 메서드명, DTO import 변경
유스케이스
apis/.../usecase/BookUseCase.kt
isbn → isbn13 관련 DTO, 메서드, 변수명, import 일괄 변경
도메인: Book
domain/.../book/Book.kt,
domain/.../book/BookDomainService.kt,
domain/.../book/BookRepository.kt,
domain/.../book/vo/BookInfoVO.kt
Book, Isbn → Book, Isbn13으로 타입, 필드, 메서드, 레포지토리 메서드, VO 등 일괄 변경
도메인: UserBook
domain/.../userbook/UserBook.kt,
domain/.../userbook/UserBookDomainService.kt,
domain/.../userbook/UserBookRepository.kt,
domain/.../userbook/vo/HomeBookVO.kt,
domain/.../userbook/vo/UserBookInfoVO.kt
UserBook, BookIsbn → UserBook, BookIsbn13으로 타입, 필드, 메서드, 레포지토리 메서드, VO 등 일괄 변경
인프라: Book
infra/.../book/entity/BookEntity.kt,
infra/.../book/repository/JpaBookRepository.kt,
infra/.../book/repository/impl/BookRepositoryImpl.kt
엔티티, JPA, 구현 레포지토리의 isbn 관련 필드, 메서드, 파라미터명을 isbn → isbn13으로 일괄 변경
인프라: UserBook
infra/.../userbook/entity/UserBookEntity.kt,
infra/.../userbook/repository/JpaUserBookRepository.kt,
infra/.../userbook/repository/impl/UserBookRepositoryImpl.kt
엔티티, JPA, 구현 레포지토리의 bookIsbn 관련 필드, 메서드, 파라미터명을 bookIsbn → bookIsbn13으로 일괄 변경 및 DB 컬럼명 수정
외부 API 요청
infra/.../external/aladin/request/AladinBookLookupRequest.kt
AladinBookLookupRequest의 itemId 파라미터를 isbn13으로 변경

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Controller
    participant Service
    participant Domain
    participant Repository

    Client->>Controller: ISBN13 기반 요청 전송
    Controller->>Service: isbn13 필드 전달
    Service->>Domain: isbn13 파라미터로 도메인 메서드 호출
    Domain->>Repository: findByIsbn13, existsByIsbn13 등 호출
    Repository-->>Domain: 결과 반환 (isbn13 기준)
    Domain-->>Service: 처리 결과 반환
    Service-->>Controller: 응답 DTO (isbn13 필드)
    Controller-->>Client: 결과 반환 (isbn13 기준)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~40 minutes

Assessment against linked issues

Objective Addressed Explanation
isbn 필드를 모두 isbn13으로 전환 (#79)

Assessment against linked issues: Out-of-scope changes

(해당 변경사항에서는 linked issue의 목적 외의 기능적 코드 변경이 발견되지 않았습니다.)

Possibly related PRs

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch BOOK-235-refactor/#79

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 3

🔭 Outside diff range comments (1)
infra/src/main/kotlin/org/yapp/infra/book/entity/BookEntity.kt (1)

17-17: SQLDelete 어노테이션의 컬럼명을 업데이트해야 합니다.

SQLDelete 어노테이션이 여전히 이전 컬럼명 "isbn"을 참조하고 있습니다. 실제 컬럼명이 "isbn13"으로 변경되었으므로 런타임 오류가 발생할 수 있습니다.

다음과 같이 수정해주세요:

-@SQLDelete(sql = "UPDATE books SET deleted_at = NOW() WHERE isbn = ?")
+@SQLDelete(sql = "UPDATE books SET deleted_at = NOW() WHERE isbn13 = ?")
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 80300e9 and f097d52.

📒 Files selected for processing (29)
  • apis/src/main/kotlin/org/yapp/apis/book/controller/BookControllerApi.kt (1 hunks)
  • apis/src/main/kotlin/org/yapp/apis/book/dto/request/BookCreateRequest.kt (2 hunks)
  • apis/src/main/kotlin/org/yapp/apis/book/dto/request/BookDetailRequest.kt (1 hunks)
  • apis/src/main/kotlin/org/yapp/apis/book/dto/request/UpsertUserBookRequest.kt (4 hunks)
  • apis/src/main/kotlin/org/yapp/apis/book/dto/request/UserBookRegisterRequest.kt (2 hunks)
  • apis/src/main/kotlin/org/yapp/apis/book/dto/request/UserBooksByIsbn13sRequest.kt (2 hunks)
  • apis/src/main/kotlin/org/yapp/apis/book/dto/response/BookCreateResponse.kt (2 hunks)
  • apis/src/main/kotlin/org/yapp/apis/book/dto/response/UserBookResponse.kt (2 hunks)
  • apis/src/main/kotlin/org/yapp/apis/book/service/AladinBookQueryService.kt (1 hunks)
  • apis/src/main/kotlin/org/yapp/apis/book/service/BookManagementService.kt (1 hunks)
  • apis/src/main/kotlin/org/yapp/apis/book/service/BookQueryService.kt (1 hunks)
  • apis/src/main/kotlin/org/yapp/apis/book/service/UserBookService.kt (3 hunks)
  • apis/src/main/kotlin/org/yapp/apis/book/usecase/BookUseCase.kt (4 hunks)
  • domain/src/main/kotlin/org/yapp/domain/book/Book.kt (6 hunks)
  • domain/src/main/kotlin/org/yapp/domain/book/BookDomainService.kt (3 hunks)
  • domain/src/main/kotlin/org/yapp/domain/book/BookRepository.kt (1 hunks)
  • domain/src/main/kotlin/org/yapp/domain/book/vo/BookInfoVO.kt (2 hunks)
  • domain/src/main/kotlin/org/yapp/domain/userbook/UserBook.kt (6 hunks)
  • domain/src/main/kotlin/org/yapp/domain/userbook/UserBookDomainService.kt (3 hunks)
  • domain/src/main/kotlin/org/yapp/domain/userbook/UserBookRepository.kt (1 hunks)
  • domain/src/main/kotlin/org/yapp/domain/userbook/vo/HomeBookVO.kt (2 hunks)
  • domain/src/main/kotlin/org/yapp/domain/userbook/vo/UserBookInfoVO.kt (2 hunks)
  • infra/src/main/kotlin/org/yapp/infra/book/entity/BookEntity.kt (4 hunks)
  • infra/src/main/kotlin/org/yapp/infra/book/repository/JpaBookRepository.kt (1 hunks)
  • infra/src/main/kotlin/org/yapp/infra/book/repository/impl/BookRepositoryImpl.kt (1 hunks)
  • infra/src/main/kotlin/org/yapp/infra/external/aladin/request/AladinBookLookupRequest.kt (1 hunks)
  • infra/src/main/kotlin/org/yapp/infra/userbook/entity/UserBookEntity.kt (4 hunks)
  • infra/src/main/kotlin/org/yapp/infra/userbook/repository/JpaUserBookRepository.kt (1 hunks)
  • infra/src/main/kotlin/org/yapp/infra/userbook/repository/impl/UserBookRepositoryImpl.kt (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: reed-server 프로젝트에서는 모든 엔티티에 @sqldelete와 @sqlrestriction 어노테이션을 사용한 hibernate soft delete 패턴이 적용되어 있다...
Learnt from: hoonyworld
PR: YAPP-Github/Reed-Server#76
File: domain/src/main/kotlin/org/yapp/domain/user/UserDomainService.kt:96-101
Timestamp: 2025-08-05T16:48:47.218Z
Learning: Reed-Server 프로젝트에서는 모든 엔티티에 SQLDelete와 SQLRestriction 어노테이션을 사용한 Hibernate soft delete 패턴이 적용되어 있다. 따라서 JPA의 deleteById() 호출 시에도 실제로는 UPDATE 쿼리가 실행되어 soft delete가 수행된다.

Applied to files:

  • infra/src/main/kotlin/org/yapp/infra/userbook/entity/UserBookEntity.kt
⏰ 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: build-validation
🔇 Additional comments (60)
apis/src/main/kotlin/org/yapp/apis/book/controller/BookControllerApi.kt (1)

104-104: API 문서 업데이트가 적절합니다.

ISBN에서 ISBN13으로의 전환에 맞춰 오류 메시지 설명을 올바르게 업데이트했습니다. 전체 리팩토링과 일관성을 유지하고 있습니다.

domain/src/main/kotlin/org/yapp/domain/userbook/vo/UserBookInfoVO.kt (2)

11-11: 도메인 모델 속성 변경이 적절합니다.

bookIsbn에서 bookIsbn13으로의 속성명 변경과 타입 변경이 올바르게 적용되었습니다.


41-41: 팩토리 메서드 업데이트가 올바릅니다.

새로운 bookIsbn13 속성에 맞춰 팩토리 메서드의 속성 접근을 정확히 업데이트했습니다.

apis/src/main/kotlin/org/yapp/apis/book/dto/response/UserBookResponse.kt (2)

12-12: 응답 DTO 속성명 변경이 적절합니다.

bookIsbn에서 isbn13으로 속성명을 변경하여 ISBN13 표준화에 맞춰 일관성을 유지했습니다.


29-29: 팩토리 메서드의 속성 접근 업데이트가 올바릅니다.

도메인 객체의 변경된 bookIsbn13 속성에 맞춰 값 접근을 정확히 업데이트했습니다.

apis/src/main/kotlin/org/yapp/apis/book/service/BookManagementService.kt (1)

17-17: 검증 메서드 호출 업데이트가 적절합니다.

request.validIsbn()에서 request.validIsbn13()으로 변경하여 ISBN13 전용 검증 로직을 올바르게 사용하고 있습니다.

apis/src/main/kotlin/org/yapp/apis/book/service/BookQueryService.kt (1)

10-10: 검증 어노테이션 위치 재배치 확인 완료

  • BookController.kt 및 BookControllerApi.kt: @Valid 어노테이션으로 컨트롤러 레벨에서 DTO 검증 수행
  • AladinBookQueryService.kt: 클래스에 @Validated 적용, 메서드 파라미터에 @Valid 유지로 서비스 레벨 검증 보장
  • BookQueryService.kt(인터페이스): 검증 어노테이션 제거는 프록시 기반 검증에 영향이 없으므로 의도된 리팩토링

위와 같이 검증 로직은 모두 정상 동작하므로, 인터페이스에서의 @Valid 제거는 문제없습니다.

infra/src/main/kotlin/org/yapp/infra/external/aladin/request/AladinBookLookupRequest.kt (1)

20-23: 파라미터명 변경이 의미를 명확하게 만들어줍니다

itemId에서 isbn13으로 파라미터명을 변경한 것이 코드의 가독성과 명확성을 향상시켰습니다. 외부 API 호출 시에는 여전히 ItemId로 적절히 매핑되고 있어 기존 로직이 잘 보존되었습니다.

apis/src/main/kotlin/org/yapp/apis/book/dto/response/BookCreateResponse.kt (2)

9-9: 프로퍼티명 변경이 일관성을 확보합니다

isbn에서 isbn13으로의 프로퍼티명 변경이 시스템 전체의 ISBN13 표준화 정책과 일치합니다.


19-19: 매핑 로직이 올바르게 업데이트되었습니다

bookVO.isbn13.value로 변경된 것이 도메인 객체의 변경사항과 일관성 있게 매핑되고 있습니다.

domain/src/main/kotlin/org/yapp/domain/book/vo/BookInfoVO.kt (2)

7-7: 도메인 타입 변경이 정책에 부합합니다

Book.Isbn에서 Book.Isbn13으로의 타입 변경이 ISBN13 표준화 정책을 올바르게 반영하고 있습니다.


27-27: 팩토리 메서드 매핑이 정확합니다

book.isbn13으로 변경된 것이 Book 엔티티의 변경사항과 정확하게 일치합니다.

domain/src/main/kotlin/org/yapp/domain/userbook/vo/HomeBookVO.kt (2)

11-11: UserBook 도메인의 ISBN 프로퍼티 변경이 일관성 있게 적용되었습니다

bookIsbn에서 bookIsbn13으로의 프로퍼티명 변경과 UserBook.BookIsbn13 타입 사용이 시스템 전체의 ISBN13 표준화와 일치합니다.


43-43: 팩토리 메서드가 올바르게 업데이트되었습니다

userBook.bookIsbn13으로 변경된 것이 UserBook 엔티티의 변경사항과 정확하게 매핑됩니다.

apis/src/main/kotlin/org/yapp/apis/book/service/AladinBookQueryService.kt (2)

76-76: 검증 메서드 변경이 정책에 부합합니다

request.validIsbn()에서 request.validIsbn13()으로 변경된 것이 ISBN13 전용 검증 정책과 일치하며, 더 엄격한 검증을 제공합니다.


79-79: 검증 완료: Safe call 연산자 제거가 안전합니다

AladinBookDetailResponse.item은 non-nullable List<AladinDetailItem>로 정의되어 있으며 기본값으로 emptyList()가 설정되어 있습니다. 따라서 response.item.firstOrNull() 사용 시 response.item이 null인 경우는 없으므로 safe call 연산자 제거가 안전합니다.

확인 위치:

  • infra/src/main/kotlin/org/yapp/infra/external/aladin/response/AladinDetailResponse.kt
    @JsonProperty("item") val item: List<AladinDetailItem> = emptyList()
domain/src/main/kotlin/org/yapp/domain/book/BookRepository.kt (1)

8-9: 변경사항이 적절합니다.

ISBN13 사용으로의 표준화 목표에 부합하며, 메서드명과 파라미터명이 명확하게 변경되었습니다. 도메인 레포지토리 인터페이스의 시그니처가 일관성 있게 업데이트되었습니다.

domain/src/main/kotlin/org/yapp/domain/userbook/UserBookRepository.kt (2)

10-10: 메서드명 변경이 적절합니다.

findByUserIdAndBookIsbn에서 findByUserIdAndBookIsbn13으로의 변경이 ISBN13 표준화 목표와 일치합니다.


16-16: 파라미터명과 메서드명이 일관성 있게 변경되었습니다.

bookIsbns에서 bookIsbn13s로의 변경으로 복수형 명명 규칙이 유지되고 있으며, ISBN13 사용 정책에 부합합니다.

infra/src/main/kotlin/org/yapp/infra/book/repository/JpaBookRepository.kt (1)

12-13: JPA 레포지토리 메서드명이 올바르게 변경되었습니다.

도메인 레포지토리 인터페이스와 일치하도록 findByIsbn13existsByIsbn13으로 변경되어 일관성이 유지되었습니다.

infra/src/main/kotlin/org/yapp/infra/book/repository/impl/BookRepositoryImpl.kt (2)

23-25: 구현체가 인터페이스 변경에 맞게 올바르게 업데이트되었습니다.

findByIsbn13 메서드가 JPA 레포지토리 호출과 함께 적절히 구현되었습니다.


27-29: 메서드 구현이 일관성 있게 변경되었습니다.

existsByIsbn13 메서드가 도메인 인터페이스 시그니처와 일치하도록 정확히 구현되었습니다.

apis/src/main/kotlin/org/yapp/apis/book/dto/request/UserBookRegisterRequest.kt (4)

15-19: 유효성 검증 강화가 적절합니다.

ISBN13 형식에 대한 정규식 패턴 검증이 추가되어 데이터 무결성이 향상되었습니다. 에러 메시지도 명확하게 업데이트되었습니다.


20-27: 스키마 문서화가 적절히 업데이트되었습니다.

Swagger 스키마 설명과 예제가 ISBN13 사용에 맞게 정확히 변경되었습니다.


39-39: 메서드명이 일관성 있게 변경되었습니다.

프로퍼티명 변경에 맞춰 validIsbn13() 메서드명도 적절히 업데이트되었습니다.


16-18: ISBN13 정규식 패턴 검증 완료

  • RegexUtils.ISBN13_PATTERN(^(978|979)\d{10}$)은 978 또는 979로 시작하는 총 13자리 숫자 형식을 올바르게 검증합니다.
  • ISBN-13의 체크섬 검증까지 필요하다면, 별도의 로직으로 추가 구현이 필요합니다.
infra/src/main/kotlin/org/yapp/infra/book/entity/BookEntity.kt (1)

26-26: ISBN13 필드 리팩토링이 올바르게 적용되었습니다.

엔티티 전반에 걸쳐 isbn에서 isbn13으로의 이름 변경이 일관성 있게 적용되었습니다. 도메인 변환 메서드들도 적절히 업데이트되었습니다.

Also applies to: 62-62, 77-77

domain/src/main/kotlin/org/yapp/domain/userbook/UserBook.kt (1)

12-12: 도메인 모델의 ISBN13 리팩토링이 일관성 있게 적용되었습니다.

bookIsbn에서 bookIsbn13으로의 변경이 데이터 클래스, 팩토리 메서드, 그리고 재구성 메서드 전반에 걸쳐 올바르게 적용되었습니다.

Also applies to: 47-47, 75-75

apis/src/main/kotlin/org/yapp/apis/book/dto/request/UserBooksByIsbn13sRequest.kt (1)

12-12: DTO의 ISBN13 리팩토링이 올바르게 적용되었습니다.

클래스명, 프로퍼티명, 메서드명, 그리고 팩토리 메서드가 일관성 있게 isbn13 명명 규칙으로 변경되었습니다.

Also applies to: 25-25, 29-29, 32-34

infra/src/main/kotlin/org/yapp/infra/userbook/entity/UserBookEntity.kt (1)

37-38: UserBookEntity의 ISBN13 리팩토링이 올바르게 적용되었습니다.

데이터베이스 컬럼명이 book_isbn에서 book_isbn13으로 변경되었고, 엔티티 프로퍼티와 도메인 변환 메서드들이 일관성 있게 업데이트되었습니다. 유니크 제약조건도 적절히 유지되고 있습니다.

Also applies to: 76-76, 94-94

infra/src/main/kotlin/org/yapp/infra/userbook/repository/JpaUserBookRepository.kt (1)

8-8: 레포지토리 인터페이스의 ISBN13 리팩토링이 올바르게 적용되었습니다.

메서드명과 파라미터명이 엔티티의 bookIsbn13 프로퍼티 변경에 맞춰 일관성 있게 업데이트되었습니다. Spring Data JPA가 올바른 쿼리를 생성할 것입니다.

Also applies to: 12-12

domain/src/main/kotlin/org/yapp/domain/book/BookDomainService.kt (3)

19-41: ISBN13 리팩토링이 일관되게 적용됨

findOrCreate 메서드에서 매개변수, 로컬 변수, 그리고 도메인 객체 생성 호출이 모두 isbn13으로 일관되게 변경되었습니다.


43-68: save 메서드의 ISBN13 전환이 올바름

repository의 existsByIsbn13 호출과 Book.createisbn13 매개변수 사용이 일관되게 적용되었습니다.


70-73: private 헬퍼 메서드명 변경이 적절함

findByIsbnOrNull에서 findByIsbn13OrNull로의 메서드명 변경과 repository 호출이 일관되게 업데이트되었습니다.

apis/src/main/kotlin/org/yapp/apis/book/dto/request/UpsertUserBookRequest.kt (3)

36-48: ISBN13 필드 정의가 올바르게 업데이트됨

필드명, 유효성 검사 패턴, 스키마 설명이 모두 ISBN13 형식에 맞게 일관되게 변경되었습니다. RegexUtils.ISBN13_PATTERN 사용도 적절합니다.


103-103: 접근자 메서드명이 일관되게 변경됨

validBookIsbn()에서 validBookIsbn13()으로의 메서드명 변경이 필드명 변경과 일관됩니다.


111-127: 팩토리 메서드가 올바르게 업데이트됨

BookCreateResponse.isbn13 필드를 사용하여 isbn13 프로퍼티를 설정하는 것이 적절합니다.

apis/src/main/kotlin/org/yapp/apis/book/dto/request/BookDetailRequest.kt (3)

10-10: 클래스 설명이 ISBN13을 명시하도록 업데이트됨

스키마 설명에서 "특정 ISBN13을 통한" 표현으로 명확하게 변경되었습니다.


13-25: ISBN13 필드 정의와 유효성 검사가 올바름

필드명, 유효성 검사 메시지, 스키마 설명이 모두 13자리 ISBN13 형식을 명시하도록 일관되게 업데이트되었습니다.


27-37: 접근자 메서드와 팩토리 메서드가 일관되게 변경됨

validIsbn13() 메서드명과 팩토리 메서드의 isbn13 매개변수가 필드명 변경과 일치합니다.

apis/src/main/kotlin/org/yapp/apis/book/usecase/BookUseCase.kt (4)

7-7: 임포트가 올바르게 업데이트됨

UserBooksByIsbnsRequest에서 UserBooksByIsbn13sRequest로 임포트가 적절하게 변경되었습니다.


54-54: 서비스 메서드 호출이 ISBN13 변형으로 업데이트됨

findUserBookStatusByIsbn에서 findUserBookStatusByIsbn13으로 메서드 호출이 일관되게 변경되었습니다.


67-67: 요청 유효성 검사 메서드가 올바르게 업데이트됨

validBookIsbn()에서 validIsbn13()으로 메서드 호출이 적절하게 변경되었습니다.


99-119: ISBN13 처리 로직이 일관되게 업데이트됨

변수명(isbn13s), 서비스 메서드 호출(findAllByUserIdAndBookIsbn13In), 맵 키 접근(isbn13) 모두 일관되게 변경되었습니다.

apis/src/main/kotlin/org/yapp/apis/book/service/UserBookService.kt (4)

8-8: DTO 임포트가 올바르게 업데이트됨

UserBooksByIsbnsRequest에서 UserBooksByIsbn13sRequest로 임포트가 적절하게 변경되었습니다.


28-28: 유효성 검사 메서드 호출이 업데이트됨

validBookIsbn()에서 validBookIsbn13()으로 메서드 호출이 일관되게 변경되었습니다.


47-52: 메서드 시그니처와 구현이 ISBN13으로 일관되게 업데이트됨

메서드명, 매개변수 타입, 그리고 유효성 검사 메서드 호출이 모두 ISBN13 형식으로 일관되게 변경되었습니다.


55-57: 도메인 서비스 메서드 호출이 올바르게 업데이트됨

findUserBookStatusByIsbn13 메서드명과 도메인 서비스의 findByUserIdAndBookIsbn13 호출이 일관되게 변경되었습니다.

infra/src/main/kotlin/org/yapp/infra/userbook/repository/impl/UserBookRepositoryImpl.kt (2)

20-21: 메서드 명과 매개변수 명이 올바르게 변경되었습니다.

findByUserIdAndBookIsbn에서 findByUserIdAndBookIsbn13으로, 매개변수도 isbn에서 isbn13으로 일관되게 변경되어 ISBN13 표준화 목적에 부합합니다.


45-49: 메서드 명과 JPA 레포지토리 호출이 올바르게 업데이트되었습니다.

findAllByUserIdAndBookIsbnIn에서 findAllByUserIdAndBookIsbn13In으로 변경되었고, 내부 JPA 레포지토리 호출도 정확하게 업데이트되었습니다.

apis/src/main/kotlin/org/yapp/apis/book/dto/request/BookCreateRequest.kt (3)

13-25: ISBN13 유효성 검증이 강화되었습니다.

@Pattern 어노테이션을 추가하여 13자리 ISBN13 형식을 엄격하게 검증하도록 개선되었고, 스키마 설명도 명확하게 업데이트되었습니다.


86-86: 메서드명이 일관되게 변경되었습니다.

validIsbn()에서 validIsbn13()으로 변경되어 필드명 변경과 일치합니다.


93-105: 팩토리 메서드가 올바르게 업데이트되었습니다.

매개변수명과 내부 구현이 모두 isbn13으로 일관되게 변경되었고, null 체크 시 에러 메시지도 적절하게 업데이트되었습니다.

domain/src/main/kotlin/org/yapp/domain/book/Book.kt (4)

10-10: 프로퍼티명과 타입이 일관되게 변경되었습니다.

isbn: Isbn에서 isbn13: Isbn13으로 변경되어 ISBN13 표준화에 부합합니다.


22-41: create 메서드가 올바르게 업데이트되었습니다.

매개변수명과 내부 구현이 모두 isbn13으로 일관되게 변경되었습니다.


43-69: reconstruct 메서드가 올바르게 업데이트되었습니다.

매개변수 타입과 이름, 내부 할당이 모두 isbn13: Isbn13으로 일관되게 변경되었습니다.


80-87: Isbn13 인라인 value 클래스가 적절히 리네임되었습니다.

클래스명과 팩토리 메서드명이 일관되게 Isbn13으로 변경되었고, 기존 유효성 검증 로직은 그대로 유지되었습니다.

domain/src/main/kotlin/org/yapp/domain/userbook/UserBookDomainService.kt (3)

15-39: upsertUserBook 메서드가 올바르게 업데이트되었습니다.

매개변수명 bookIsbn13으로 변경, 레포지토리 메서드 호출 findByUserIdAndBookIsbn13, 그리고 UserBook.create 호출 시 매개변수가 모두 일관되게 업데이트되었습니다.


52-58: findAllByUserIdAndBookIsbn13In 메서드가 올바르게 변경되었습니다.

메서드명과 매개변수명 isbn13s, 레포지토리 호출이 모두 일관되게 업데이트되었습니다.


60-63: findByUserIdAndBookIsbn13 메서드가 올바르게 변경되었습니다.

메서드명과 매개변수명 isbn13, 레포지토리 호출이 일관되게 업데이트되었습니다.

description = "도서 ISBN 목록",
example = "[\"9788966262429\", \"9791190412351\"]"
)
@field:NotEmpty(message = "isbns는 비어있을 수 없습니다.")
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

검증 메시지를 업데이트해주세요.

검증 메시지가 여전히 이전 필드명 "isbns"를 참조하고 있습니다. 일관성을 위해 "isbn13s"로 변경해야 합니다.

다음과 같이 수정해주세요:

-@field:NotEmpty(message = "isbns는 비어있을 수 없습니다.")
+@field:NotEmpty(message = "isbn13s는 비어있을 수 없습니다.")
🤖 Prompt for AI Agents
In
apis/src/main/kotlin/org/yapp/apis/book/dto/request/UserBooksByIsbn13sRequest.kt
at line 24, update the validation message for the NotEmpty annotation to replace
the old field name "isbns" with the current field name "isbn13s" to maintain
consistency. Change the message string to reflect "isbn13s" instead of "isbns".

import org.yapp.infra.common.BaseTimeEntity
import java.sql.Types
import java.util.UUID
import java.util.*
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

와일드카드 임포트 사용을 재고해주세요.

특정 UUID 임포트에서 와일드카드 임포트(java.util.*)로 변경되었습니다. ISBN 리팩토링과는 직접적인 관련이 없으며, 명시적 임포트가 더 명확할 수 있습니다.

다음과 같이 되돌리는 것을 고려해주세요:

-import java.util.*
+import java.util.UUID
🤖 Prompt for AI Agents
In infra/src/main/kotlin/org/yapp/infra/book/entity/BookEntity.kt at line 13,
replace the wildcard import 'java.util.*' with an explicit import of
'java.util.UUID' to improve code clarity and maintain explicit dependencies.

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: 3

♻️ Duplicate comments (3)
apis/src/main/kotlin/org/yapp/apis/book/dto/request/UserBooksByIsbn13sRequest.kt (1)

24-24: 검증 메시지가 올바르게 업데이트되었습니다.

이전 리뷰에서 지적된 검증 메시지 불일치 문제가 해결되었습니다. 필드명 "isbn13s"와 일치하도록 메시지가 적절히 수정되었습니다.

domain/src/main/kotlin/org/yapp/domain/userbook/UserBook.kt (2)

110-117: 클래스명과 검증 로직 간의 불일치가 여전히 해결되지 않았습니다.

BookIsbn13 클래스명은 13자리 ISBN 전용임을 암시하고 검증 메시지도 "13-digit number"로 업데이트되었지만, 실제 검증 로직(IsbnValidator.isValidIsbn)은 여전히 10자리와 13자리 ISBN을 모두 허용합니다.

이전 리뷰에서 지적된 문제가 해결되지 않았습니다. 다음 중 하나를 선택하여 일관성을 확보해주세요:

  1. 클래스명을 BookIsbn으로 변경하여 10/13자리 모두 지원함을 명시
  2. 검증 로직을 ISBN13만 허용하도록 수정하여 클래스명과 일치시키기
 companion object {
     fun newInstance(value: String): BookIsbn13 {
-        require(IsbnValidator.isValidIsbn(value)) { "ISBN13 must be a 13-digit number." }
+        require(IsbnValidator.isValidIsbn13(value)) { "ISBN13 must be a 13-digit number." }
         return BookIsbn13(value)
     }
 }

110-117: 클래스명과 검증 로직 간의 불일치를 해결해주세요.

BookIsbn13 클래스명은 13자리 ISBN만을 처리한다고 암시하지만, 실제 검증 로직(IsbnValidator.isValidIsbn)은 여전히 10자리와 13자리 ISBN을 모두 허용합니다. 이는 혼란을 야기할 수 있습니다.

다음 두 방안 중 하나를 선택하여 일관성을 확보해주세요:

방안 1: 검증 로직을 13자리 전용으로 변경

-require(IsbnValidator.isValidIsbn(value)) { "ISBN13 must be a 13-digit number." }
+require(IsbnValidator.isValidIsbn13(value)) { "ISBN13 must be a 13-digit number." }

방안 2: 클래스명을 더 일반적으로 변경

-value class BookIsbn13(val value: String) {
+value class BookIsbn(val value: String) {
    companion object {
-        fun newInstance(value: String): BookIsbn13 {
+        fun newInstance(value: String): BookIsbn {
            require(IsbnValidator.isValidIsbn(value)) { "ISBN must be a valid 10 or 13-digit number." }
-            return BookIsbn13(value)
+            return BookIsbn(value)
        }
    }
}
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f097d52 and 3bb5b25.

📒 Files selected for processing (2)
  • apis/src/main/kotlin/org/yapp/apis/book/dto/request/UserBooksByIsbn13sRequest.kt (2 hunks)
  • domain/src/main/kotlin/org/yapp/domain/userbook/UserBook.kt (6 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: build-validation
🔇 Additional comments (9)
apis/src/main/kotlin/org/yapp/apis/book/dto/request/UserBooksByIsbn13sRequest.kt (4)

25-25: LGTM!

프로퍼티명과 메서드명이 일관성 있게 ISBN13 명명 규칙에 맞게 변경되었습니다.

Also applies to: 29-29


32-34: LGTM!

팩토리 메서드의 파라미터명이 일관성 있게 업데이트되었습니다.


9-12: 클래스명 변경이 적절하게 수행되었습니다.

UserBooksByIsbnsRequest에서 UserBooksByIsbn13sRequest로의 클래스명 변경이 ISBN13 표준화 목표와 일치합니다.


29-29: 메서드명 변경이 올바르게 수행되었습니다.

validIsbns()에서 validIsbn13s()로의 메서드명 변경이 적절합니다.

domain/src/main/kotlin/org/yapp/domain/userbook/UserBook.kt (5)

12-12: LGTM!

프로퍼티명이 ISBN13 명명 규칙에 맞게 일관성 있게 변경되었습니다.


35-35: LGTM!

create 메서드의 파라미터명과 팩토리 메서드 호출이 일관성 있게 업데이트되었습니다.

Also applies to: 46-46


59-59: LGTM!

reconstruct 메서드의 파라미터명과 프로퍼티 할당이 일관성 있게 업데이트되었습니다.

Also applies to: 74-74


12-12: 프로퍼티명 변경이 적절하게 수행되었습니다.

bookIsbn에서 bookIsbn13으로의 프로퍼티명 변경이 ISBN13 표준화 목표와 일치합니다.


35-46: 팩토리 메서드 매개변수 및 생성 로직이 올바르게 업데이트되었습니다.

create 메서드의 bookIsbn13 매개변수명 변경과 BookIsbn13.newInstance 호출이 적절합니다.

Comment on lines +24 to +25
@field:NotEmpty(message = "isbn13 리스트는 비어있을 수 없습니다.")
val isbn13s: List<String>? = null
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

검증 메시지 용어 일관성을 개선해주세요.

검증 메시지가 "isbn13 리스트"로 되어 있지만, 실제 프로퍼티명은 isbn13s입니다. 일관성을 위해 메시지를 프로퍼티명과 맞춰주세요.

다음과 같이 수정을 제안합니다:

-@field:NotEmpty(message = "isbn13 리스트는 비어있을 수 없습니다.")
+@field:NotEmpty(message = "isbn13s는 비어있을 수 없습니다.")
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@field:NotEmpty(message = "isbn13 리스트는 비어있을 수 없습니다.")
val isbn13s: List<String>? = null
@field:NotEmpty(message = "isbn13s는 비어있을 수 없습니다.")
val isbn13s: List<String>? = null
🤖 Prompt for AI Agents
In
apis/src/main/kotlin/org/yapp/apis/book/dto/request/UserBooksByIsbn13sRequest.kt
around lines 24 to 25, the validation message uses "isbn13 리스트" which is
inconsistent with the property name `isbn13s`. Update the validation message to
use `isbn13s` instead of "isbn13 리스트" to maintain terminology consistency.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Aug 7, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@move-hoon move-hoon merged commit c0d258b into develop Aug 7, 2025
4 of 5 checks passed
@move-hoon move-hoon deleted the BOOK-235-refactor/#79 branch August 7, 2025 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BOOK-235/refactor] isbn 필드를 모두 isbn13으로 전환

2 participants