diff --git a/PuferFishContracts/PuferFishBusinessLogic/Implementations/BuyerBusinessLogicContract.cs b/PuferFishContracts/PuferFishBusinessLogic/Implementations/BuyerBusinessLogicContract.cs new file mode 100644 index 0000000..aa3766e --- /dev/null +++ b/PuferFishContracts/PuferFishBusinessLogic/Implementations/BuyerBusinessLogicContract.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using PuferFishContracts.BusinessLogicsContracts; +using PuferFishContracts.DataModels; +using PuferFishContracts.StoragesContracts; + +namespace PuferFishBusinessLogic.Implementationsж +{ + internal class BuyerBusinessLogicContract(IBuyerStorageContract buyerStorageContract, ILogger logger) : IBuyerBusinessLogicContract + { + private readonly ILogger _logger = logger; + private readonly IBuyerStorageContract _buyerStorageContract = + buyerStorageContract; + public List GetAllBuyers() + { + return []; + } + public BuyerDataModel GetBuyerByData(string data) + { + return new("", "", "", 0); + } + public void InsertBuyer(BuyerDataModel buyerDataModel) + { + } + public void UpdateBuyer(BuyerDataModel buyerDataModel) + { + } + public void DeleteBuyer(string id) + { + } + } +} diff --git a/PuferFishContracts/PuferFishBusinessLogic/Implementations/PointsBusinessLogicContract.cs b/PuferFishContracts/PuferFishBusinessLogic/Implementations/PointsBusinessLogicContract.cs new file mode 100644 index 0000000..0035c19 --- /dev/null +++ b/PuferFishContracts/PuferFishBusinessLogic/Implementations/PointsBusinessLogicContract.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using PuferFishContracts.BusinessLogicsContracts; +using PuferFishContracts.DataModels; +using PuferFishContracts.StoragesContracts; + +namespace PuferFishBusinessLogic.Implementations; + +internal class PointsBusinessLogicContract(IPointsStorageContract pointsStorageContract, ISaleStorageContract saleStorageContract, IPostStorageContract +postStorageContract, IBuyerStorageContract buyerStorageContract, ILogger logger) : IPointsBusinessLogicContract +{ + private readonly ILogger _logger = logger; + private readonly IPointsStorageContract _pointsStorageContract = pointsStorageContract; + private readonly ISaleStorageContract _saleStorageContract = saleStorageContract; + private readonly IPostStorageContract _postStorageContract = postStorageContract; + private readonly IBuyerStorageContract _buyerStorageContract = buyerStorageContract; + public List GetAllPointsByPeriod(DateTime fromDate, + DateTime toDate) + { + return []; + } + public List GetAllPointsByPeriodByBuyer(DateTime fromDate, DateTime toDate, string buyerId) + { + return []; + } + public void CalculatePointsByMounth(DateTime date) + { + } +} diff --git a/PuferFishContracts/PuferFishBusinessLogic/Implementations/PostBusinessLogicContract.cs b/PuferFishContracts/PuferFishBusinessLogic/Implementations/PostBusinessLogicContract.cs new file mode 100644 index 0000000..32beec4 --- /dev/null +++ b/PuferFishContracts/PuferFishBusinessLogic/Implementations/PostBusinessLogicContract.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using PuferFishContracts.BusinessLogicsContracts; +using PuferFishContracts.DataModels; +using PuferFishContracts.Enums; +using PuferFishContracts.StoragesContracts; + +namespace PuferFishBusinessLogic.Implementations; + +internal class PostBusinessLogicContract(IPostStorageContract postStorageContract, ILogger logger) : IPostBusinessLogicContract +{ + private readonly ILogger _logger = logger; + private readonly IPostStorageContract _postStorageContract = + postStorageContract; + public List GetAllPosts(bool onlyActive = true) + { + return []; + } + public List GetAllDataOfPost(string postId) + { + return []; + } + public PostDataModel GetPostByData(string data) + { + return new("", "", PostType.None, true, DateTime.UtcNow); + } + public void InsertPost(PostDataModel postDataModel) + { + } + public void UpdatePost(PostDataModel postDataModel) + { + } + public void DeletePost(string id) + { + } + public void RestorePost(string id) + { + } +} diff --git a/PuferFishContracts/PuferFishBusinessLogic/Implementations/ProductBusinessLogicContract.cs b/PuferFishContracts/PuferFishBusinessLogic/Implementations/ProductBusinessLogicContract.cs new file mode 100644 index 0000000..1c12f6a --- /dev/null +++ b/PuferFishContracts/PuferFishBusinessLogic/Implementations/ProductBusinessLogicContract.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using PuferFishContracts.BusinessLogicsContracts; +using PuferFishContracts.DataModels; +using PuferFishContracts.Enums; +using PuferFishContracts.StoragesContracts; + +namespace PuferFishBusinessLogic.Implementations; + +internal class ProductBusinessLogicContract(IProductStorageContract productStorageContract, ILogger logger) : IProductBusinessLogicContract +{ + private readonly ILogger _logger = logger; + private readonly IProductStorageContract _productStorageContract = +productStorageContract; + public List GetAllProducts(bool onlyActive) + { + return []; + } + public List GetAllProductsByManufacturer(string + manufacturerId, bool onlyActive = true) + { + return []; + } + public List GetProductHistoryByProduct(string + productId) + { + return []; + } + public ProductDataModel GetProductByData(string data) + { + return new("", "", ProductType.None, 0, true); + } + public void InsertProduct(ProductDataModel productDataModel) + { + } + public void UpdateProduct(ProductDataModel productDataModel) + { + } + public void DeleteProduct(string id) + { + } +} diff --git a/PuferFishContracts/PuferFishBusinessLogic/Implementations/SaleBusinessLogicContract.cs b/PuferFishContracts/PuferFishBusinessLogic/Implementations/SaleBusinessLogicContract.cs new file mode 100644 index 0000000..96508f6 --- /dev/null +++ b/PuferFishContracts/PuferFishBusinessLogic/Implementations/SaleBusinessLogicContract.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using PuferFishContracts.BusinessLogicsContracts; +using PuferFishContracts.DataModels; +using PuferFishContracts.StoragesContracts; + +namespace PuferFishBusinessLogic.Implementations; + +internal class SaleBusinessLogicContract(ISaleStorageContract saleStorageContract, ILogger logger) : ISaleBusinessLogicContract +{ + private readonly ILogger _logger = logger; + private readonly ISaleStorageContract _saleStorageContract = + saleStorageContract; + public List GetAllSalesByPeriod(DateTime fromDate, DateTime + toDate) + { + return []; + } + public List GetAllSalesByWorkerByPeriod(string workerId, + DateTime fromDate, DateTime toDate) + { + return []; + } + public List GetAllSalesByBuyerByPeriod(string? buyerId, + DateTime fromDate, DateTime toDate) + { + return []; + } + public List GetAllSalesByProductByPeriod(string productId, + DateTime fromDate, DateTime toDate) + { + return []; + } + public SaleDataModel GetSaleByData(string data) + { + return new("", "", "", 0, 0, false, []); + } + public void InsertSale(SaleDataModel saleDataModel) + { + } + public void CancelSale(string id) + { + } +} diff --git a/PuferFishContracts/PuferFishBusinessLogic/Implementations/WorkerBusinessLogicContract.cs b/PuferFishContracts/PuferFishBusinessLogic/Implementations/WorkerBusinessLogicContract.cs new file mode 100644 index 0000000..27617da --- /dev/null +++ b/PuferFishContracts/PuferFishBusinessLogic/Implementations/WorkerBusinessLogicContract.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using PuferFishContracts.BusinessLogicsContracts; +using PuferFishContracts.DataModels; +using PuferFishContracts.StoragesContracts; + +namespace PuferFishBusinessLogic.Implementations; + +internal class WorkerBusinessLogicContract(IWorkerStorageContract workerStorageContract, ILogger logger) : IWorkerBusinessLogicContract +{ + private readonly ILogger _logger = logger; + private readonly IWorkerStorageContract _workerStorageContract = + workerStorageContract; + public List GetAllWorkers(bool onlyActive = true) + { + return []; + } + public List GetAllWorkersByPost(string postId, bool onlyActive = true) + { + return []; + } + public List GetAllWorkersByBirthDate(DateTime fromDate, DateTime toDate, bool onlyActive = true) + { + return []; + } + public List GetAllWorkersByEmploymentDate(DateTime fromDate, DateTime toDate, bool onlyActive = true) + { + return []; + } + public WorkerDataModel GetWorkerByData(string data) + { + return new("", "", "", DateTime.Now, DateTime.Now, true); + } + public void InsertWorker(WorkerDataModel workerDataModel) + { + } + public void UpdateWorker(WorkerDataModel workerDataModel) + { + } + public void DeleteWorker(string id) + { + } +} diff --git a/PuferFishContracts/PuferFishBusinessLogic/PuferFishBusinessLogic.csproj b/PuferFishContracts/PuferFishBusinessLogic/PuferFishBusinessLogic.csproj new file mode 100644 index 0000000..0adc9e6 --- /dev/null +++ b/PuferFishContracts/PuferFishBusinessLogic/PuferFishBusinessLogic.csproj @@ -0,0 +1,13 @@ + + + + net9.0 + enable + enable + + + + + + + diff --git a/PuferFishContracts/PuferFishContracts.sln b/PuferFishContracts/PuferFishContracts.sln index 7378568..367e681 100644 --- a/PuferFishContracts/PuferFishContracts.sln +++ b/PuferFishContracts/PuferFishContracts.sln @@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PuferFishContracts", "Pufer EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PuferFishTests", "PuferFishTests\PuferFishTests.csproj", "{6A249C1E-4321-4506-841B-2BCE80F550A5}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PuferFishBusinessLogic", "PuferFishBusinessLogic\PuferFishBusinessLogic.csproj", "{6997CEC9-5AB7-40C0-9873-E51D2674187B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -21,6 +23,10 @@ Global {6A249C1E-4321-4506-841B-2BCE80F550A5}.Debug|Any CPU.Build.0 = Debug|Any CPU {6A249C1E-4321-4506-841B-2BCE80F550A5}.Release|Any CPU.ActiveCfg = Release|Any CPU {6A249C1E-4321-4506-841B-2BCE80F550A5}.Release|Any CPU.Build.0 = Release|Any CPU + {6997CEC9-5AB7-40C0-9873-E51D2674187B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6997CEC9-5AB7-40C0-9873-E51D2674187B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6997CEC9-5AB7-40C0-9873-E51D2674187B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6997CEC9-5AB7-40C0-9873-E51D2674187B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE