[Feature/#220] 플랫폼별 광고 현황 상세 API 연동 - #221
Merged
Merged
Conversation
📝 WalkthroughWalkthrough플랫폼 대시보드의 광고 현황 상세 테이블을 mock 데이터 기반에서 실제 API 기반으로 전환했습니다. 새로운 타입 정의와 메트릭 팩트 API 함수, 데이터 변환 훅을 추가하고, 기존 테이블 컴포넌트를 확장하여 API 응답 합계값을 선택적으로 받도록 수정했습니다. Changes플랫폼 대시보드 메트릭 팩트 기능
Sequence DiagramsequenceDiagram
participant SinglePlatformView
participant usePlatformMetricFacts
participant getMetricFacts
participant API as /api/dashboard/{orgId}/metric-facts
participant PlatformDetailTable
SinglePlatformView->>usePlatformMetricFacts: (provider, viewRange) 호출
usePlatformMetricFacts->>getMetricFacts: orgId, params 전달
getMetricFacts->>API: GET 요청
API-->>getMetricFacts: IMetricFactsResponse 반환
getMetricFacts-->>usePlatformMetricFacts: 응답 반환
usePlatformMetricFacts->>usePlatformMetricFacts: 날짜 포맷, 정렬, 매핑
usePlatformMetricFacts-->>SinglePlatformView: dailyRows + totalRow
SinglePlatformView->>PlatformDetailTable: data, total 전달
PlatformDetailTable-->>SinglePlatformView: 테이블 렌더링
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
📚 Storybook 배포 완료
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/hooks/dashboard/usePlatformMetricFacts.ts`:
- Around line 33-34: mapRow() and mapTotalRow() are currently assigning
IMetricFactsRow.cpa into the cpc output field, causing CPA to be shown as CPC;
update these two functions to either (A) map cpc to the actual CPC value by
computing spend / clicks (use safe divide and fallback to 0), or (B) if the API
intent is to expose CPA instead, rename the output field to cpa (and any UI
references) so the contract matches. Locate the mapping in mapRow and
mapTotalRow and replace the line "cpc: row.cpa" with the appropriate fix: "cpc:
row.spend / row.clicks" (with divide-by-zero guard) for computed CPC, or "cpa:
row.cpa" and update downstream UI props if you choose to surface CPA. Ensure
types in IMetricFactsRow and return shape are updated accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: ba2cb6b1-db87-4810-ae1c-63723a131ada
📒 Files selected for processing (6)
src/api/dashboard/platform.tssrc/components/dashboard/platform/PlatformDetailTable.tsxsrc/components/dashboard/platform/SinglePlatformView.tsxsrc/hooks/dashboard/usePlatformMetricFacts.tssrc/pages/dashboard/platform/platformDashboard.mock.tssrc/types/dashboard/platform.ts
💤 Files with no reviewable changes (1)
- src/pages/dashboard/platform/platformDashboard.mock.ts
Collaborator
|
P4: 확인했습니다! |
jjjsun
approved these changes
May 18, 2026
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚨 관련 이슈
close #220
✨ 변경사항
✏️ 작업 내용
GET /api/dashboard/{orgId}/metric-facts연동days파라미터로 재조회😅 미완성 작업
N/A
📢 논의 사항 및 참고 사항
N/A
Summary by CodeRabbit
릴리스 노트