From 15d1a262517ee9634f5688363aa564fe73fabd85 Mon Sep 17 00:00:00 2001 From: Elias Fierke Date: Mon, 27 Jul 2026 13:30:46 +0200 Subject: [PATCH] [chore:] initial address repair (fixes german plzs if too short) --- Tasks/AddressRepair.cs | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/Tasks/AddressRepair.cs b/Tasks/AddressRepair.cs index e201ede..954c9f6 100644 --- a/Tasks/AddressRepair.cs +++ b/Tasks/AddressRepair.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Threading.Tasks; namespace Logof_Client; @@ -7,20 +8,28 @@ public class AddressRepair(ProgressWindow progressWindow) { private readonly ProgressWindow _progress = progressWindow; - public KasAddressList Perform(KasAddressList all_addresses, - List<(int, List)> failed_addresses) + public async Task Perform(KasAddressList list) { try { - + foreach (var person in list.KasPersons) + { + + // German PLZ too short (e.g. Dresden) + if (person.IsGermany() && person.plz.Length <= 4) + { + while (person.plz.Length <= 4) + { + person.plz = "0" + person.plz; + } + } + + } } catch (Exception ex) { - Logger.Log($"Error while performing address repair: {ex.Message}", Logger.LogType.Error); + Logger.Log($"Error while performing address shortener: {ex.Message}", Logger.LogType.Error); } - - return null; - - return null; + } } \ No newline at end of file