Optimize invoice performance with indexes and DTO
Added indexes for `ImportedAt` and a composite key on `InvoiceNumber` and `SellerTaxId` to improve query performance. Updated `AppDbContext` and EF Core migrations to reflect these changes. Introduced `ZugferdInvoiceListDto` to optimize memory usage by excluding large fields like `RawXml`. Updated the frontend (`Index.cshtml`) and backend (`Index.cshtml.cs`) to use the new DTO for better performance.
This commit is contained in:
22
DXApp.TemplateKitProject/Models/ZugferdInvoiceListDto.cs
Normal file
22
DXApp.TemplateKitProject/Models/ZugferdInvoiceListDto.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
namespace DXApp.TemplateKitProject.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Lightweight DTO für die Rechnungsliste (ohne RawXml für bessere Performance)
|
||||
/// </summary>
|
||||
public class ZugferdInvoiceListDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string InvoiceNumber { get; set; } = string.Empty;
|
||||
public DateTime InvoiceDate { get; set; }
|
||||
public string SellerName { get; set; } = string.Empty;
|
||||
public string SellerTaxId { get; set; } = string.Empty;
|
||||
public string BuyerName { get; set; } = string.Empty;
|
||||
public decimal TotalAmount { get; set; }
|
||||
public decimal TaxAmount { get; set; }
|
||||
public string CurrencyCode { get; set; } = string.Empty;
|
||||
public string Iban { get; set; } = string.Empty;
|
||||
public DateTime ImportedAt { get; set; }
|
||||
public string SourceType { get; set; } = string.Empty;
|
||||
public string ResultFilePath { get; set; } = string.Empty;
|
||||
public string GuidelineId { get; set; } = string.Empty;
|
||||
}
|
||||
Reference in New Issue
Block a user