Skip to content

feat: 관리자 배너에 링크 대상 노출 가능 여부(linkTargetAvailable) 추가 - #489

Merged
chanwoo7 merged 1 commit into
developfrom
feat/admin-banner-link-target
Oct 4, 2026
Merged

chanwoo7 merged 1 commit into
developfrom
feat/admin-banner-link-target

Conversation

@chanwoo7

@chanwoo7 chanwoo7 commented Oct 4, 2026

Copy link
Copy Markdown
Member

배경

  • 이슈 chore(deps): bump openid-client from 5.7.1 to 6.8.3 #55(관리자 FE)의 BE 몫입니다. 노출 중인 배너의 링크 대상(상품·매장·카테고리)이 나중에 숨겨지면, 구매자 앱은 그 배너를 건너뛰고 다음 배너를 보여 줍니다.
  • 관리자 배너 조회가 링크 대상 상태를 주지 않아, 관리자 목록은 건너뛰어진 배너에 '현재 노출'을 붙였습니다.

변경

  • AdminBanner에 linkTargetAvailable: Boolean!을 추가했습니다.
    • 기준은 구매자 앱과 같습니다. 링크 없음·URL은 항상 true이고, 상품(소속 매장 포함)·매장·카테고리는 활성이고 삭제되지 않았을 때 true입니다.
    • 목록·단건·생성·수정 응답 모두 같은 경로로 판정합니다.
  • 구매자 배너 선택(findFirstBanner)의 링크 대상 조건을 banner-link-target.helper.ts의 조각 하나로 옮기고, 관리자 판정도 그 조각으로 거릅니다(규칙을 TS로 다시 쓰지 않아 둘이 어긋나지 않음).
  • SDL 필드 추가만이라 구매자 FE에는 영향이 없습니다.

테스트

  • 링크 종류·대상 상태 13가지 표(it.each)를 추가했습니다. 각 행에서 목록 값, 단건 값, 구매자 홈 배너 노출 여부가 서로 일치하는지 봅니다.
  • 대상이 숨겨진 최우선 배너를 구매자 조회가 건너뛰고 다음 배너를 고를 때, 관리자 값이 각각 false·true인지 확인했습니다.
  • 생성·수정 응답에서도 값이 맞는지 확인했습니다.
  • 판정을 항상 true로 바꾸면 false 행 8건과 건너뛰기·생성/수정 케이스가 실패하는 것을 확인했습니다.

플랜 대조

플랜 6번 BE 불릿 상태
linkTargetAvailable: Boolean! 추가 한 것
구매자 조회와 같은 조건 조각 공유 한 것
회귀: 링크 종류별 표 + 구매자 조회 결과 일치 한 것

관리자 배너 목록이 링크 대상(상품·매장·카테고리)이 나중에 숨겨지거나 삭제된 배너도 "현재 노출"로 표시했다.
구매자 조회(findFirstBanner)는 그런 배너를 건너뛰고 다음 배너를 내보내는데, 관리자 응답에는 그 판단 근거가 없었다.

- 링크 대상 조건을 bannerLinkTargetVisibleWhere 조각 하나로 추출(repositories/banner-link-target.helper.ts)
  - findFirstBanner와 관리자 판정이 같은 조각을 써서 규칙이 어긋날 수 없게 함
- AdminBanner.linkTargetAvailable: Boolean! 추가
  - 목록·단건·생성·수정 응답 모두 같은 경로(toOutputs)로 계산
  - 로드한 배너 id로 banner.findMany(id in + 조각) 1회, TS로 규칙을 다시 쓰지 않음
- CATEGORY 지면의 EVENT 조건은 지면 조건이라 조각 밖에 둠(카테고리 타입은 수정 불가, 저장 시점 검증이 막음)

회귀 테스트(product-admin-banner.service.spec)
- 링크 타입 전수 표 13건: NONE·URL, 상품(노출/비활성/삭제/매장 비활성/매장 삭제), 매장·카테고리(노출/비활성/삭제)
  - 목록·단건 값과 구매자 findHomeBanner 노출 여부가 함께 일치하는지 단언
- 숨겨진 상위 배너는 구매자 조회가 건너뛰고 관리자 목록에 false로 드러남
- 생성 true → 대상 숨김 뒤 단건 false → 링크 변경 수정 응답 true
- 반증: 매퍼에서 값을 true로 고정하면 false 케이스 10건 실패
@coderabbitai

coderabbitai Bot commented Oct 4, 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: 1689eb71-656a-41e3-8042-63786b6baec9

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
  • Autopilot · 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.

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

🩺 NestJS Doctor — 90/100 (Excellent)

진단 470건 (error 12).

Category error warning info
architecture 1 1 42
correctness 0 261 0
performance 0 30 28
schema 0 0 75
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

github-actions Bot commented Oct 4, 2026

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

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

Coverage report

St.❔
Category Percentage Covered / Total
🟢 Statements 97.91% 10058/10273
🟢 Branches 92.41% 3787/4098
🟢 Functions 97.4% 2026/2080
🟢 Lines 98.5% 9149/9288

Test suite run success

3742 tests passing in 355 suites.

Report generated by 🧪jest coverage report action from 891d758

@chanwoo7
chanwoo7 merged commit 251a957 into develop Oct 4, 2026
12 checks passed
@chanwoo7
chanwoo7 deleted the feat/admin-banner-link-target branch October 4, 2026 15:56
@codecov

codecov Bot commented Oct 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 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