Skip to content

feat: 매장 목록 정렬 공용화 · searchStores 정렬 추가 - #531

Merged
chanwoo7 merged 1 commit into
developfrom
feat/store-search-sort
Oct 15, 2026
Merged

chanwoo7 merged 1 commit into
developfrom
feat/store-search-sort

Conversation

@chanwoo7

Copy link
Copy Markdown
Member

요약

  • 검색 결과 매장 탭 시안에는 "추천순 ▾" 정렬 시트(등록순·인기순·판매순)가 있는데, searchStores는 인기순 고정이었습니다.
  • 메인 검색 결과(매장 선택) 화면도 같은 정렬을 쓰므로, 정렬을 store 공용으로 두고 searchStores에 먼저 붙입니다. 매장 선택 화면 API(pickupStores)는 후속 PR에서 이 정렬을 재사용합니다.
  • 변경점
    • SDL: enum StoreSort { POPULAR, LATEST, BEST_SELLING }를 추가하고, SearchStoresInput.sort(기본 POPULAR)를 추가했습니다.
      • "추천순" 라벨은 상품 검색과 같이 POPULAR로 해석합니다.
      • 선택 입력이라 기존 호출은 그대로 인기순입니다.
    • StoreListingService.sortStores
      • 인기순: 기존 산식(scoreStores)
      • 판매순: 최근 30일 유효 주문 수량 합(상품 검색 판매순과 같은 정의). 판매 0건도 뒤에 남깁니다.
      • 등록순: created_at 내림차순
      • 동률은 id 내림차순으로 고정합니다(인기순은 기존대로 리뷰 수가 먼저).
    • 인기순만 점수에 쓴 리뷰 통계를 카드로 넘기고, 나머지는 buildCards 기본 집계에 맡깁니다.
    • StoreRepository: 후보 select를 상수 1벌로 합치고 created_at을 추가했습니다.

테스트

  • store-listing.service.spec: 등록순 동률, 판매순(30일 밖 판매 제외·판매 0건 유지·동률), 인기순 통계 반환, 등록순·판매순 통계 미반환 4건
  • store-search.service.spec: sort 지정과 정렬 뒤 페이지 자르기, 생략·null이면 인기순 2건
  • store-search-query.resolver.spec: sort 전달 1건
  • 반증: 등록순·판매순 비교 방향을 뒤집으면 3건이 실패합니다.
  • pre-push 전체 jest 384 suites / 4270 tests 통과

플랜 대조

플랜 PR 1 불릿 상태
enum StoreSort 추가(store 공용) 한 것
SearchStoresInput.sort: StoreSort = POPULAR 한 것
searchStores·items 설명의 "인기순 고정" 문구 교체 한 것
DTO에 sort 검증 한 것: 상품 검색 DTO와 같이 @IsIn(STORE_SORTS)
StoreListingService.sortStores(인기·판매·등록, 동률 id desc) 한 것
searchStores 인기순 고정 경로를 sortStores로 교체 한 것
인기순이 아니면 카드 통계를 기본 집계에 맡김 한 것
StoreCandidateRow에 created_at 추가 한 것
listing·search service spec, resolver spec 1케이스 한 것

검색 결과 매장 탭 시안에 '추천순 ▾' 정렬 시트(등록순·인기순·판매순)가 있는데 searchStores는 인기순 고정이었음. 메인 검색 결과(매장 선택) 화면도 같은 정렬을 쓰므로 정렬을 store 공용으로 둠.

- SDL: enum StoreSort { POPULAR, LATEST, BEST_SELLING } 추가, SearchStoresInput.sort(기본 POPULAR) 추가. '추천순' 라벨은 상품 검색과 같이 POPULAR로 해석
- StoreListingService.sortStores: 인기순은 기존 산식(scoreStores), 판매순은 최근 30일 유효 주문 수량 합(상품 검색 판매순과 같은 정의, 판매 0건도 뒤에 남김), 등록순은 created_at desc. 동률은 id desc
- 인기순만 카드 통계를 넘기고, 나머지는 buildCards 기본 집계에 맡김
- StoreRepository: 후보 select를 상수 1벌로 합치고 created_at 추가

테스트
- store-listing.service.spec: 정렬 3종·동률·30일 밖 판매 제외·통계 유무 4건
- store-search.service.spec: sort 지정·정렬 뒤 페이지 자르기, 생략·null이면 인기순 2건
- store-search-query.resolver.spec: sort 전달 1건
- 반증: 등록순·판매순 비교 방향을 뒤집으면 3건 실패
@coderabbitai

coderabbitai Bot commented Oct 15, 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: Repository: CaQuick/caquick-be/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 16b927cf-811a-4735-96bf-95834e416596

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
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T09:01:28.704988Z 74298dc PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown

🧹 knip — dead-code 리포트

Unused exported types (1)
전체 리포트
Unused exported types (1)
RateLimitPolicy  type  src/global/rate-limit/index.ts:4:8

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

@github-actions

Copy link
Copy Markdown

🩺 NestJS Doctor — 90/100 (Excellent)

진단 485건 (error 12).

Category error warning info
architecture 1 1 44
correctness 0 267 0
performance 0 36 28
schema 0 0 76
security 11 21 0
architecture / security 상위 항목
  • error architecture/architecture/no-manual-instantiation: Manual instantiation of 'OutboxRepository' detected. Use dependency injection instead.
  • 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.
  • warning security/security/require-guards-on-endpoints: Endpoint 'adminLogin' has no @UseGuards() at class or method level.
  • warning security/security/require-guards-on-endpoints: Endpoint 'adminRefresh' has no @UseGuards() at class or method level.
  • warning security/security/require-guards-on-endpoints: Endpoint 'adminLogout' has no @UseGuards() at class or method level.
  • warning security/security/require-guards-on-endpoints: Endpoint 'getJwks' has no @UseGuards() at class or method level.

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

@github-actions

Copy link
Copy Markdown

Coverage report

St.❔
Category Percentage Covered / Total
🟢 Statements
98% (+0% 🔼)
10709/10927
🟢 Branches
92.9% (-0.02% 🔻)
4085/4397
🟢 Functions
97.54% (+0.01% 🔼)
2138/2192
🟢 Lines
98.58% (+0.01% 🔼)
9745/9885
Show new covered files 🐣
St.❔
File Statements Branches Functions Lines
🟢
... / store-sort.constants.ts
100% 100% 100% 100%
Show files with reduced coverage 🔻
St.❔
File Statements Branches Functions Lines
🟢
... / store-listing.service.ts
98.31% (-1.69% 🔻)
88% (-12% 🔻)
100% 100%

Test suite run success

4269 tests passing in 384 suites.

Report generated by 🧪jest coverage report action from 74298dc

@chanwoo7
chanwoo7 merged commit 0c30e57 into develop Oct 15, 2026
17 checks passed
@chanwoo7
chanwoo7 deleted the feat/store-search-sort branch October 15, 2026 09:04
@codecov

codecov Bot commented Oct 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.36364% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...c/features/store/services/store-listing.service.ts 78.57% 0 Missing and 3 partials ⚠️

📢 Thoughts on this report? Let us know!

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