forked from sanchezvem/pyrofetes-backend
14 lines
404 B
C#
14 lines
404 B
C#
using Ardalis.Specification;
|
|
using PyroFetes.Models;
|
|
|
|
namespace PyroFetes.Specifications.Products;
|
|
|
|
public sealed class GetProductsUnderLimitSpec : Specification<Product>
|
|
{
|
|
public GetProductsUnderLimitSpec()
|
|
{
|
|
Query
|
|
.Include(x => x.WarehouseProducts)
|
|
.Where(x => x.WarehouseProducts != null && x.WarehouseProducts.Sum(p => p.Quantity) < x.MinimalQuantity);
|
|
}
|
|
} |