StayExport Tracking - StayExportFile ExportDetails new type/format

- Added new class to unify and type the format of StayExportFile.ExportDetails field.

Note: This database migration will set to null all StayExportFile.ExportDetails data. This is required to prevent exceptions due to new formatting.
This commit is contained in:
Daniel-Garmig committed 2026-10-09 12:58:23 +02:00
1 parent cf62a0e55e
commit 54387a6346
15 files changed
+486 -35

No files matched your search

+23 -1
View File
@@ -62,6 +62,28 @@ internal static class EntityMapping
ExportPeriodEnd = entity.ExportParams.ExportPeriodEnd,
};
StayExportDetailsDTO? detailsDTO = null;
if (entity.ExportDetails != null)
{
List<StayExportDetailsStayEntryDTO> entriesDto = [];
foreach (var entry in entity.ExportDetails.StayEntries)
{
entriesDto.Add(new()
{
StayEntryId = entry.StayEntryId,
ExportResult = entry.ExportResult,
Details = entry.Details,
});
}
detailsDTO = new()
{
ExportedStayCount = entity.ExportDetails.ExportedStayCount,
StayErrorCount = entity.ExportDetails.StayErrorCount,
StayEntries = entriesDto,
};
}
return new()
{
Id = entity.Id,
@@ -69,7 +91,7 @@ internal static class EntityMapping
ExportParams = exportParamsDto,
ExportResult = entity.ExportResult,
ExportedPath = entity.ExportedPath,
ExportDetails = entity.ExportDetails,
ExportDetails = detailsDTO,
ExportTime = entity.ExportTime.ToLocalTime(),
FileUploadStatus = entity.FileUploadStatus,
FileUploadStatusTime = entity.FileUploadStatusTime?.ToLocalTime(),