feat StayExport - Initial Implementation

- Created models for DB and DTOs: StayExportFile
- Added required db migrations.
- Added StayExportService and StayExportServiceFactory for stay exporting services.
- Added configuration options required for StayExport.
This commit is contained in:
2026-09-01 18:14:22 +02:00
parent 7052ec734c
commit c24faedee5
24 changed files with 892 additions and 3 deletions
@@ -1,3 +1,5 @@
using Somnia.GuestLog.Infrastructure;
namespace Somnia.GuestLog.Models.Entities;
public class GuestAddress : BaseEntity
@@ -9,5 +11,5 @@ public class GuestAddress : BaseEntity
public required string AddressCountry { get; set; }
public string? ZipCode { get; set; }
public override string GetFullKey() => "N/A";
public override string GetFullKey() => DbConsts.PK_NotApply;
}
@@ -0,0 +1,28 @@
using Somnia.GuestLog.Enums.Models;
namespace Somnia.GuestLog.Models.Entities;
public class StayExportFile : BaseEntity
{
public long Id { get; set; }
public required StayExportFormat ExportFormat { get; set; }
public required StayExportParams ExportParams { get; set; }
public required StayExportFileResult ExportResult { get; set; }
/// <summary>
/// Path to exported data.
/// Should be relative to configured Storage.
/// </summary>
public string? ExportedPath { get; set; }
/// <summary>
/// Date/Time when export file was generated.
/// </summary>
public required DateTime ExportTime { get; set; }
public override string GetFullKey() => $"{Id}";
}
@@ -0,0 +1,19 @@
using Somnia.GuestLog.Enums.Models;
using Somnia.GuestLog.Infrastructure;
namespace Somnia.GuestLog.Models.Entities;
/// <summary>
/// This class store params used on StayExport.
/// Different params apply for different export types.
/// </summary>
public class StayExportParams : BaseEntity
{
public required StayExportParamType ExportType { get; set; }
public DateTime? ExportPeriodStart { get; set; }
public DateTime? ExportPeriodEnd { get; set; }
public override string GetFullKey() => DbConsts.PK_NotApply;
}