Skip to content

feat(store): 구매자 매장 상세 조회(storeDetail)와 StoreImage 스키마 추가#157

Merged
chanwoo7 merged 2 commits into
developfrom
feat/store-detail-header
Jun 23, 2026
Merged

feat(store): 구매자 매장 상세 조회(storeDetail)와 StoreImage 스키마 추가#157
chanwoo7 merged 2 commits into
developfrom
feat/store-detail-header

Conversation

@chanwoo7

Copy link
Copy Markdown
Member

Summary

구매자(유저)용 매장 상세 조회 API storeDetail 를 신설한다. 인기 매장 리스트에서 매장 클릭 후 진입하는 상세 화면의 헤더 영역(매장 정보·평점·찜·전화·지도·영업/휴무/안내)을 담당한다. 구매자 측 매장/상품 조회 API 공백을 채우는 store-detail 도메인 작업의 1단계(스키마 + 매장 헤더).

Scope

  • 신규 Query storeDetail(storeId: ID!): StoreDetail!
    • 매장명 · 지역표기 · 평균평점(소수 첫째) · 리뷰수 · 찜여부, 대표 이미지(캐러셀), 전화번호 · 전체주소 · 좌표 · 지도 provider, 영업시간 / 정기휴무 / 찾아오는 길 안내, 웹사이트 URL
    • OptionalJwtAuthGuard: 비로그인 조회 가능, 로그인 시에만 isWishlisted 채움
    • 없거나 비활성/삭제 매장은 NOT_FOUND
  • 스키마 변경
    • StoreImage 테이블 신설(ProductImage 동형, 매장당 다중 이미지)
    • Store.access_guide_text(찾아오는 길) · Store.regular_closure_text(정기 휴무 표기) 컬럼 추가
    • 둘 다 nullable / 신규 테이블 → 기존 데이터 무중단. 마이그레이션 포함
  • 평점·리뷰수는 기존 aggregateReviewStats, 찜 여부는 기존 findWishlistedStoreIds 재사용. buildRegionLabel은 단건 조회에도 쓰도록 파라미터 타입만 구조화
  • 시드(stores.ts) · 스토어 팩토리 보강

진행 상황

  • store-detail 도메인 전체 계획 중 PR 1/3
  • 다음 단계: ② 매장 상품 탭(상품 목록 · 카테고리 사이드바 · 매장 내 검색), ③ 매장 후기 탭(공개 리뷰 · 좋아요 집계)
  • 매장 이미지 · 안내문 · 휴무 텍스트의 seller 입력 API는 차기 작업(이번은 구매자 조회 + 시드로 검증)

Impact

  • 신규 조회 API 추가. 기존 동작/계약 변경 없음
  • 마이그레이션: nullable 컬럼 2개 + 신규 테이블(FK) → 기존 행 무중단 적용
  • Prisma Client 재생성 필요(자동)

Test plan

  • 단위(mapper, 8 케이스): id 문자열 변환 · 이미지 url 배열 · 좌표 Decimal→number/null · 평점 소수 첫째 반올림 · regionLabel 3분기 · isWishlisted 반영
  • 통합(service, real DB): NOT_FOUND(없음/비활성) · BadRequest(잘못된 id) · 이미지 sort_order 정렬 및 soft-delete 제외 · 평점/리뷰수 집계 · 로그인/비로그인 찜 여부
  • 통합(resolver, real DB): 서비스 위임 · JwtUser 찜 채움 · NOT_FOUND 전파
  • yarn validate 전체 통과: 162 suites / 1362 tests, lint·tsc·dto:check·arch:check 통과, 커버리지 임계 충족

- storeDetail 쿼리 신설: 매장 헤더(이미지·평점·리뷰수·찜)·전화·주소·좌표·영업/휴무/안내문 노출. OptionalJwtAuthGuard로 비로그인 조회 + 로그인 시 isWishlisted
- StoreImage 테이블 + Store.access_guide_text·regular_closure_text 컬럼 추가 (구매자 조회용, seller 입력 API는 차기)
- 시드/스토어 팩토리 보강, 단위(mapper)·통합(service/resolver) 테스트 18건
@coderabbitai

coderabbitai Bot commented Jun 23, 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

Run ID: f035f4d3-9a3a-487d-b716-2a0e8c190f66

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/store-detail-header

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

🩺 NestJS Doctor — 89/100 (Good)

진단 256건 (error 0).

Category error warning info
architecture 0 0 13
correctness 0 106 0
performance 0 24 16
schema 0 0 84
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

@github-actions

Copy link
Copy Markdown

🧹 knip — dead-code 리포트

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

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

@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 78992f8859

ℹ️ 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".

Comment thread prisma/seed/stores.ts
Comment on lines +59 to +60
store_images: {
create: [

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Delete seeded store images before deleting stores

When yarn prisma:seed is run a second time, these newly-created store_image rows remain during resetSeedScope: that cleanup deletes storeBusinessHour and storeSpecialClosure and then calls prisma.store.deleteMany for the seed stores, but it never deletes storeImage rows. Because the new FK is ON DELETE RESTRICT, the second seed run will fail with a foreign-key violation instead of staying idempotent; add prisma.storeImage.deleteMany({ where: { store_id: { in: storeIds } } }) before deleting stores or make the relation cascade intentionally.

Useful? React with 👍 / 👎.

@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 97.44% 3928/4031
🟢 Branches 93.21% 1221/1310
🟢 Functions 94.7% 733/774
🟢 Lines 97.85% 3588/3667

Test suite run success

1362 tests passing in 162 suites.

Report generated by 🧪jest coverage report action from 04d5fc6

store_image FK가 ON DELETE RESTRICT라 store 삭제 전 store_image를 정리하지 않으면 2회차 yarn prisma:seed가 FK 위반으로 실패한다. resetSeedScope에 storeImage.deleteMany를 추가해 멱등성을 보장한다. (Codex P2 반영)
@chanwoo7 chanwoo7 merged commit 03ab4d7 into develop Jun 23, 2026
11 checks passed
@chanwoo7 chanwoo7 deleted the feat/store-detail-header branch June 23, 2026 18:26
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