Added spec for see all documents order by desc

This commit is contained in:
2026-05-27 17:23:02 +01:00
parent 6f2c60e6c0
commit 6339fbdb8c
5 changed files with 34 additions and 3 deletions
@@ -9,6 +9,7 @@ public sealed class GetProductsUnderLimitSpec : Specification<Product>
{
Query
.Include(x => x.WarehouseProducts)
.Where(x => x.WarehouseProducts != null && x.WarehouseProducts.Sum(p => p.Quantity) < x.MinimalQuantity);
.Where(x => x.WarehouseProducts != null && x.WarehouseProducts.Sum(p => p.Quantity) < x.MinimalQuantity
&& !x.ProductDeliveries!.Any(d => d.DeliveryNote!.RealDeliveryDate == null));
}
}
@@ -0,0 +1,14 @@
using Ardalis.Specification;
using PyroFetes.Models;
namespace PyroFetes.Specifications.PurchaseOrders;
public class GetAllPurchaseOrderSpec : Specification<PurchaseOrder>
{
public GetAllPurchaseOrderSpec()
{
Query
.Where(x => true)
.OrderByDescending(x => x.Id);
}
}
@@ -0,0 +1,14 @@
using Ardalis.Specification;
using PyroFetes.Models;
namespace PyroFetes.Specifications.Quotations;
public class GetAllQuotationSpec : Specification<Quotation>
{
public GetAllQuotationSpec()
{
Query
.Where(x => true)
.OrderByDescending(x => x.Id);
}
}