Add audit CSV central source option

This commit is contained in:
2026-06-11 08:57:18 +02:00
parent f23fa1662e
commit dcd845d337
22 changed files with 822 additions and 89 deletions
@@ -14,6 +14,7 @@ public class SiteExportService : ISiteExportService
private readonly ISharePointUploadService _sharePointService;
private readonly IRecordTransformationService _transformationService;
private readonly ICentralSalesRecordService _centralSalesRecordService;
private readonly IExportAuditCsvService _auditCsvService;
private readonly IAppEventLogService _appEventLogService;
private readonly ILogger<SiteExportService> _logger;
@@ -24,6 +25,7 @@ public class SiteExportService : ISiteExportService
ISharePointUploadService sharePointService,
IRecordTransformationService transformationService,
ICentralSalesRecordService centralSalesRecordService,
IExportAuditCsvService auditCsvService,
IAppEventLogService appEventLogService,
ILogger<SiteExportService> logger)
{
@@ -33,6 +35,7 @@ public class SiteExportService : ISiteExportService
_sharePointService = sharePointService;
_transformationService = transformationService;
_centralSalesRecordService = centralSalesRecordService;
_auditCsvService = auditCsvService;
_appEventLogService = appEventLogService;
_logger = logger;
}
@@ -76,6 +79,15 @@ public class SiteExportService : ISiteExportService
details: $"Records vor Transformation={records.Count}");
_transformationService.Apply(records, rules);
var auditCsvPath = await _auditCsvService.WriteSiteAuditCsvAsync(
site, settings, sourceSystem, outputDir, records);
if (!string.IsNullOrWhiteSpace(auditCsvPath))
{
await _appEventLogService.WriteAsync("Export", "Audit-CSV geschrieben",
siteId: site.Id, land: site.Land,
details: auditCsvPath);
}
var filePath = fetchResult.ReferenceFilePath;
if (string.IsNullOrWhiteSpace(filePath))
{