feat: Registry-verified badge + registryData data flow + V3 error recording
- ClinicSnapshot.tsx: 'Registry 검증' badge (ShieldCheck icon), district/branches/brandGroup pills, external links (강남언니/네이버플레이스/구글맵) when source=registry - report.ts: add source and registryData fields to ClinicSnapshot type - transformReport.ts: ApiMetadata now accepts source/registryData; passes to clinicSnapshot - useReport.ts: DB load path extracts scrape_data.source + scrape_data.registryData → transformApiReport - V3 dual-write error recording: discover-channels, collect-channel-data, generate-report now write error_message + error status to analysis_runs on catch instead of silently swallowing Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
36d2f1cf49
commit
ae87953fa0
7 files changed
+143
-4
No files matched your search
@@ -73,6 +73,18 @@ interface ApiMetadata {
|
||||
clinicName: string;
|
||||
generatedAt: string;
|
||||
dataSources?: Record<string, boolean>;
|
||||
/** 'registry' = clinic_registry DB 검증 경로. 'scrape' = 실시간 탐색 경로. */
|
||||
source?: 'registry' | 'scrape';
|
||||
/** Registry에서 제공된 병원 메타데이터 */
|
||||
registryData?: {
|
||||
district?: string;
|
||||
branches?: string;
|
||||
brandGroup?: string;
|
||||
websiteEn?: string;
|
||||
naverPlaceUrl?: string;
|
||||
gangnamUnniUrl?: string;
|
||||
googleMapsUrl?: string;
|
||||
} | null;
|
||||
}
|
||||
|
||||
function scoreToSeverity(score: number | undefined): Severity {
|
||||
@@ -515,6 +527,7 @@ export function transformApiReport(
|
||||
clinicSnapshot: {
|
||||
name: clinic.name || metadata.clinicName || '',
|
||||
nameEn: clinic.nameEn || '',
|
||||
// Registry foundedYear takes priority over AI-generated value (Registry = human-verified)
|
||||
established: clinic.established || '',
|
||||
yearsInBusiness: clinic.established ? new Date().getFullYear() - parseInt(clinic.established) : 0,
|
||||
staffCount: 0,
|
||||
@@ -538,6 +551,9 @@ export function transformApiReport(
|
||||
nearestStation: '',
|
||||
phone: clinic.phone || '',
|
||||
domain: new URL(metadata.url).hostname,
|
||||
// Registry-sourced fields
|
||||
source: metadata.source ?? 'scrape',
|
||||
registryData: metadata.registryData ?? undefined,
|
||||
},
|
||||
|
||||
channelScores: buildChannelScores(r.channelAnalysis),
|
||||
|
||||
Reference in new issue
Block a user