SHA256
feat StayExport - Refactor Export Services.
- Created new service: IStayExportService" for common export operations. - Updated older services to be "IStayExportFormatProvider". This services will only implement the export format. - Renamed "IStayExportServiceFactory" to "IStayExportFormatProviderFactory" as this factory now is used to get the format providers for the given format.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
using Somnia.GuestLog.Enums.Models;
|
||||
using Somnia.GuestLog.Models.DTOs;
|
||||
|
||||
namespace Somnia.GuestLog.Services.StayExport;
|
||||
|
||||
public class StayExportProviderSpainParteViajeros(
|
||||
|
||||
) : IStayExportFormatProvider
|
||||
{
|
||||
private const string fileExtension = "xml";
|
||||
|
||||
public StayExportFormat GetFormat() => StayExportFormat.SpainParteViajeros;
|
||||
public string GetFilename(DateTime exportTime)
|
||||
=> $"{Enum.GetName(GetFormat())}_{exportTime.ToFileTimeUtc()}.{fileExtension}";
|
||||
|
||||
public Task<StayExportFileResult> ExportDataAsync(IEnumerable<StayEntryDTO> stayList, Stream dataStream)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user