feat: 리뷰 수정 API에서 별점도 함께 갱신#589
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
리뷰 수정 API에서 기존에 갱신되지 않던 reviews.review_rating(리뷰 시점 별점 스냅샷)을 수정 시점의 값으로 함께 갱신하도록 보완한 PR입니다. ratings 테이블은 변경하지 않고, 리뷰 엔티티의 스냅샷 컬럼만 동일 정책(작성 API와 동일)으로 업데이트합니다.
Changes:
ReviewModifyRequest에rating을 추가하고, 누락/null 입력을0.0으로 기본 처리- 수정 요청 래퍼에서
RatingPoint로 별점 유효성 검증 후Review#update()에서reviewRating갱신 - 통합/문서 테스트에서 별점 필드 반영 및 시그니처 변경 영향 범위 업데이트
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| bottlenote-product-api/src/test/java/app/docs/review/RestReviewControllerDocsTest.java | 리뷰 수정 요청 문서에 rating 필드 추가 |
| bottlenote-product-api/src/test/java/app/bottlenote/review/integration/ReviewIntegrationTest.java | 리뷰 수정 시 review_rating 갱신을 검증하는 어서션 추가 |
| bottlenote-product-api/src/test/java/app/bottlenote/review/fixture/ReviewObjectFixture.java | ReviewModifyRequest 생성 시그니처 변경에 맞춰 픽스처 갱신 |
| bottlenote-product-api/src/test/java/app/bottlenote/common/file/integration/ImageUploadIntegrationTest.java | ReviewModifyRequest 파라미터 추가에 따른 테스트 호출부 수정 |
| bottlenote-product-api/src/test/java/app/bottlenote/common/file/event/ImageResourceActivatedEventPublishTest.java | ReviewModifyRequest 파라미터 추가에 따른 테스트 호출부 수정 |
| bottlenote-mono/src/main/java/app/bottlenote/review/dto/request/ReviewModifyRequestWrapperItem.java | rating을 RatingPoint로 검증/정규화하여 래핑 |
| bottlenote-mono/src/main/java/app/bottlenote/review/dto/request/ReviewModifyRequest.java | 수정 요청 DTO에 rating 추가 및 null→0.0 기본 처리 |
| bottlenote-mono/src/main/java/app/bottlenote/review/domain/Review.java | update()에서 reviewRating을 함께 갱신하도록 반영 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
reviews.review_rating컬럼이 갱신되지 않던 문제를 해결 (의사결정: 수정 시점의 별점도 함께 반영)ratings테이블은 건드리지 않고reviews.review_rating스냅샷만 갱신 (작성 API와 동일 정책)rating누락/null 시0.0으로 fallback (작성 API와 동일)변경 내역
본 코드 (3)
ReviewModifyRequest:Double rating필드 추가 + null→0.0 fallbackReviewModifyRequestWrapperItem: 생성자에서RatingPoint.of(...)검증 후 보관Review#update():this.reviewRating = wrapper.getRating()추가테스트 (5)
ReviewObjectFixture: 4개 빌더 시그니처 갱신ReviewIntegrationTest.update.test_1: 별점 갱신 어서션 추가RestReviewControllerDocsTest.review_modify_test:rating필드 문서화ImageUploadIntegrationTest,ImageResourceActivatedEventPublishTest: 시그니처 변경 영향 보강Test plan
./gradlew compileJava compileTestJava./gradlew :bottlenote-admin-api:compileKotlin :bottlenote-admin-api:compileTestKotlin./gradlew check_rule_test./gradlew unit_test./gradlew build -x test -x asciidoctor./gradlew integration_test(3m 23s)./gradlew admin_integration_test(4m 20s)