feat: add buscarmisasNetworkId (and discovermassId) to church-matcher interfaces and ID-match passes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -28,6 +28,7 @@ export interface ExistingChurch {
|
|||||||
kerknetId: string | null;
|
kerknetId: string | null;
|
||||||
gottesdienstzeitenId: string | null;
|
gottesdienstzeitenId: string | null;
|
||||||
discovermassId: string | null;
|
discovermassId: string | null;
|
||||||
|
buscarmisasNetworkId: string | null;
|
||||||
source: string;
|
source: string;
|
||||||
website: string | null;
|
website: string | null;
|
||||||
phone: string | null;
|
phone: string | null;
|
||||||
@@ -138,6 +139,7 @@ export type ChurchCandidate = {
|
|||||||
kerknetId?: string;
|
kerknetId?: string;
|
||||||
gottesdienstzeitenId?: string;
|
gottesdienstzeitenId?: string;
|
||||||
discovermassId?: string;
|
discovermassId?: string;
|
||||||
|
buscarmisasNetworkId?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -147,8 +149,8 @@ export type ChurchCandidate = {
|
|||||||
* Matching strategy (in priority order):
|
* Matching strategy (in priority order):
|
||||||
* 1. Exact osmId match
|
* 1. Exact osmId match
|
||||||
* 2. Exact baiduId match
|
* 2. Exact baiduId match
|
||||||
* 3-14. Exact importer ID matches (orarimesse, massSchedulesPh, philmass, horariosMisas, mszeInfo, weekdayMasses, messesInfo, bohosluzby, miserend, kerknet, gottesdienstzeiten, discovermass)
|
* 3-9. Exact importer ID matches (orarimesse, massSchedulesPh, philmass, horariosMisas, mszeInfo, weekdayMasses, messesInfo)
|
||||||
* 15. Proximity + name similarity (within 200m + similar name)
|
* 10. Proximity + name similarity (within 200m + similar name)
|
||||||
*/
|
*/
|
||||||
export function findDuplicateChurch(
|
export function findDuplicateChurch(
|
||||||
candidate: ChurchCandidate,
|
candidate: ChurchCandidate,
|
||||||
@@ -260,11 +262,21 @@ export function findDuplicateChurch(
|
|||||||
|
|
||||||
// Fourteenth pass: exact discovermassId match
|
// Fourteenth pass: exact discovermassId match
|
||||||
if (candidate.discovermassId) {
|
if (candidate.discovermassId) {
|
||||||
const match = existingChurches.find(c => c.discovermassId === candidate.discovermassId);
|
const match = existingChurches.find(
|
||||||
|
(church) => church.discovermassId === candidate.discovermassId
|
||||||
|
);
|
||||||
if (match) return match;
|
if (match) return match;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fifteenth pass: proximity + name match (skip if candidate has no real coordinates)
|
// Fifteenth pass: exact buscarmisasNetworkId match
|
||||||
|
if (candidate.buscarmisasNetworkId) {
|
||||||
|
const match = existingChurches.find(
|
||||||
|
(church) => church.buscarmisasNetworkId === candidate.buscarmisasNetworkId
|
||||||
|
);
|
||||||
|
if (match) return match;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sixteenth pass: proximity + name match (skip if candidate has no real coordinates)
|
||||||
if (candidate.lat === 0 && candidate.lng === 0) {
|
if (candidate.lat === 0 && candidate.lng === 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user