Refactor all code

This commit is contained in:
2026-05-24 17:22:03 +01:00
parent fe58e5e7e7
commit 656100d15e
117 changed files with 3317 additions and 1562 deletions
@@ -3,12 +3,13 @@ using PyroFetes.Models;
namespace PyroFetes.Specifications.PurchaseOrders;
public sealed class GetPurchaseOrderByIdSpec : Specification<PurchaseOrder>
public sealed class GetPurchaseOrderByIdSpec : SingleResultSpecification<PurchaseOrder>
{
public GetPurchaseOrderByIdSpec(int purchaseOrderId)
{
Query
.Include(po => po.PurchaseProducts)
.Where(po => po.Id == purchaseOrderId);
.Include(x => x.PurchaseProducts!)
.ThenInclude(x => x.Product)
.Where(x => x.Id == purchaseOrderId);
}
}
@@ -3,14 +3,14 @@ using PyroFetes.Models;
namespace PyroFetes.Specifications.PurchaseOrders;
public class GetPurchaseOrderByIdWithProductsSpec : Specification<PurchaseOrder>
public class GetPurchaseOrderByIdWithProductsSpec : SingleResultSpecification<PurchaseOrder>
{
public GetPurchaseOrderByIdWithProductsSpec(int purchaseOrderId)
{
Query
.Where(p => p.Id == purchaseOrderId)
.Include(p => p.PurchaseProducts!)
.ThenInclude(pp => pp.Product)
.ThenInclude(pp=> pp!.Prices);
.Where(x => x.Id == purchaseOrderId)
.Include(x => x.PurchaseProducts!)
.ThenInclude(p => p.Product)
.ThenInclude(p=> p!.Prices);
}
}