documents

This commit is contained in:
Simon Pocrnjič
2025-10-12 12:24:17 +02:00
parent 3ab1c05fcc
commit e0303ece74
22 changed files with 898 additions and 88 deletions
+5 -3
View File
@@ -2365,13 +2365,15 @@ private function upsertAddress(int $personId, array $addrData, $mappings): array
if (! $field) {
continue;
}
$val = $addrData[$field] ?? null;
// Allow alias 'postal_code' in CSV mappings but persist as 'post_code' in DB
$targetField = $field === 'postal_code' ? 'post_code' : $field;
$val = $addrData[$field] ?? $addrData[$targetField] ?? null;
$mode = $map->apply_mode ?? 'both';
if (in_array($mode, ['insert', 'both'])) {
$applyInsert[$field] = $val;
$applyInsert[$targetField] = $val;
}
if (in_array($mode, ['update', 'both'])) {
$applyUpdate[$field] = $val;
$applyUpdate[$targetField] = $val;
}
}
if ($existing) {