From 7ea9972c7e6d2db80be4d976727392b31c09303b Mon Sep 17 00:00:00 2001 From: Haewon Kam Date: Thu, 2 Apr 2026 14:10:28 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20P1-4=20Brand=20Identity=20tab=20?= =?UTF-8?q?=E2=80=94=20AI-generated=20brand=20analysis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - generate-report: add brandIdentity schema to AI prompt (logo, message, tone, positioning, hashtags, channel consistency) - transformReport: map API brandIdentity array to TransformationProposal component - ApiReport type: add brandIdentity field Co-Authored-By: Claude Opus 4.6 (1M context) --- src/lib/transformReport.ts | 13 ++++++++++++- supabase/functions/generate-report/index.ts | 8 ++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/lib/transformReport.ts b/src/lib/transformReport.ts index ce7cd8e..876889c 100644 --- a/src/lib/transformReport.ts +++ b/src/lib/transformReport.ts @@ -46,6 +46,11 @@ interface ApiReport { description?: string; expectedImpact?: string; }[]; + brandIdentity?: { + area?: string; + asIs?: string; + toBe?: string; + }[]; marketTrends?: string[]; } @@ -256,7 +261,13 @@ export function transformApiReport( problemDiagnosis: buildDiagnosis(r), transformation: { - brandIdentity: [], + brandIdentity: (r.brandIdentity || []) + .filter((item): item is { area?: string; asIs?: string; toBe?: string } => !!item?.area) + .map(item => ({ + area: item.area || '', + asIs: item.asIs || '', + toBe: item.toBe || '', + })), contentStrategy: (r.recommendations || []) .filter(rec => rec.category?.includes('콘텐츠') || rec.category?.includes('content')) .map(rec => ({ diff --git a/supabase/functions/generate-report/index.ts b/supabase/functions/generate-report/index.ts index 470530c..f07caf6 100644 --- a/supabase/functions/generate-report/index.ts +++ b/supabase/functions/generate-report/index.ts @@ -115,6 +115,14 @@ ${JSON.stringify(analyzeResult.data?.analysis || {}, null, 2)} "primary": { "ageRange": "25-35", "gender": "female", "interests": ["관심사1"], "channels": ["채널1"] }, "secondary": { "ageRange": "35-45", "gender": "female", "interests": ["관심사1"], "channels": ["채널1"] } }, + "brandIdentity": [ + { "area": "로고 및 비주얼", "asIs": "현재 로고/비주얼 아이덴티티 상태", "toBe": "개선 방향" }, + { "area": "브랜드 메시지/슬로건", "asIs": "현재 메시지", "toBe": "제안 메시지" }, + { "area": "톤앤보이스", "asIs": "현재 커뮤니케이션 스타일", "toBe": "권장 스타일" }, + { "area": "채널 일관성", "asIs": "채널별 불일치 사항", "toBe": "통일 방안" }, + { "area": "해시태그/키워드", "asIs": "현재 해시태그 전략", "toBe": "최적화된 해시태그 세트" }, + { "area": "포지셔닝", "asIs": "현재 시장 포지셔닝", "toBe": "목표 포지셔닝" } + ], "recommendations": [ { "priority": "high|medium|low", "category": "카테고리", "title": "제목", "description": "설명", "expectedImpact": "기대 효과" } ],