[chore:] initial address repair (fixes german plzs if too short)

This commit is contained in:
2026-07-27 13:30:46 +02:00
parent 05caa559b4
commit 15d1a26251
+15 -6
View File
@@ -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<AddressCheck.ErrorTypes>)> 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;
}
}