Verbessere Geschlechtsnormalisierung: Füge Unterstützung für englische Begriffe hinzu und verbessere die Zuordnung von Geschlechtsdaten im Importprozess.
All checks were successful
Code Analysis and Production Deploy / analyze (push) Successful in 4m25s
Code Analysis and Production Deploy / deploy-production (push) Has been skipped
Code Analysis and Production Deploy / deploy-test (push) Successful in 2m33s

This commit is contained in:
Torsten Schulz (local)
2026-09-04 23:12:06 +02:00
parent eb75f86d45
commit 5ca4253b44
2 changed files with 4 additions and 4 deletions

View File

@@ -61,8 +61,8 @@ function toNumberOrNull(value) {
function normalizeGender(value) {
const normalized = String(value || '').trim().toLowerCase()
if (normalized === 'm' || normalized === 'männlich') return 'männlich'
if (normalized === 'w' || normalized === 'weiblich') return 'weiblich'
if (['m', 'männlich', 'maennlich', 'male', 'man'].includes(normalized)) return 'männlich'
if (['w', 'weiblich', 'female', 'woman', 'f'].includes(normalized)) return 'weiblich'
return normalized || null
}
@@ -228,7 +228,7 @@ async function importAuthenticatedTtrValues(connection) {
return ({
rank: toNumberOrNull(entry.rank ?? entry.ranking ?? index + 1),
playerNumber: toNumberOrNull(entry.playernr ?? entry.player_number ?? entry.nuid),
gender: normalizeGender(entry.gender),
gender: normalizeGender(entry.gender ?? entry.sex ?? entry.genderCode ?? entry.gender_code),
playerName: `${entry.firstname ?? entry.first_name ?? ''} ${entry.lastname ?? entry.last_name ?? ''}`.trim() || entry.name || null,
clubName: entry.clubname ?? entry.club_name ?? 'Harheimer TC',
currentQttr: toNumberOrNull(qttrEntry?.fedRank ?? qttrEntry?.qttr ?? entry.qttr),