diff --git a/TIAM.Core/Enums/SeatNumberPriceType.cs b/TIAM.Core/Enums/SeatNumberPriceType.cs index bd9673e4..ea26d1d0 100644 --- a/TIAM.Core/Enums/SeatNumberPriceType.cs +++ b/TIAM.Core/Enums/SeatNumberPriceType.cs @@ -3,6 +3,6 @@ public enum SeatNumberPriceType : byte { Price1SeatNum = 0, - Price2SeatNum = 4, - Price3SeatNum = 8, + Price2SeatNum = 5, + Price3SeatNum = 7, } \ No newline at end of file diff --git a/TIAM.Models.Server/TIAM.Models.Server.csproj b/TIAM.Models.Server/TIAM.Models.Server.csproj index ac3f432d..da7fe4cd 100644 --- a/TIAM.Models.Server/TIAM.Models.Server.csproj +++ b/TIAM.Models.Server/TIAM.Models.Server.csproj @@ -6,6 +6,10 @@ enable + + + + diff --git a/TIAM.Models/TIAM.Models.csproj b/TIAM.Models/TIAM.Models.csproj index 140b006b..b610560d 100644 --- a/TIAM.Models/TIAM.Models.csproj +++ b/TIAM.Models/TIAM.Models.csproj @@ -12,6 +12,10 @@ + + + + diff --git a/TIAM.Services.Server/TIAM.Services.Server.csproj b/TIAM.Services.Server/TIAM.Services.Server.csproj index c4631780..6c4cb449 100644 --- a/TIAM.Services.Server/TIAM.Services.Server.csproj +++ b/TIAM.Services.Server/TIAM.Services.Server.csproj @@ -30,6 +30,7 @@ + diff --git a/TIAM.Services.Server/TransferBackendService.cs b/TIAM.Services.Server/TransferBackendService.cs index dc5133ce..f9a53bcb 100644 --- a/TIAM.Services.Server/TransferBackendService.cs +++ b/TIAM.Services.Server/TransferBackendService.cs @@ -62,7 +62,7 @@ namespace TIAM.Services.Server }; } - public double GetCommission(Guid productId, double Price, TransferDestination to) + public double GetCommission(Guid productId, double price, TransferDestination to) { //check if Destination has a custom commissionRate by productId double commissionRate = 0; @@ -92,7 +92,7 @@ namespace TIAM.Services.Server } } - commission = GetCommission(Price, commissionRate); + commission = GetCommission(price, commissionRate); return commission; } diff --git a/TIAM.Services/TIAM.Services.csproj b/TIAM.Services/TIAM.Services.csproj index 5c1bbbf6..a78390c0 100644 --- a/TIAM.Services/TIAM.Services.csproj +++ b/TIAM.Services/TIAM.Services.csproj @@ -6,6 +6,10 @@ enable + + + + diff --git a/TIAMSharedUI/Pages/Components/AuctionStep1.razor b/TIAMSharedUI/Pages/Components/AuctionStep1.razor index cd8fb15e..5d516980 100644 --- a/TIAMSharedUI/Pages/Components/AuctionStep1.razor +++ b/TIAMSharedUI/Pages/Components/AuctionStep1.razor @@ -1,4 +1,5 @@ -@using TIAMWebApp.Shared.Application.Models.PageModels; +@using DevExpress.Blazor +@using TIAMWebApp.Shared.Application.Models.PageModels; @using TIAMWebApp.Shared.Application.Models; @using TIAMWebApp.Shared.Application.Interfaces; @inject ISessionService sessionService; diff --git a/TIAMSharedUI/Pages/Components/TransferStep1.razor b/TIAMSharedUI/Pages/Components/TransferStep1.razor index 675b7d31..06c590ef 100644 --- a/TIAMSharedUI/Pages/Components/TransferStep1.razor +++ b/TIAMSharedUI/Pages/Components/TransferStep1.razor @@ -1,4 +1,5 @@ -@using TIAMWebApp.Shared.Application.Models; +@using DevExpress.Blazor +@using TIAMWebApp.Shared.Application.Models; @using TIAMWebApp.Shared.Application.Interfaces; @inject ISessionService sessionService; diff --git a/TIAMWebApp/Server/Controllers/TransferDataAPIController.cs b/TIAMWebApp/Server/Controllers/TransferDataAPIController.cs index c857ee4b..7b74507f 100644 --- a/TIAMWebApp/Server/Controllers/TransferDataAPIController.cs +++ b/TIAMWebApp/Server/Controllers/TransferDataAPIController.cs @@ -494,10 +494,10 @@ namespace TIAMWebApp.Server.Controllers { if (!transfer.ProductId.IsNullOrEmpty()) { - var product = await _adminDal.GetProductByIdAsync((Guid)transfer.ProductId); + //var product = await _adminDal.GetProductByIdAsync((Guid)transfer.ProductId); transfer.Price = _transferBackendService.GetTransferPrice(transfer.ProductId.Value, from, to, transfer.PassengerCount); - if (transfer.Price.HasValue && transfer.Price > 0) + if (transfer.Price is > 0) { transfer.Revenue = _transferBackendService.GetCommission((Guid)transfer.ProductId, (double)transfer.Price, to); } diff --git a/TIAMWebApp/Server/appsettings.json b/TIAMWebApp/Server/appsettings.json index 53fe55e4..2c62cc83 100644 --- a/TIAMWebApp/Server/appsettings.json +++ b/TIAMWebApp/Server/appsettings.json @@ -1,8 +1,10 @@ { - "ConnectionStrings": { - //"DeveloperDbConnection": "Data Source=185.51.190.197;Initial Catalog=TIAM_DEV;Trusted_Connection=false;Encrypt=false;TrustServerCertificate=True;Connect Timeout=200;User ID=Anata_Development_Team;Password=v6f_?xNfg9N1;MultipleActiveResultSets=true" - "DeveloperDbConnection": "Data Source=194.164.235.47;Initial Catalog=TIAM_DEV;Trusted_Connection=false;Encrypt=false;TrustServerCertificate=True;Connect Timeout=200;User ID=Anata_Development_Team;Password=v6f_?xNfg9N1;MultipleActiveResultSets=true" - }, + "ConnectionStrings": { + //"DeveloperDbConnection": "Data Source=185.51.190.197;Initial Catalog=TIAM_DEV;Trusted_Connection=false;Encrypt=false;TrustServerCertificate=True;Connect Timeout=200;User ID=Anata_Development_Team;Password=v6f_?xNfg9N1;MultipleActiveResultSets=true" + + "DeveloperDbConnection": "Data Source=194.164.235.47;Initial Catalog=TIAM_DEV;Trusted_Connection=false;Encrypt=false;TrustServerCertificate=True;Connect Timeout=200;User ID=Anata_Development_Team;Password=v6f_?xNfg9N1;MultipleActiveResultSets=true" + //"DeveloperDbConnection": "Data Source=194.164.235.47;Initial Catalog=TIAM_DEVRELEASE;Trusted_Connection=false;Encrypt=false;TrustServerCertificate=True;Connect Timeout=200;User ID=Anata_Development_Team;Password=v6f_?xNfg9N1;MultipleActiveResultSets=true" + }, "Logging": { "LogLevel": { "Default": "Information", diff --git a/TIAMWebApp/Shared/Services/AdminSignalRClient.cs b/TIAMWebApp/Shared/Services/AdminSignalRClient.cs index 0a2f7c9b..3bd35ada 100644 --- a/TIAMWebApp/Shared/Services/AdminSignalRClient.cs +++ b/TIAMWebApp/Shared/Services/AdminSignalRClient.cs @@ -107,9 +107,8 @@ namespace TIAMWebApp.Shared.Application.Services } public async Task> GetTransferDrivers(Guid transferId) - { - throw new NotImplementedException(); - } + => await GetByIdAsync>(SignalRTags.GetTransferDriversByTransferId, transferId) ?? []; + public async Task AddTransferDriver(TransferToDriver transferToDriver) { diff --git a/TIAMWebApp/Shared/TIAMWebApp.Shared.Application.csproj b/TIAMWebApp/Shared/TIAMWebApp.Shared.Application.csproj index 5d2426bb..4101610b 100644 --- a/TIAMWebApp/Shared/TIAMWebApp.Shared.Application.csproj +++ b/TIAMWebApp/Shared/TIAMWebApp.Shared.Application.csproj @@ -22,6 +22,7 @@ + diff --git a/Tiam.Services.Client.Tests/SignalRClientTest.cs b/Tiam.Services.Client.Tests/SignalRClientTest.cs index 95b68ead..de8ec7f1 100644 --- a/Tiam.Services.Client.Tests/SignalRClientTest.cs +++ b/Tiam.Services.Client.Tests/SignalRClientTest.cs @@ -306,5 +306,20 @@ namespace Tiam.Services.Client.Tests Assert.IsTrue(cars.All(car => drivers.Any(driver => driver.Id == car.UserProductMappingId && driver.ProductId == productId))); Assert.IsTrue(drivers.All(driver => driver.ProductId == productId && cars.Any(car => car.UserProductMappingId == driver.Id))); } + + [TestMethod] + [DataRow("ddf26c38-933e-45aa-ad1f-76f6affc9fd1")] + public async Task GetTransferDiversByTransferIdAsyncTest_ReturnDrivers_WhenHasDrivers(string transferIdString) + { + var transferId = Guid.Parse(transferIdString); + + //var drivers = await _signalRClient.GetByIdAsync>(SignalRTags.GetTransferDriversByTransferId, transferId); + var drivers = await _signalRClient.GetTransferDrivers(transferId); + + await TaskHelper.WaitToAsync(() => drivers.Count > 0, 5000, 50); + + Assert.IsTrue(drivers.Count > 0); + Assert.IsTrue(drivers.All(driver => driver.TransferId == transferId)); + } } } \ No newline at end of file diff --git a/Tiam.Services.Client.Tests/SignalRDataSourceTest.cs b/Tiam.Services.Client.Tests/SignalRDataSourceTest.cs index 0b510966..da03ec26 100644 --- a/Tiam.Services.Client.Tests/SignalRDataSourceTest.cs +++ b/Tiam.Services.Client.Tests/SignalRDataSourceTest.cs @@ -1,21 +1,9 @@ -using System.Linq.Expressions; using AyCode.Core.Enums; -using AyCode.Core.Extensions; -using AyCode.Core.Helpers; using AyCode.Core.Loggers; using AyCode.Services.Loggers; -using AyCode.Services.SignalRs; -using Azure; -using DevExpress.DashboardBlazor; using DevExpress.Data.Filtering; using DevExpress.Data.Linq; using DevExpress.Data.Linq.Helpers; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using TIAM.Core.Loggers; -using TIAM.Database.DataLayers.Admins; -using TIAM.Database.Test; -using TIAM.Entities.ServiceProviders; using TIAM.Entities.Transfers; using TIAM.Services; using TIAMSharedUI.Shared;