feat StayExport - Stay Export Pages - Initial implementation

This commit is contained in:
2026-09-04 20:38:00 +02:00
parent cf31cbc414
commit 313a714a99
13 changed files with 434 additions and 9 deletions
@@ -9,5 +9,5 @@ public interface IStayExportFileEntityService
public Task<StayExportFileDTO?> GetDtoByIdAsync(long id);
//public Task<IEnumerable<StayExportFileDTO>> GetDtoListByFilterAsync(StayExportFileFilterDTO filter, int limit = 0);
public Task<IEnumerable<StayExportFileDTO>> GetDtoListAsync();
public Task<IEnumerable<StayExportFileDTO>> GetDtoListAsync(int limit = 0);
}
@@ -4,6 +4,7 @@ using Somnia.GuestLog.Infrastructure;
using Somnia.GuestLog.Models;
using Somnia.GuestLog.Models.DTOs;
using Somnia.GuestLog.Models.Entities;
using Somnia.GuestLog.Utils;
namespace Somnia.GuestLog.Services.Entity;
@@ -69,13 +70,15 @@ public class StayExportFileEntityService(
return dbItem is not null ? GetDtoFromDb(dbItem) : null;
}
public async Task<IEnumerable<StayExportFileDTO>> GetDtoListAsync()
public async Task<IEnumerable<StayExportFileDTO>> GetDtoListAsync(int limit = 0)
{
using var dbContext = contextFactory.CreateDbContext();
var dbList = await dbContext.StayExportFiles
IQueryable<StayExportFile> query = dbContext.StayExportFiles
.OrderByDescending(e => e.ExportTime)
.ToListAsync();
.WithLimit(limit);
var dbList = await query.ToListAsync();
return dbList.Select(e => GetDtoFromDb(e));
}