diff --git a/PuferFishContracts/PuferFishBusinessLogic/Implementations/PointsBusinessLogicContract.cs b/PuferFishContracts/PuferFishBusinessLogic/Implementations/PointsBusinessLogicContract.cs index 4467b9b..dec7cd6 100644 --- a/PuferFishContracts/PuferFishBusinessLogic/Implementations/PointsBusinessLogicContract.cs +++ b/PuferFishContracts/PuferFishBusinessLogic/Implementations/PointsBusinessLogicContract.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; using Microsoft.Extensions.Logging; using PuferFishContracts.BusinessLogicsContracts; using PuferFishContracts.DataModels; +using PuferFishContracts.Enums; using PuferFishContracts.Exceptions; using PuferFishContracts.Extensions; using PuferFishContracts.StoragesContracts; @@ -17,8 +18,8 @@ internal class PointsBusinessLogicContract(IPointsStorageContract pointsStorageC 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) { _logger.LogInformation("GetAllSalaries params: {fromDate}, {toDate}", diff --git a/PuferFishContracts/PuferFishBusinessLogic/Implementations/ProductBusinessLogicContract.cs b/PuferFishContracts/PuferFishBusinessLogic/Implementations/ProductBusinessLogicContract.cs index f6962e5..c579a9b 100644 --- a/PuferFishContracts/PuferFishBusinessLogic/Implementations/ProductBusinessLogicContract.cs +++ b/PuferFishContracts/PuferFishBusinessLogic/Implementations/ProductBusinessLogicContract.cs @@ -18,6 +18,7 @@ internal class ProductBusinessLogicContract(IProductStorageContract productStora { private readonly ILogger _logger = logger; private readonly IProductStorageContract _productStorageContract = productStorageContract; + public List GetAllProducts(bool onlyActive) { _logger.LogInformation("GetAllProducts params: {onlyActive}", onlyActive); @@ -83,4 +84,4 @@ internal class ProductBusinessLogicContract(IProductStorageContract productStora } _productStorageContract.DelElement(id); } -} +} \ No newline at end of file diff --git a/PuferFishContracts/PuferFishBusinessLogic/Implementations/SaleBusinessLogicContract.cs b/PuferFishContracts/PuferFishBusinessLogic/Implementations/SaleBusinessLogicContract.cs index f8596a4..6090e05 100644 --- a/PuferFishContracts/PuferFishBusinessLogic/Implementations/SaleBusinessLogicContract.cs +++ b/PuferFishContracts/PuferFishBusinessLogic/Implementations/SaleBusinessLogicContract.cs @@ -122,4 +122,4 @@ JsonSerializer.Serialize(saleDataModel)); } _saleStorageContract.DelElement(id); } -} \ No newline at end of file +} diff --git a/PuferFishContracts/PuferFishBusinessLogic/Implementations/WorkerBusinessLogicContract.cs b/PuferFishContracts/PuferFishBusinessLogic/Implementations/WorkerBusinessLogicContract.cs index 510aa61..a1c2a13 100644 --- a/PuferFishContracts/PuferFishBusinessLogic/Implementations/WorkerBusinessLogicContract.cs +++ b/PuferFishContracts/PuferFishBusinessLogic/Implementations/WorkerBusinessLogicContract.cs @@ -18,6 +18,7 @@ internal class WorkerBusinessLogicContract(IWorkerStorageContract workerStorageC private readonly ILogger _logger = logger; private readonly IWorkerStorageContract _workerStorageContract = workerStorageContract; + public List GetAllWorkers(bool onlyActive = true) { _logger.LogInformation("GetAllWorkers params: {onlyActive}", @@ -107,3 +108,4 @@ new NullListException(); _workerStorageContract.DelElement(id); } } + \ No newline at end of file diff --git a/PuferFishContracts/PuferFishTests/BusinessLogicsContractsTests/PointsBusinessLogicContractTests.cs b/PuferFishContracts/PuferFishTests/BusinessLogicsContractsTests/PointsBusinessLogicContractTests.cs index a3af953..e50dfcc 100644 --- a/PuferFishContracts/PuferFishTests/BusinessLogicsContractsTests/PointsBusinessLogicContractTests.cs +++ b/PuferFishContracts/PuferFishTests/BusinessLogicsContractsTests/PointsBusinessLogicContractTests.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging; using Moq; using PuferFishBusinessLogic.Implementations; using PuferFishContracts.DataModels; @@ -201,9 +196,8 @@ internal class PointsBusinessLogicContractTests { // Arrange var buyerId = Guid.NewGuid().ToString(); - var expectedPoints = 100.0; // Ожидаемое количество баллов + var expectedPoints = 100.0; - // Установим значение Points для покупателя равным expectedPoints _buyerStorageContract.Setup(x => x.GetList()) .Returns(new List { new BuyerDataModel(buyerId, "Test", "123456789", expectedPoints) });