Merge branch 'v0.0.5.1' of https://git.aycode.com/Adam/TourIAm into v0.0.5.1
This commit is contained in:
commit
68a83ff8a3
|
|
@ -3,6 +3,6 @@
|
||||||
public enum SeatNumberPriceType : byte
|
public enum SeatNumberPriceType : byte
|
||||||
{
|
{
|
||||||
Price1SeatNum = 0,
|
Price1SeatNum = 0,
|
||||||
Price2SeatNum = 4,
|
Price2SeatNum = 5,
|
||||||
Price3SeatNum = 8,
|
Price3SeatNum = 7,
|
||||||
}
|
}
|
||||||
|
|
@ -6,6 +6,10 @@
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="DevExpress.Data" Version="24.2.3" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\TIAM.Core\TIAM.Core.csproj" />
|
<ProjectReference Include="..\TIAM.Core\TIAM.Core.csproj" />
|
||||||
<ProjectReference Include="..\TIAM.Entities.Server\TIAM.Entities.Server.csproj" />
|
<ProjectReference Include="..\TIAM.Entities.Server\TIAM.Entities.Server.csproj" />
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,10 @@
|
||||||
<Folder Include="GridViewModels\" />
|
<Folder Include="GridViewModels\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="DevExpress.Data" Version="24.2.3" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\Aycode.Blazor\AyCode.Blazor.Components\AyCode.Blazor.Components.csproj" />
|
<ProjectReference Include="..\..\Aycode.Blazor\AyCode.Blazor.Components\AyCode.Blazor.Components.csproj" />
|
||||||
<ProjectReference Include="..\..\Aycode.Blazor\AyCode.Blazor.Models\AyCode.Blazor.Models.csproj" />
|
<ProjectReference Include="..\..\Aycode.Blazor\AyCode.Blazor.Models\AyCode.Blazor.Models.csproj" />
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="DevExpress.Blazor" Version="24.2.3" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="8.0.10" />
|
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="8.0.10" />
|
||||||
<PackageReference Include="SendGrid" Version="9.29.3" />
|
<PackageReference Include="SendGrid" Version="9.29.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -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
|
//check if Destination has a custom commissionRate by productId
|
||||||
double commissionRate = 0;
|
double commissionRate = 0;
|
||||||
|
|
@ -92,7 +92,7 @@ namespace TIAM.Services.Server
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
commission = GetCommission(Price, commissionRate);
|
commission = GetCommission(price, commissionRate);
|
||||||
return commission;
|
return commission;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,10 @@
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="DevExpress.Data" Version="24.2.3" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\TIAM.Core\TIAM.Core.csproj" />
|
<ProjectReference Include="..\TIAM.Core\TIAM.Core.csproj" />
|
||||||
<ProjectReference Include="..\TIAM.Entities\TIAM.Entities.csproj" />
|
<ProjectReference Include="..\TIAM.Entities\TIAM.Entities.csproj" />
|
||||||
|
|
|
||||||
|
|
@ -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.Models;
|
||||||
@using TIAMWebApp.Shared.Application.Interfaces;
|
@using TIAMWebApp.Shared.Application.Interfaces;
|
||||||
@inject ISessionService sessionService;
|
@inject ISessionService sessionService;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
@using TIAMWebApp.Shared.Application.Models;
|
@using DevExpress.Blazor
|
||||||
|
@using TIAMWebApp.Shared.Application.Models;
|
||||||
@using TIAMWebApp.Shared.Application.Interfaces;
|
@using TIAMWebApp.Shared.Application.Interfaces;
|
||||||
@inject ISessionService sessionService;
|
@inject ISessionService sessionService;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -494,10 +494,10 @@ namespace TIAMWebApp.Server.Controllers
|
||||||
{
|
{
|
||||||
if (!transfer.ProductId.IsNullOrEmpty())
|
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);
|
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);
|
transfer.Revenue = _transferBackendService.GetCommission((Guid)transfer.ProductId, (double)transfer.Price, to);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
{
|
{
|
||||||
"ConnectionStrings": {
|
"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=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_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": {
|
"Logging": {
|
||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
"Default": "Information",
|
"Default": "Information",
|
||||||
|
|
|
||||||
|
|
@ -107,9 +107,8 @@ namespace TIAMWebApp.Shared.Application.Services
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<TransferToDriver>> GetTransferDrivers(Guid transferId)
|
public async Task<List<TransferToDriver>> GetTransferDrivers(Guid transferId)
|
||||||
{
|
=> await GetByIdAsync<List<TransferToDriver>>(SignalRTags.GetTransferDriversByTransferId, transferId) ?? [];
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<TransferToDriver?> AddTransferDriver(TransferToDriver transferToDriver)
|
public async Task<TransferToDriver?> AddTransferDriver(TransferToDriver transferToDriver)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="DevExpress.Blazor" Version="24.2.3" />
|
||||||
<PackageReference Include="MessagePack" Version="2.5.187" />
|
<PackageReference Include="MessagePack" Version="2.5.187" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="8.0.10" />
|
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="8.0.10" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="8.0.10" />
|
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="8.0.10" />
|
||||||
|
|
|
||||||
|
|
@ -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(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)));
|
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<List<TransferToDriver>>(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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,21 +1,9 @@
|
||||||
using System.Linq.Expressions;
|
|
||||||
using AyCode.Core.Enums;
|
using AyCode.Core.Enums;
|
||||||
using AyCode.Core.Extensions;
|
|
||||||
using AyCode.Core.Helpers;
|
|
||||||
using AyCode.Core.Loggers;
|
using AyCode.Core.Loggers;
|
||||||
using AyCode.Services.Loggers;
|
using AyCode.Services.Loggers;
|
||||||
using AyCode.Services.SignalRs;
|
|
||||||
using Azure;
|
|
||||||
using DevExpress.DashboardBlazor;
|
|
||||||
using DevExpress.Data.Filtering;
|
using DevExpress.Data.Filtering;
|
||||||
using DevExpress.Data.Linq;
|
using DevExpress.Data.Linq;
|
||||||
using DevExpress.Data.Linq.Helpers;
|
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.Entities.Transfers;
|
||||||
using TIAM.Services;
|
using TIAM.Services;
|
||||||
using TIAMSharedUI.Shared;
|
using TIAMSharedUI.Shared;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue