forked from sanchezvem/PyroFetes
Added endpoint to get products under their limit
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user