Skip to content

feat(user): 리뷰 작성 가능 주문 아이템 목록(myReviewableOrderItems) - #188

Merged
chanwoo7 merged 1 commit into
developfrom
feat/mypage-reviewable-order-items
Aug 19, 2026
Merged

feat(user): 리뷰 작성 가능 주문 아이템 목록(myReviewableOrderItems)#188
chanwoo7 merged 1 commit into
developfrom
feat/mypage-reviewable-order-items

Conversation

@chanwoo7

@chanwoo7 chanwoo7 commented Aug 19, 2026

Copy link
Copy Markdown
Member

배경

마이페이지 리뷰 탭의 '리뷰 남기기' 목록에 대응하는 조회 API가 없었다.
기존 수단은 두 가지뿐이다. myOrdershasReviewableItem은 주문 단위 불리언이고, 아이템 단위 canWriteReviewmyOrder 상세를 열어야 나온다.
이 조합으로 화면을 만들면 주문 수만큼 상세 조회가 따라붙고, 탭 카운트("리뷰 남기기 2")는 구할 방법이 없다.

그래서 작성 가능 아이템을 아이템 단위 플랫 목록으로 주는 쿼리를 추가했다.

변경 내용

myReviewableOrderItems(input): MyReviewableOrderItemConnection! — 로그인 필수.

  • totalCount가 그대로 탭 카운트다.
  • 카드 필드는 orderItemId, productId, 케이크명(주문 시점 스냅샷), 대표 이미지, 매장명, regionLabel, pickedUpAt. orderItemId는 "리뷰 작성" 버튼에서 writeReview 입력으로 그대로 쓴다.
  • 정렬은 픽업 최신순(picked_up_at desc, 동률 시 id desc). 방금 받은 케이크가 위로 온다.
  • 페이지네이션은 마이페이지 계열 관례대로 offset.

"작성 가능" 판정은 새로 정의하지 않았다. 기존 canWriteReview / findReviewableOrderIds와 같은 기준이다 — 픽업 완료(PICKED_UP) + 활성 리뷰 없음.
리뷰를 삭제하면 soft-delete만 되므로 그 아이템은 이 목록에 다시 나타난다. writeReview의 create-or-restore 동작과 짝이 맞는다.
비활성 상품·매장의 건도 목록에 남긴다. 이미 픽업까지 끝난 주문의 리뷰 권리는 현재 판매 여부와 무관해서다.

구현은 OrderRepository.listReviewableOrderItems(목록 + count 단일 트랜잭션)와 UserReviewService의 매핑이다. 지역 표기는 매장 카드들과 같은 buildRegionLabel을 재사용한다.

남겨둔 것

새 쿼리에는 order.deleted_at IS NULL을 명시했다. soft-delete extension이 nested relation 필터에는 닿지 않기 때문이다.
같은 가드가 기존 findReviewableOrderIds에는 없는데, 그쪽은 이미 조회된(=삭제되지 않은) 주문 id 집합을 입력받는 구조라 실해가 없어 손대지 않았다.

테스트

real DB 6건을 추가했다. 픽업 최신순·카운트, 카드 필드 매핑, 리뷰 삭제 후 재포함, 비픽업·삭제 주문·타인 주문 제외, offset/hasMore 경계, 그리고 조회 → 작성 → 목록에서 빠지는 통합 흐름 1건.
yarn validate 통과.

figma 마이페이지 리뷰 탭(MyPage_Review_Tab) '리뷰 남기기' 목록 대응.
기존에는 myOrders.hasReviewableItem + myOrder.canWriteReview 조합으로만
접근 가능해 아이템 플랫 목록·탭 카운트를 구할 수 없었다.

- SDL user-review.graphql에 myReviewableOrderItems(input):
  MyReviewableOrderItemConnection! 추가 (totalCount = '리뷰 남기기 N' 탭 카운트)
- 판정 조건은 기존 canWriteReview/findReviewableOrderIds와 동일:
  픽업 완료(PICKED_UP) + 활성 리뷰 미존재(soft-delete 리뷰는 재작성 가능).
  삭제된 주문 제외(nested soft-delete 가드 명시)
