feat: capture pastor name and phone from OrariMesse.it detail endpoint

Populate church.pastorName from detail.parroco and church.phone from
detail.telefono during Pass 2 schedule import. Only updates when fields
are present and non-empty.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Albert
2026-05-26 22:43:04 -04:00
parent 9d0af3289a
commit 027ca59a01

View File

@@ -491,10 +491,14 @@ async function processSchedulesForDiocese(
})),
});
// Mark church as scraped
// Update church metadata from detail (pastor, phone) if available
const churchUpdateData: Record<string, unknown> = { lastScrapedAt: new Date() };
if (detail.parroco) churchUpdateData.pastorName = detail.parroco;
if (detail.telefono) churchUpdateData.phone = detail.telefono;
await tx.church.update({
where: { id: dbId },
data: { lastScrapedAt: new Date() },
data: churchUpdateData,
});
});