Added endpoint to get products under their limit

This commit is contained in:
Cristiano
2025-12-18 14:41:45 +01:00
parent 29e2036965
commit 3487baad87
2 changed files with 35 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
using Ardalis.Specification;
using PyroFetes.Models;
namespace PyroFetes.Specifications.Products;
public sealed class GetProductsUnderLimitSpec : Specification<Product>
{
public GetProductsUnderLimitSpec()
{
Query
.Include(p => p.QuotationProducts)
.Where(p => p.QuotationProducts.Any(q => q.Quantity < p.MinimalQuantity));
}
}