diff --git a/SeniorPomidorContracts/SeniorPomidorBuisnessLogic/Implementations/HarvestBuisnessLogicContract.cs b/SeniorPomidorContracts/SeniorPomidorBuisnessLogic/Implementations/HarvestBuisnessLogicContract.cs new file mode 100644 index 0000000..443a621 --- /dev/null +++ b/SeniorPomidorContracts/SeniorPomidorBuisnessLogic/Implementations/HarvestBuisnessLogicContract.cs @@ -0,0 +1,39 @@ +using Microsoft.Extensions.Logging; +using SeniorPomidorContracts.BuisnessLogicsContracts; +using SeniorPomidorContracts.DataModels; +using SeniorPomidorContracts.StoragesContracts; + +namespace SeniorPomidorBuisnessLogic.Implementations; + +public class HarvestBuisnessLogicContract(IHarvestStorageContract harvestStorageContract, ILogger logger) : IHarvestBuisnessLogicContract +{ + private readonly ILogger _logger = logger; + private readonly IHarvestStorageContract _harvestStorageContract = harvestStorageContract; + + public List GetAllHarvest() + { + return []; + } + + public HarvestDataModel GetAllHarvestByAmount(int amount) + { + return new HarvestDataModel("", 1); + } + + public void InsertHarvest(HarvestDataModel harvestDataModel) + { + } + + + public void RestoreHarvest(string id) + { + } + + public void UpdateHarvest(HarvestDataModel harvestDataModel) + { + } + + public void DeleteHarvest(string id) + { + } +} diff --git a/SeniorPomidorContracts/SeniorPomidorBuisnessLogic/Implementations/PTypeBuisnessLogicContract.cs b/SeniorPomidorContracts/SeniorPomidorBuisnessLogic/Implementations/PTypeBuisnessLogicContract.cs new file mode 100644 index 0000000..adbd270 --- /dev/null +++ b/SeniorPomidorContracts/SeniorPomidorBuisnessLogic/Implementations/PTypeBuisnessLogicContract.cs @@ -0,0 +1,35 @@ +using Microsoft.Extensions.Logging; +using SeniorPomidorContracts.BuisnessLogicsContracts; +using SeniorPomidorContracts.DataModels; +using SeniorPomidorContracts.StoragesContracts; + +namespace SeniorPomidorBuisnessLogic.Implementations; + +public class PTypeBuisnessLogicContract(IPTypeStorageContract pTypeStorageContract, ILogger logger) : IPTypeBuisnessLogicContract +{ + private readonly ILogger _logger = logger; + private readonly IPTypeStorageContract _pTypeStorageContract = pTypeStorageContract; + + public List GetAllPTypes() + { + return []; + } + + public List GetAllPTypesByName(string name) + { + return []; + } + + public void InsertProduct(ProductTypeDataModel productTypeDataModel) + { + } + + public void UpdateProduct(ProductTypeDataModel productTypeDataModel) + { + } + + public void DeleteProduct(string id) + { + } + +} diff --git a/SeniorPomidorContracts/SeniorPomidorBuisnessLogic/Implementations/ProductBuisnessLogicContract.cs b/SeniorPomidorContracts/SeniorPomidorBuisnessLogic/Implementations/ProductBuisnessLogicContract.cs new file mode 100644 index 0000000..898e147 --- /dev/null +++ b/SeniorPomidorContracts/SeniorPomidorBuisnessLogic/Implementations/ProductBuisnessLogicContract.cs @@ -0,0 +1,44 @@ +using Microsoft.Extensions.Logging; +using SeniorPomidorContracts.BuisnessLogicsContracts; +using SeniorPomidorContracts.DataModels; +using SeniorPomidorContracts.StoragesContracts; + +namespace SeniorPomidorBuisnessLogic.Implementations; + +public class ProductBuisnessLogicContract(IProductStorageContract productStorageContract, ILogger logger) : IProductBuisnessLogicContract +{ + private readonly ILogger _logger = logger; + private readonly IProductStorageContract _productStorageContract = productStorageContract; + + public List GetAllProducts(bool onlyActive = true) + { + return []; + } + + public List GetAllProductsByManufacturer(bool onlyActive = true) + { + return []; + } + + public ProductDataModel GetProductByData(string data) + { + return new ProductDataModel("", "", "", "", 1, true); + } + + public List GetProductHistoryByProduct(string productId) + { + return []; + } + + public void InsertProduct(ProductDataModel productDataModel) + { + } + + public void UpdateProduct(ProductDataModel productDataModel) + { + } + + public void DeleteProduct(string id) + { + } +} diff --git a/SeniorPomidorContracts/SeniorPomidorBuisnessLogic/Implementations/SupplierBuisnessLogicContract.cs b/SeniorPomidorContracts/SeniorPomidorBuisnessLogic/Implementations/SupplierBuisnessLogicContract.cs new file mode 100644 index 0000000..342509a --- /dev/null +++ b/SeniorPomidorContracts/SeniorPomidorBuisnessLogic/Implementations/SupplierBuisnessLogicContract.cs @@ -0,0 +1,39 @@ +using Microsoft.Extensions.Logging; +using SeniorPomidorContracts.BuisnessLogicsContracts; +using SeniorPomidorContracts.DataModels; +using SeniorPomidorContracts.StoragesContracts; + +namespace SeniorPomidorBuisnessLogic.Implementations; + +public class SupplierBuisnessLogicContract(ISupplierStorageContract supplierStorageContract, ILogger logger) : ISupplierBuisnessLogicContract +{ + private readonly ILogger _logger = logger; + private readonly ISupplierStorageContract _supplierStorageContract = supplierStorageContract; + + public List GetAllSuppliers() + { + return []; + } + + public List GetAllSuppliersByName(string name) + { + return []; + } + + public SupplierDataModel GetSupplierByPhoneNumber(string phoneNumber) + { + return new SupplierDataModel("", "", "", 1); + } + + public void InsertProduct(SupplierDataModel supplierDataModel) + { + } + + public void UpdateProduct(SupplierDataModel supplierDataModel) + { + } + + public void DeleteProduct(string id) + { + } +} diff --git a/SeniorPomidorContracts/SeniorPomidorBuisnessLogic/Implementations/SupplyBuisnessLogicContract.cs b/SeniorPomidorContracts/SeniorPomidorBuisnessLogic/Implementations/SupplyBuisnessLogicContract.cs new file mode 100644 index 0000000..1f598a2 --- /dev/null +++ b/SeniorPomidorContracts/SeniorPomidorBuisnessLogic/Implementations/SupplyBuisnessLogicContract.cs @@ -0,0 +1,41 @@ +using Microsoft.Extensions.Logging; +using SeniorPomidorContracts.BuisnessLogicsContracts; +using SeniorPomidorContracts.DataModels; +using SeniorPomidorContracts.StoragesContracts; + +namespace SeniorPomidorBuisnessLogic.Implementations; + +public class SupplyBuisnessLogicContract(ISupplyStorageContract supplyStorageContract, ILogger logger) : ISupplyBuisnessLogicContract +{ + private readonly ILogger _logger = logger; + private readonly ISupplyStorageContract _supplyStorageContract = supplyStorageContract; + + public List GetAllSuppliesByPeriod(DateTime fromDate, DateTime toDate) + { + return []; + } + + public List GetAllSuppliesByProductByPeriod(string productId, DateTime fromDate, DateTime toDate) + { + return []; + } + + public List GetAllSuppliesBySuppliersByPeriod(string supplierId, DateTime fromDate, DateTime toDate) + { + return []; + } + + public SupplyDataModel GetSupplyByData(string data) + { + return new SupplyDataModel("", "", 1, DateTime.Now, true, []); + } + + public void InsertSupply(SupplyDataModel supplyDataModel) + { + } + + public void CancelSupply(string id) + { + } + +} diff --git a/SeniorPomidorContracts/SeniorPomidorBuisnessLogic/SeniorPomidorBuisnessLogic.csproj b/SeniorPomidorContracts/SeniorPomidorBuisnessLogic/SeniorPomidorBuisnessLogic.csproj new file mode 100644 index 0000000..23baf03 --- /dev/null +++ b/SeniorPomidorContracts/SeniorPomidorBuisnessLogic/SeniorPomidorBuisnessLogic.csproj @@ -0,0 +1,17 @@ + + + + net9.0 + enable + enable + + + + + + + + + + + diff --git a/SeniorPomidorContracts/SeniorPomidorContracts.sln b/SeniorPomidorContracts/SeniorPomidorContracts.sln index ab0d318..c6f4ee1 100644 --- a/SeniorPomidorContracts/SeniorPomidorContracts.sln +++ b/SeniorPomidorContracts/SeniorPomidorContracts.sln @@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SeniorPomidorContracts", "S EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SeniorPomidorTests", "SeniorPomidorTests\SeniorPomidorTests.csproj", "{6B124CD9-5257-4E62-B736-9C59CCAC19D4}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SeniorPomidorBuisnessLogic", "SeniorPomidorBuisnessLogic\SeniorPomidorBuisnessLogic.csproj", "{77513FB6-F4DB-4B37-8773-B7342004B6D7}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -21,6 +23,10 @@ Global {6B124CD9-5257-4E62-B736-9C59CCAC19D4}.Debug|Any CPU.Build.0 = Debug|Any CPU {6B124CD9-5257-4E62-B736-9C59CCAC19D4}.Release|Any CPU.ActiveCfg = Release|Any CPU {6B124CD9-5257-4E62-B736-9C59CCAC19D4}.Release|Any CPU.Build.0 = Release|Any CPU + {77513FB6-F4DB-4B37-8773-B7342004B6D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {77513FB6-F4DB-4B37-8773-B7342004B6D7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {77513FB6-F4DB-4B37-8773-B7342004B6D7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {77513FB6-F4DB-4B37-8773-B7342004B6D7}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/SeniorPomidorContracts/SeniorPomidorContracts/BuisnessLogicsContracts/IHarvestBuisnessLogicContract.cs b/SeniorPomidorContracts/SeniorPomidorContracts/BuisnessLogicsContracts/IHarvestBuisnessLogicContract.cs new file mode 100644 index 0000000..f1aec2d --- /dev/null +++ b/SeniorPomidorContracts/SeniorPomidorContracts/BuisnessLogicsContracts/IHarvestBuisnessLogicContract.cs @@ -0,0 +1,18 @@ +using SeniorPomidorContracts.DataModels; + +namespace SeniorPomidorContracts.BuisnessLogicsContracts; + +public interface IHarvestBuisnessLogicContract +{ + List GetAllHarvest(); + + HarvestDataModel? GetAllHarvestByAmount(int amount); + + void InsertHarvest(HarvestDataModel harvestDataModel); + + void UpdateHarvest(HarvestDataModel harvestDataModel); + + void DeleteHarvest(string id); + + void RestoreHarvest(string id); +} diff --git a/SeniorPomidorContracts/SeniorPomidorContracts/BuisnessLogicsContracts/IPTypeBuisnessLogicContract.cs b/SeniorPomidorContracts/SeniorPomidorContracts/BuisnessLogicsContracts/IPTypeBuisnessLogicContract.cs new file mode 100644 index 0000000..0e206e9 --- /dev/null +++ b/SeniorPomidorContracts/SeniorPomidorContracts/BuisnessLogicsContracts/IPTypeBuisnessLogicContract.cs @@ -0,0 +1,16 @@ +using SeniorPomidorContracts.DataModels; + +namespace SeniorPomidorContracts.BuisnessLogicsContracts; + +public interface IPTypeBuisnessLogicContract +{ + List GetAllPTypes(); + + List GetAllPTypesByName(string name); + + void InsertProduct(ProductTypeDataModel productTypeDataModel); + + void UpdateProduct(ProductTypeDataModel productTypeDataModel); + + void DeleteProduct(string id); +} diff --git a/SeniorPomidorContracts/SeniorPomidorContracts/BuisnessLogicsContracts/IProductBuisnessLogicContract.cs b/SeniorPomidorContracts/SeniorPomidorContracts/BuisnessLogicsContracts/IProductBuisnessLogicContract.cs new file mode 100644 index 0000000..b27185e --- /dev/null +++ b/SeniorPomidorContracts/SeniorPomidorContracts/BuisnessLogicsContracts/IProductBuisnessLogicContract.cs @@ -0,0 +1,20 @@ +using SeniorPomidorContracts.DataModels; + +namespace SeniorPomidorContracts.BuisnessLogicsContracts; + +public interface IProductBuisnessLogicContract +{ + List GetAllProducts(bool onlyActive = true); + + List GetAllProductsByManufacturer(bool onlyActive = true); + + List GetProductHistoryByProduct(string productId); + + ProductDataModel GetProductByData(string data); + + void InsertProduct(ProductDataModel productDataModel); + + void UpdateProduct(ProductDataModel productDataModel); + + void DeleteProduct(string id); +} diff --git a/SeniorPomidorContracts/SeniorPomidorContracts/BuisnessLogicsContracts/ISupplierBuisnessLogicContract.cs b/SeniorPomidorContracts/SeniorPomidorContracts/BuisnessLogicsContracts/ISupplierBuisnessLogicContract.cs new file mode 100644 index 0000000..68af1f5 --- /dev/null +++ b/SeniorPomidorContracts/SeniorPomidorContracts/BuisnessLogicsContracts/ISupplierBuisnessLogicContract.cs @@ -0,0 +1,18 @@ +using SeniorPomidorContracts.DataModels; + +namespace SeniorPomidorContracts.BuisnessLogicsContracts; + +public interface ISupplierBuisnessLogicContract +{ + List GetAllSuppliers(); + + SupplierDataModel GetSupplierByPhoneNumber(string phoneNumber); + + List GetAllSuppliersByName(string name); + + void InsertProduct(SupplierDataModel supplierDataModel); + + void UpdateProduct(SupplierDataModel supplierDataModel); + + void DeleteProduct(string id); +} diff --git a/SeniorPomidorContracts/SeniorPomidorContracts/BuisnessLogicsContracts/ISupplyBuisnessLogicContract.cs b/SeniorPomidorContracts/SeniorPomidorContracts/BuisnessLogicsContracts/ISupplyBuisnessLogicContract.cs new file mode 100644 index 0000000..cbe7ce9 --- /dev/null +++ b/SeniorPomidorContracts/SeniorPomidorContracts/BuisnessLogicsContracts/ISupplyBuisnessLogicContract.cs @@ -0,0 +1,18 @@ +using SeniorPomidorContracts.DataModels; + +namespace SeniorPomidorContracts.BuisnessLogicsContracts; + +public interface ISupplyBuisnessLogicContract +{ + List GetAllSuppliesByPeriod(DateTime fromDate, DateTime toDate); + + List GetAllSuppliesBySuppliersByPeriod(string supplierId, DateTime fromDate, DateTime toDate); + + List GetAllSuppliesByProductByPeriod(string productId, DateTime fromDate, DateTime toDate); + + SupplyDataModel GetSupplyByData(string data); + + void InsertSupply(SupplyDataModel supplyDataModel); + + void CancelSupply(string id); +} diff --git a/SeniorPomidorContracts/SeniorPomidorContracts/SeniorPomidorContracts.csproj b/SeniorPomidorContracts/SeniorPomidorContracts/SeniorPomidorContracts.csproj index 125f4c9..c5c738b 100644 --- a/SeniorPomidorContracts/SeniorPomidorContracts/SeniorPomidorContracts.csproj +++ b/SeniorPomidorContracts/SeniorPomidorContracts/SeniorPomidorContracts.csproj @@ -6,4 +6,8 @@ enable + + + + diff --git a/SeniorPomidorContracts/SeniorPomidorContracts/StoragesContracts/IHarvestStorageContract.cs b/SeniorPomidorContracts/SeniorPomidorContracts/StoragesContracts/IHarvestStorageContract.cs new file mode 100644 index 0000000..4ac589a --- /dev/null +++ b/SeniorPomidorContracts/SeniorPomidorContracts/StoragesContracts/IHarvestStorageContract.cs @@ -0,0 +1,17 @@ +using SeniorPomidorContracts.DataModels; + + +namespace SeniorPomidorContracts.StoragesContracts; + +public interface IHarvestStorageContract +{ + List GetList(); + + HarvestDataModel? GetElementById(string id); + + void AddElement(HarvestDataModel harvestDataModel); + + void UpdElement(HarvestDataModel harvestDataModel); + + void DelElement(string id); +} diff --git a/SeniorPomidorContracts/SeniorPomidorContracts/StoragesContracts/IPTypeStorageContract.cs b/SeniorPomidorContracts/SeniorPomidorContracts/StoragesContracts/IPTypeStorageContract.cs new file mode 100644 index 0000000..1d4f522 --- /dev/null +++ b/SeniorPomidorContracts/SeniorPomidorContracts/StoragesContracts/IPTypeStorageContract.cs @@ -0,0 +1,19 @@ +using SeniorPomidorContracts.DataModels; + + +namespace SeniorPomidorContracts.StoragesContracts; + +public interface IPTypeStorageContract +{ + List GetList(); + + ProductTypeDataModel? GetElementById(string id); + + ProductTypeDataModel? GetElementByName(string name); + + void AddElement(ProductTypeDataModel productTypeDataModel); + + void UpdElement(ProductTypeDataModel productTypeDataModel); + + void DelElement(string id); +} diff --git a/SeniorPomidorContracts/SeniorPomidorContracts/StoragesContracts/IProductStorageContract.cs b/SeniorPomidorContracts/SeniorPomidorContracts/StoragesContracts/IProductStorageContract.cs new file mode 100644 index 0000000..0e1c901 --- /dev/null +++ b/SeniorPomidorContracts/SeniorPomidorContracts/StoragesContracts/IProductStorageContract.cs @@ -0,0 +1,25 @@ +using SeniorPomidorContracts.DataModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SeniorPomidorContracts.StoragesContracts; + +public interface IProductStorageContract +{ + List GetList(bool onlyActive = true, string harvestId = null); + + List GetHistoryByProductId(string productId); + + ProductDataModel? GetElementById(string id); + + ProductDataModel? GetElementByName(string name); + + void AddElement(ProductDataModel productDataModel); + + void UpdElement(ProductDataModel productDataModel); + + void DelElement(string id); +} diff --git a/SeniorPomidorContracts/SeniorPomidorContracts/StoragesContracts/ISupplierStorageContract.cs b/SeniorPomidorContracts/SeniorPomidorContracts/StoragesContracts/ISupplierStorageContract.cs new file mode 100644 index 0000000..4ca0988 --- /dev/null +++ b/SeniorPomidorContracts/SeniorPomidorContracts/StoragesContracts/ISupplierStorageContract.cs @@ -0,0 +1,20 @@ +using SeniorPomidorContracts.DataModels; + +namespace SeniorPomidorContracts.StoragesContracts; + +public interface ISupplierStorageContract +{ + List GetList(); + + SupplierDataModel? GetElementById(string id); + + SupplierDataModel? GetElementByPhoneNumber(string phoneNumber); + + SupplierDataModel? GetElementByName(string name); + + void AddElement(SupplierDataModel supplierDataModel); + + void UpdElement(SupplierDataModel supplierDataModel); + + void DelElement(string id); +} diff --git a/SeniorPomidorContracts/SeniorPomidorContracts/StoragesContracts/ISupplyStorageContract.cs b/SeniorPomidorContracts/SeniorPomidorContracts/StoragesContracts/ISupplyStorageContract.cs new file mode 100644 index 0000000..4106af7 --- /dev/null +++ b/SeniorPomidorContracts/SeniorPomidorContracts/StoragesContracts/ISupplyStorageContract.cs @@ -0,0 +1,14 @@ +using SeniorPomidorContracts.DataModels; + +namespace SeniorPomidorContracts.StoragesContracts; + +public interface ISupplyStorageContract +{ + List GetList(DateTime? startDate = null, DateTime? endDate = null, string? supplierId = null, string? productId = null); + + SupplyDataModel? GetElementById(string id); + + void AddElement(SupplyDataModel supplyDataModel); + + void DelElement(string id); +} diff --git a/SeniorPomidorContracts/SeniorPomidorTests/SeniorPomidorTests.csproj b/SeniorPomidorContracts/SeniorPomidorTests/SeniorPomidorTests.csproj index d36e84c..eeea7a6 100644 --- a/SeniorPomidorContracts/SeniorPomidorTests/SeniorPomidorTests.csproj +++ b/SeniorPomidorContracts/SeniorPomidorTests/SeniorPomidorTests.csproj @@ -10,6 +10,7 @@ +