- 카드 필드: orderItemId(writeReview 입력용)·productId·케이크명 스냅샷·
  대표 이미지·매장명·지역 표기(buildRegionLabel 재사용)·pickedUpAt
- 정렬은 픽업 최신순(picked_up_at desc, id desc). offset 페이지네이션
- OrderRepository.listReviewableOrderItems 추가, UserReviewService에서 조합

회귀 테스트 6건: 픽업 최신순·카운트, 카드 매핑, 활성 리뷰 제외·soft-delete
리뷰 재포함, 비픽업·삭제 주문·타인 주문 제외, offset/hasMore,
resolver 통합 1건(작성 후 목록에서 빠짐).
@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 75431e27-c3bd-4e76-9bfe-547655be657c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@github-actions

Copy link
Copy Markdown

🧹 knip — dead-code 리포트

요약 항목 없음
전체 리포트
(knip 출력 없음 — 이슈 0이거나 실행 실패)

청소 후보(오탐 가능) · 기준 docs/guide/architecture-conventions.md

@github-actions

Copy link
Copy Markdown

🩺 NestJS Doctor — 89/100 (Good)

진단 277건 (error 0).

Category error warning info
architecture 0 0 13
correctness 0 124 0
performance 0 24 17
schema 0 0 86
security 0 13 0
architecture / security 상위 항목
  • info architecture/architecture/no-barrel-export-internals: Barrel file re-exports internal type 'IAuditLogRepository'.
  • warning security/security/no-exposed-env-vars: Direct 'process.env.NODE_ENV' access in 'AuthController'. Use ConfigService instead.
  • warning security/security/require-guards-on-endpoints: Endpoint 'start' has no @UseGuards() at class or method level.
  • warning security/security/require-guards-on-endpoints: Endpoint 'callback' has no @UseGuards() at class or method level.
  • warning security/security/require-guards-on-endpoints: Endpoint 'refresh' has no @UseGuards() at class or method level.
  • warning security/security/require-guards-on-endpoints: Endpoint 'logout' has no @UseGuards() at class or method level.
  • warning security/security/require-guards-on-endpoints: Endpoint 'sellerLogin' has no @UseGuards() at class or method level.
  • warning security/security/require-guards-on-endpoints: Endpoint 'sellerRefresh' has no @UseGuards() at class or method level.
  • warning security/security/require-guards-on-endpoints: Endpoint 'sellerLogout' has no @UseGuards() at class or method level.
  • warning security/security/require-guards-on-endpoints: Endpoint 'devIssueToken' has no @UseGuards() at class or method level.
  • info architecture/architecture/no-barrel-export-internals: Barrel file re-exports internal module '@/features/conversation/repositories/conversation.repository'.
  • info architecture/architecture/no-barrel-export-internals: Barrel file re-exports internal type 'ConversationRepository'.
  • info architecture/architecture/no-barrel-export-internals: Barrel file re-exports internal module '@/features/order/repositories/order.repository'.
  • info architecture/architecture/no-barrel-export-internals: Barrel file re-exports internal type 'OrderRepository'.
  • info architecture/architecture/no-barrel-export-internals: Barrel file re-exports internal module '@/features/product/repositories/product.repository'.

오탐 포함 가능 · 기준 docs/guide/architecture-conventions.md

@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.47619% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/features/user/services/user-review.service.ts 83.33% 0 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 97.53% 4659/4777
🟢 Branches 93.12% 1488/1598
🟢 Functions 95.89% 909/948
🟢 Lines 98.17% 4237/4316

Test suite run success

1552 tests passing in 182 suites.

Report generated by 🧪jest coverage report action from 1935739

@chanwoo7
chanwoo7 merged commit c2726c2 into develop Aug 19, 2026
12 checks passed
@chanwoo7
chanwoo7 deleted the feat/mypage-reviewable-order-items branch August 19, 2026 17:56
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.

1 participant