feat(store): 구매자 매장 후기 목록 조회(storeReviews)와 좋아요 집계#159
Conversation
- storeReviews(input): 매장 공개 리뷰 목록(최신순·커서), totalCount(후기 탭 카운트), media·작성자 닉네임·연결 상품명(주문 스냅샷) - 리뷰 좋아요 수 집계 + isLiked(OptionalJwtAuthGuard, 비로그인 false) - 매장 공개 리뷰 조회를 store feature가 소유(StoreReviewRepository 신설). user의 ReviewRepository(본인 리뷰 작성/관리)와 책임 분리, cross-feature 경계 준수 - 단위(mapper)·통합(service/resolver) 테스트 11건
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
🧹 knip — dead-code 리포트전체 리포트
|
🩺 NestJS Doctor — 89/100 (Good)진단 258건 (error 0).
architecture / security 상위 항목
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3f737eeb5a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| store_id: args.storeId, | ||
| deleted_at: null, |
There was a problem hiding this comment.
Restrict storeReviews to active stores
When a store is soft-deleted or marked inactive, storeDetail hides it via findStoreDetailById (is_active: true, deleted_at: null), but this new public review query only filters reviews by store_id. Anyone who still knows that store ID can call storeReviews and receive the review content/media and totalCount; add the same active-store relation filter or an existence check, and mirror it in countStoreReviews.
Useful? React with 👍 / 👎.
Coverage report
Test suite run success1376 tests passing in 165 suites. Report generated by 🧪jest coverage report action from fa88dc1 |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
비활성/삭제 매장의 store_id를 알면 storeReviews로 리뷰 내용·미디어·totalCount가 노출되던 문제를 수정한다. listStoreReviews·countStoreReviews where에 store active/deleted 술어를 추가해 storeDetail의 가드와 일치시킨다. (Codex P2 반영)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 847f8acdb0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| account: { | ||
| select: { user_profile: { select: { nickname: true } } }, | ||
| }, |
There was a problem hiding this comment.
Hide nicknames for deleted review authors
When a user deletes their account after writing a review, softDeleteAccount marks userProfile.deleted_at and overwrites the nickname to deleted_<accountId> (src/features/user/repositories/user.repository.ts), but this nested select still reads the profile without checking deleted_at (the soft-delete extension only patches the root review.findMany). As a result, the public storeReviews response exposes authorNickname: "deleted_123" for deleted users instead of anonymizing it; select deleted_at and map deleted profiles to null or filter the relation.
Useful? React with 👍 / 👎.
탈퇴(soft-delete) 시 nickname이 deleted_<id>로 덮어써지는데, soft-delete extension은 nested user_profile에 deleted_at을 주입하지 않아 storeReviews가 deleted_<id>를 그대로 노출했다. user_profile.deleted_at을 함께 select하고 매퍼에서 탈퇴 프로필은 authorNickname=null로 익명화한다. (Codex P2 :55 반영)
Summary
구매자 매장 후기 탭 조회 API를 신설한다. 매장 상세 화면의 후기 영역(공개 리뷰 목록 · 평점 · 사진 · 좋아요 · 빈 상태)을 담당한다. store-detail 도메인 작업의 3단계(마지막).
Scope
storeReviews(input: StoreReviewsInput!): StoreReviewConnection!(public,OptionalJwtAuthGuard)totalCount(후기 탭 카운트, 0이면 빈 상태)rating·content·media(이미지/영상) ·authorNickname·productName(주문 시점 스냅샷) ·createdAtisLiked(로그인 사용자 기준, 비로그인 false)StoreReviewRepository신설ReviewRepository는 user feature의 "본인 리뷰 작성/관리" 전용. store가 직접 import하면 cross-feature 내부 import 위반. 같은 테이블을 읽어도 "매장 공개 리뷰 + 좋아요 집계"는 매장 조회 유스케이스로 응집likeReview)은 user feature 그대로, store는 집계/isLiked읽기만ReviewMediaTypeenum은 기존 user-review SDL 정의를 재사용진행 상황
storeDetail머지됨, PR2 상품 탭 feat(product): 구매자 매장 상품 목록·카테고리 조회 API #158 리뷰 중, PR3 후기 탭)Impact
Test plan
yarn validate전체 통과(dto:check·arch:check·커버리지 포함)