Adapted Price Endpoints

This commit is contained in:
Cristiano
2025-11-13 16:31:00 +01:00
parent c6d4ef2c58
commit ae834d1e3c
12 changed files with 139 additions and 106 deletions

View File

@@ -0,0 +1,13 @@
using Ardalis.Specification;
using PyroFetes.Models;
namespace PyroFetes.Specifications.Prices;
public sealed class GetPriceByProductIdAndSupplierIdSpec : Specification<Price>
{
public GetPriceByProductIdAndSupplierIdSpec(int? productId, int? supplierId)
{
Query
.Where(p => p.ProductId == productId && p.SupplierId == supplierId);
}
}

View File

@@ -0,0 +1,13 @@
using Ardalis.Specification;
using PyroFetes.Models;
namespace PyroFetes.Specifications.Products;
public sealed class GetProductByIdSpec : Specification<Product>
{
public GetProductByIdSpec(int? productId)
{
Query
.Where(p => p.Id == productId);
}
}

View File

@@ -0,0 +1,13 @@
using Ardalis.Specification;
using PyroFetes.Models;
namespace PyroFetes.Specifications.Suppliers;
public sealed class GetSupplierByIdSpec : Specification<Supplier>
{
public GetSupplierByIdSpec(int? supplierId)
{
Query
.Where(x => x.Id == supplierId);
}
}