Initial commit
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
||||
using Ardalis.Specification;
|
||||
using PyroFetes.Models;
|
||||
|
||||
namespace PyroFetes.Specifications.Deliverers;
|
||||
|
||||
public sealed class GetDelivererByIdSpec : Specification<Deliverer>
|
||||
{
|
||||
public GetDelivererByIdSpec(int delivererId)
|
||||
{
|
||||
Query
|
||||
.Where(x => x.Id == delivererId);
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
using Ardalis.Specification;
|
||||
using PyroFetes.Models;
|
||||
|
||||
namespace PyroFetes.Specifications.DeliveryNotes;
|
||||
|
||||
public sealed class GetDeliveryNoteByIdSpec : Specification<DeliveryNote>
|
||||
{
|
||||
public GetDeliveryNoteByIdSpec(int deliveryNoteId)
|
||||
{
|
||||
Query
|
||||
.Where(x => x.Id == deliveryNoteId);
|
||||
}
|
||||
}
|
||||
+13
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
using Ardalis.Specification;
|
||||
using PyroFetes.Models;
|
||||
|
||||
namespace PyroFetes.Specifications.PurchaseOrders;
|
||||
|
||||
public sealed class GetPurchaseOrderByIdSpec : Specification<PurchaseOrder>
|
||||
{
|
||||
public GetPurchaseOrderByIdSpec(int purchaseOrderId)
|
||||
{
|
||||
Query
|
||||
.Include(po => po.PurchaseProducts)
|
||||
.Where(po => po.Id == purchaseOrderId);
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
using Ardalis.Specification;
|
||||
using PyroFetes.Models;
|
||||
|
||||
namespace PyroFetes.Specifications.PurchaseProducts;
|
||||
|
||||
public sealed class GetPurchaseProductByProductIdAndPurchaseOrderIdSpec : Specification<PurchaseProduct>
|
||||
{
|
||||
public GetPurchaseProductByProductIdAndPurchaseOrderIdSpec(int productId, int purchaseOrderId)
|
||||
{
|
||||
Query
|
||||
.Where(p => p.ProductId == productId && p.PurchaseOrderId == purchaseOrderId);
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
using Ardalis.Specification;
|
||||
using PyroFetes.Models;
|
||||
|
||||
namespace PyroFetes.Specifications.QuotationProducts;
|
||||
|
||||
public sealed class GetQuotationProductByProductIdAndQuotationIdSpec : Specification<QuotationProduct>
|
||||
{
|
||||
public GetQuotationProductByProductIdAndQuotationIdSpec(int productId, int quotationId)
|
||||
{
|
||||
Query
|
||||
.Where(x => x.ProductId == productId && x.QuotationId == quotationId);
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
using Ardalis.Specification;
|
||||
using PyroFetes.Models;
|
||||
|
||||
namespace PyroFetes.Specifications.Quotations;
|
||||
|
||||
public sealed class GetQuotationByIdSpec : Specification<Quotation>
|
||||
{
|
||||
public GetQuotationByIdSpec(int quotationId)
|
||||
{
|
||||
Query
|
||||
.Include(q => q.QuotationProducts)
|
||||
.Where(x => x.Id == quotationId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using Ardalis.Specification;
|
||||
using PyroFetes.Models;
|
||||
|
||||
namespace PyroFetes.Specifications.Settings;
|
||||
|
||||
public sealed class GetSettingByIdSpec : Specification<Setting>
|
||||
{
|
||||
public GetSettingByIdSpec(int settingId)
|
||||
{
|
||||
Query
|
||||
.Where(setting => setting.Id == settingId);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using Ardalis.Specification;
|
||||
using PyroFetes.Models;
|
||||
|
||||
namespace PyroFetes.Specifications.Users;
|
||||
|
||||
public sealed class GetUserByIdSpec : Specification<User>
|
||||
{
|
||||
public GetUserByIdSpec(int userId)
|
||||
{
|
||||
Query
|
||||
.Where(x => x.Id == userId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using Ardalis.Specification;
|
||||
using PyroFetes.Models;
|
||||
|
||||
namespace PyroFetes.Specifications.Users;
|
||||
|
||||
public sealed class GetUserByNameSpec : Specification<User>
|
||||
{
|
||||
public GetUserByNameSpec(string userName)
|
||||
{
|
||||
Query
|
||||
.Where(x=> x.Name == userName);
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
using Ardalis.Specification;
|
||||
using PyroFetes.Models;
|
||||
|
||||
namespace PyroFetes.Specifications.WarehouseProducts;
|
||||
|
||||
public sealed class GetProductTotalQuantitySpec : Specification<WarehouseProduct>
|
||||
{
|
||||
public GetProductTotalQuantitySpec(int productId)
|
||||
{
|
||||
Query
|
||||
.Where(wp => wp.ProductId == productId);
|
||||
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
using Ardalis.Specification;
|
||||
using PyroFetes.Models;
|
||||
|
||||
namespace PyroFetes.Specifications.WarehouseProducts;
|
||||
|
||||
public sealed class GetWarehouseProductByProductIdSpec : Specification<WarehouseProduct>
|
||||
{
|
||||
public GetWarehouseProductByProductIdSpec(int productId)
|
||||
{
|
||||
Query
|
||||
.Where(x => x.ProductId == productId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user