feat: Adresse & Telefon in LeadVault Tabelle + Side Panel

- Lead-Modell: address Feld hinzugefügt (Migration)
- Maps-Sync: address + phone aus source JSON extrahiert
- LeadVault Tabelle: Telefon/Adresse als kombinierte Spalte
- LeadVault Side Panel: Adresse mit Pin-Icon
- Telefonnummer ist klickbar (tel: Link)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Timo Uttenweiler
2026-03-20 17:49:29 +01:00
parent 8dc135a8f7
commit fa177a982f
5 changed files with 45 additions and 11 deletions

View File

@@ -152,16 +152,21 @@ async function runMapsEnrich(
// Sync to LeadVault
const finalResults = await prisma.leadResult.findMany({ where: { jobId } });
await sinkLeadsToVault(
finalResults.map(r => ({
domain: r.domain,
companyName: r.companyName,
contactName: r.contactName,
contactTitle: r.contactTitle,
email: r.email,
linkedinUrl: r.linkedinUrl,
emailConfidence: r.confidence,
phone: (() => { try { return JSON.parse(r.source || "{}").phone ?? null; } catch { return null; } })(),
})),
finalResults.map(r => {
let src: { phone?: string; address?: string } = {};
try { src = JSON.parse(r.source || "{}"); } catch { /* ignore */ }
return {
domain: r.domain,
companyName: r.companyName,
contactName: r.contactName,
contactTitle: r.contactTitle,
email: r.email,
linkedinUrl: r.linkedinUrl,
emailConfidence: r.confidence,
phone: src.phone || null,
address: src.address || null,
};
}),
"maps",
params.queries.join(", "),
jobId,