Update finance session follow-ups

This commit is contained in:
2026-06-01 15:35:23 +02:00
parent 715977beda
commit 6470cb8751
20 changed files with 528 additions and 50 deletions
@@ -96,6 +96,7 @@ public sealed class SettingsPageService : ISettingsPageService
var existing = await db.ExportSettings.FirstOrDefaultAsync();
if (existing is null)
{
settings.ExchangeRateDateField = NormalizeExchangeRateDateField(settings.ExchangeRateDateField);
db.ExportSettings.Add(settings);
}
else
@@ -107,6 +108,7 @@ public sealed class SettingsPageService : ISettingsPageService
existing.DebugLoggingEnabled = settings.DebugLoggingEnabled;
existing.LocalSiteExportFolder = settings.LocalSiteExportFolder;
existing.LocalConsolidatedExportFolder = settings.LocalConsolidatedExportFolder;
existing.ExchangeRateDateField = NormalizeExchangeRateDateField(settings.ExchangeRateDateField);
}
await db.SaveChangesAsync();
@@ -281,6 +283,18 @@ public sealed class SettingsPageService : ISettingsPageService
public static string NormalizeConfigValue(string? value) => value?.Trim() ?? string.Empty;
public static string NormalizeExchangeRateDateField(string? value)
{
var normalized = NormalizeConfigValue(value);
return normalized switch
{
ExchangeRateDateFields.PostingDate => ExchangeRateDateFields.PostingDate,
ExchangeRateDateFields.InvoiceDate => ExchangeRateDateFields.InvoiceDate,
ExchangeRateDateFields.ExtractionDate => ExchangeRateDateFields.ExtractionDate,
_ => ExchangeRateDateFields.PostingDate
};
}
public static string BuildSharePointTestPreview(string tenantId, string clientId, string clientSecret, string siteUrl)
{
var maskedSecret = string.IsNullOrEmpty(clientSecret)