Skip to content

chore: 릴리즈 — 비로그인 500 수정·storeReviews 사진후기 필터 - #172

Merged
chanwoo7 merged 2 commits into
mainfrom
develop
Aug 5, 2026
Merged

chore: 릴리즈 — 비로그인 500 수정·storeReviews 사진후기 필터#172
chanwoo7 merged 2 commits into
mainfrom
develop

Conversation

@chanwoo7

@chanwoo7 chanwoo7 commented Aug 5, 2026

Copy link
Copy Markdown
Member

Summary

FE 연동 중 발견된 비로그인 500 버그 수정과 매장 사진후기 필드 추가 릴리즈입니다.

Scope

  • src/global/auth/decorators/ — 컨텍스트 타입 분기 + spec mock 정합화/회귀 케이스
  • src/features/store/ — SDL·DTO·repository·service·output type (additive 변경)

진행 상황

Impact

  • 비로그인 사용자의 매장/상품 상세·리뷰 조회 500 오류 해소 (운영에 살아있던 버그).
  • 매장 사진후기 그리드 구현 가능(storeReviews(photoOnly: true) + photoTotalCount).
  • 스키마 변경은 additive — 기존 FE 호출 breaking 없음. DB 마이그레이션 없음.

Test plan

  • 데코레이터: GraphQL 로그인/비로그인·HTTP 경로 단위 테스트 (비로그인 회귀 케이스 포함)
  • storeReviews: photoOnly 필터·photoTotalCount·soft-delete 미디어 제외 service/resolver 테스트
  • yarn validate 전체 green (양 PR 각각 1464+ 테스트)
  • 로컬 수동 검증: 비로그인 storeReviews 200 응답, photoOnly 필터 동작

Summary by CodeRabbit

  • 새로운 기능

    • 매장 리뷰를 사진이 포함된 리뷰만 조회하도록 필터링할 수 있습니다.
    • 리뷰 응답에 전체 사진 리뷰 수가 함께 제공됩니다.
  • 버그 수정

    • GraphQL 인증 사용자 정보를 컨텍스트에 맞게 정확히 확인하도록 개선했습니다.
    • 삭제된 사진만 포함된 리뷰가 사진 리뷰로 집계되지 않습니다.
  • 테스트

    • 사진 리뷰 필터와 사진 리뷰 수 집계에 대한 검증을 강화했습니다.

GraphQL 컨텍스트에서 req.user가 없으면 HTTP 폴백으로 내려갔는데,
GraphQL ExecutionContext의 switchToHttp().getRequest()는 resolver
root(args[0])를 반환하므로 루트 Query 비로그인 요청이 전부
TypeError(500)로 실패했다. 컨텍스트 타입 분기로 폴백을 차단한다.

spec mock도 실제 ExecutionContextHost 동작(getRequest()=args[0])에
맞게 고치고 비로그인 회귀 케이스를 추가한다.
매장 사진후기 화면(FE 요청)을 위해 productReviews와 동일 의미론으로
StoreReviewsInput.photoOnly(기본 false), StoreReviewConnection.photoTotalCount를
추가한다. photoTotalCount는 필터와 무관하게 항상 사진 리뷰 총수.

repository는 product 쪽 publicReviewWhere 패턴을 미러링해 활성 미디어
존재(media.some, soft-delete 제외) 기준으로 필터·카운트한다.
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 445166df-7db9-492f-a82d-9a2a0fa7e477

📥 Commits

Reviewing files that changed from the base of the PR and between 992ddb6 and fd23698.

📒 Files selected for processing (9)
  • src/features/store/dto/inputs/store-reviews.input.ts
  • src/features/store/repositories/store-review.repository.ts
  • src/features/store/resolvers/store-review-query.resolver.spec.ts
  • src/features/store/services/store-review.service.spec.ts
  • src/features/store/services/store-review.service.ts
  • src/features/store/store-reviews.graphql
  • src/features/store/types/store-review-output.type.ts
  • src/global/auth/decorators/current-user.decorator.spec.ts
  • src/global/auth/decorators/current-user.decorator.ts

📝 Walkthrough

Walkthrough

매장 리뷰 조회에 photoOnly 필터와 photoTotalCount 응답이 추가되었습니다. 서비스와 저장소 조회 조건과 집계가 이에 맞게 변경되었습니다. 또한 CurrentUser 데코레이터는 GraphQL과 HTTP 컨텍스트를 명시적으로 구분하도록 수정되었습니다.

Changes

매장 리뷰 사진 필터와 카운트

Layer / File(s) Summary
입력과 응답 계약 확장
src/features/store/dto/inputs/store-reviews.input.ts, src/features/store/store-reviews.graphql, src/features/store/types/store-review-output.type.ts
StoreReviewsInputphotoOnly가 추가되었습니다. StoreReviewConnectionphotoTotalCount가 추가되었습니다.
조회와 집계 로직 반영
src/features/store/services/store-review.service.ts, src/features/store/repositories/store-review.repository.ts, src/features/store/services/store-review.service.spec.ts, src/features/store/resolvers/store-review-query.resolver.spec.ts
서비스와 저장소가 photoOnly 조건을 사용해 리뷰 목록과 카운트를 조회합니다. 응답은 필터 적용 총수와 별도의 photoTotalCount를 함께 반환합니다. 테스트는 사진 리뷰만 반환되는 경우와 soft-delete 미디어 제외를 검증합니다.

CurrentUser 컨텍스트 분기 수정

Layer / File(s) Summary
GraphQL과 HTTP 분기 명시화
src/global/auth/decorators/current-user.decorator.ts, src/global/auth/decorators/current-user.decorator.spec.ts
데코레이터가 실행 컨텍스트 타입으로 GraphQL과 HTTP를 구분합니다. GraphQL에서는 req?.user를 사용하고, HTTP 폴백은 제거되었습니다. 테스트 mock과 회귀 테스트가 새 동작을 검증합니다.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • CaQuick/caquick-be#161: 같은 store-review 입력, 저장소, 서비스, GraphQL 스키마, 테스트 경로를 직접 확장합니다.
  • CaQuick/caquick-be#168: 리뷰 조회의 photo-only 필터 로직과 저장소/서비스 테스트 범위가 직접 겹칩니다.
  • CaQuick/caquick-be#96: 이번 PR의 GraphQL SDL과 DTO 필드 추가는 해당 PR의 SDL↔DTO 동기화 범위와 직접 연결됩니다.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed 제목이 변경 내용의 두 가지 주요 측면(비로그인 500 수정과 storeReviews 사진후기 필터)을 모두 포함하며 실제 PR 변경과 정확히 일치합니다.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch develop

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

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

🧹 knip — dead-code 리포트

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

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

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

🩺 NestJS Doctor — 89/100 (Good)

진단 270건 (error 0).

Category error warning info
architecture 0 0 13
correctness 0 118 0
performance 0 24 16
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 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 97.68% 4302/4404
🟢 Branches 93.69% 1366/1458
🟢 Functions 95.62% 830/868
🟢 Lines 98.1% 3920/3996

Test suite run success

1467 tests passing in 173 suites.

Report generated by 🧪jest coverage report action from fd23698

@chanwoo7
chanwoo7 merged commit 0396e41 into main Aug 5, 2026
15 checks passed
@chanwoo7
chanwoo7 deleted the develop branch August 5, 2026 13:57
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