fix: 리포트 데이터 정확도 개선 + 강남언니·인스타그램 스크래핑 데이터 반영

- ClinicSnapshot: 내부 관리용 배지(Registry 검증·분점·등급) 병원 리포트에서 제거
- transformReport: Facebook 리뷰수 파싱 ("Not yet rated (3 Reviews)" 정규식 추출)
- transformReport: 네이버 플레이스 KPI 목표가 현재값보다 낮은 오류 수정 (동적 계산)
- transformReport: 네이버 블로그 방문자 "0(미운영)" → "검색 노출 N건 (방문자 비공개)"
- transformReport: 웹사이트+SNS 유입 "0%" → "측정 불가 (트래킹 미설치)"
- clinic_registry_working.csv: gangnam_unni_badges, gangnam_unni_procedures 컬럼 추가 (60개 병원)
- clinic_registry_working.csv: instagram_followers, instagram_posts 컬럼 추가 (64개 병원)
- INFINITH_Outbound_List.csv: 인스타그램 팔로워·게시물수 컬럼 추가 (64개 병원)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Haewon KamandClaude Sonnet 4.6 committed 2026-04-07 14:18:31 +09:00
1 parent 9991c672a1
commit 2d1937944a
7 files changed
+57323 -222

No files matched your search

+2 -28
View File
@@ -1,5 +1,5 @@
import { motion } from 'motion/react';
import { Calendar, Users, MapPin, Phone, Award, Star, Globe, ExternalLink, ShieldCheck, GitBranch, Building2 } from 'lucide-react';
import { Calendar, Users, MapPin, Phone, Award, Star, Globe, ExternalLink, Building2 } from 'lucide-react';
import { SectionWrapper } from './ui/SectionWrapper';
import type { ClinicSnapshot as ClinicSnapshotType } from '../../types/report';
@@ -36,33 +36,7 @@ export default function ClinicSnapshot({ data }: ClinicSnapshotProps) {
return (
<SectionWrapper id="clinic-snapshot" title="Clinic Overview" subtitle="병원 기본 정보">
{/* Registry 검증 배지 + 분점 정보 */}
{(isVerified || data.registryData?.branches || data.registryData?.brandGroup) && (
<motion.div
className="flex flex-wrap items-center gap-2 mb-5"
initial={{ opacity: 0, y: -8 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.4 }}
>
{isVerified && (
<span className="inline-flex items-center gap-1.5 rounded-full bg-emerald-50 border border-emerald-200 px-3 py-1 text-xs font-semibold text-emerald-700">
<ShieldCheck size={13} className="text-emerald-600" />
Registry 검증
</span>
)}
{data.registryData?.branches && (
<span className="inline-flex items-center gap-1.5 rounded-full bg-blue-50 border border-blue-200 px-3 py-1 text-xs font-medium text-blue-700">
<GitBranch size={12} className="text-blue-500" />
{data.registryData.branches}
</span>
)}
{data.registryData?.brandGroup && (
<span className="inline-flex items-center gap-1.5 rounded-full bg-violet-50 border border-violet-200 px-3 py-1 text-xs font-medium text-violet-700">
{data.registryData.brandGroup}
</span>
)}
</motion.div>
)}
{/* 외부 검증 배지는 내부 관리용이므로 리포트에서 제외 */}
{/* Registry 외부 링크 (강남언니, 네이버 플레이스, 구글 맵) */}
{isVerified && (data.registryData?.naverPlaceUrl || data.registryData?.gangnamUnniUrl || data.registryData?.googleMapsUrl) && (
+27 -10
View File
@@ -402,9 +402,12 @@ function buildKpiDashboard(r: ApiReport): import('../types/report').KPIMetric[]
target3Month: igFollowers > 0 ? fmt(Math.round(igFollowers * 1.4)) : '20K',
target12Month: igFollowers > 0 ? fmt(Math.round(igFollowers * 3.5)) : '50K',
});
// KR Reels: igtvVideoCount로 운영 여부 판단, 없으면 측정 불가로 표시
const krIgAny = igPrimary as Record<string, unknown> | null;
const krReels = krIgAny ? ((krIgAny.igtvVideoCount as number) ?? -1) : -1;
metrics.push({
metric: 'Instagram KR Reels 평균 조회수',
current: '0 (미운영)',
current: krReels > 0 ? `${krReels}개 운영 중 (조회수 측정 불가)` : krReels === 0 ? '0 (미운영)' : '측정 불가',
target3Month: '3,000',
target12Month: '10,000',
});
@@ -419,11 +422,16 @@ function buildKpiDashboard(r: ApiReport): import('../types/report').KPIMetric[]
}
}
// Naver Blog
// Naver Blog — 방문자수는 블로그 소유자만 확인 가능 (비공개), 측정 불가로 표시
if (channels.naverBlog) {
const blogStatus = r.channelAnalysis?.naverBlog?.status;
const blogPosts = r.channelAnalysis?.naverBlog?.posts;
const blogCurrent = blogStatus === 'active' && blogPosts
? `검색 노출 ${fmt(blogPosts)}건 (방문자 비공개)`
: '측정 불가';
metrics.push({
metric: '네이버 블로그 방문자',
current: '0 (미운영)',
current: blogCurrent,
target3Month: '5,000/월',
target12Month: '30,000/월',
});
@@ -452,20 +460,25 @@ function buildKpiDashboard(r: ApiReport): import('../types/report').KPIMetric[]
}
}
// Google Maps
// 네이버 플레이스 평점 — 목표가 현재보다 낮으면 유지/개선으로 동적 설정
if (channels.naverPlace) {
const npRating = channels.naverPlace.rating ?? 0;
const npCurrent = npRating ? `${npRating}/5` : '-';
const np3mo = npRating >= 4.8 ? `${npRating}/5 유지` : '4.8/5';
const np12mo = npRating >= 4.9 ? '5.0/5' : '4.9/5';
metrics.push({
metric: '네이버 플레이스 평점',
current: channels.naverPlace.rating ? `${channels.naverPlace.rating}/5` : '-',
target3Month: '4.5/5',
target12Month: '4.8/5',
current: npCurrent,
target3Month: np3mo,
target12Month: np12mo,
});
}
// Cross-platform
// Cross-platform — 트래킹 픽셀 미설치 시 측정 불가
const hasTracking = r.channelAnalysis?.website?.trackingPixels && (r.channelAnalysis.website.trackingPixels as unknown[]).length > 0;
metrics.push({
metric: '웹사이트 + SNS 유입',
current: '0%',
current: hasTracking ? '측정 중' : '측정 불가 (트래킹 미설치)',
target3Month: '5%',
target12Month: '15%',
});
@@ -1104,7 +1117,11 @@ export function mergeEnrichment(
logoDescription: '',
link: fb.website || '',
linkedDomain: fb.website || '',
reviews: 0,
reviews: (() => {
// Facebook rating 문자열 파싱: "Not yet rated (3 Reviews)" or "4.8 (120 Reviews)"
const m = (fb.rating || '').match(/\((\d+)\s+Reviews?\)/i);
return m ? parseInt(m[1], 10) : 0;
})(),
recentPostAge: '',
hasWhatsApp: false,
}],