Merge branch 'v0.0.5.1' of https://git.aycode.com/Adam/TourIAm into v0.0.5.1

This commit is contained in:
Adam 2025-04-08 17:08:58 +02:00
commit 68a83ff8a3
14 changed files with 47 additions and 27 deletions

View File

@ -3,6 +3,6 @@
public enum SeatNumberPriceType : byte
{
Price1SeatNum = 0,
Price2SeatNum = 4,
Price3SeatNum = 8,
Price2SeatNum = 5,
Price3SeatNum = 7,
}

View File

@ -6,6 +6,10 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DevExpress.Data" Version="24.2.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TIAM.Core\TIAM.Core.csproj" />
<ProjectReference Include="..\TIAM.Entities.Server\TIAM.Entities.Server.csproj" />

View File

@ -12,6 +12,10 @@
<Folder Include="GridViewModels\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="DevExpress.Data" Version="24.2.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Aycode.Blazor\AyCode.Blazor.Components\AyCode.Blazor.Components.csproj" />
<ProjectReference Include="..\..\Aycode.Blazor\AyCode.Blazor.Models\AyCode.Blazor.Models.csproj" />

View File

@ -30,6 +30,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="DevExpress.Blazor" Version="24.2.3" />
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="8.0.10" />
<PackageReference Include="SendGrid" Version="9.29.3" />
</ItemGroup>

View File

@ -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;
}

View File

@ -6,6 +6,10 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DevExpress.Data" Version="24.2.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TIAM.Core\TIAM.Core.csproj" />
<ProjectReference Include="..\TIAM.Entities\TIAM.Entities.csproj" />

View File

@ -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;

View File

@ -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;

View File

@ -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);
}

View File

@ -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",

View File

@ -107,9 +107,8 @@ namespace TIAMWebApp.Shared.Application.Services
}
public async Task<List<TransferToDriver>> GetTransferDrivers(Guid transferId)
{
throw new NotImplementedException();
}
=> await GetByIdAsync<List<TransferToDriver>>(SignalRTags.GetTransferDriversByTransferId, transferId) ?? [];
public async Task<TransferToDriver?> AddTransferDriver(TransferToDriver transferToDriver)
{

View File

@ -22,6 +22,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="DevExpress.Blazor" Version="24.2.3" />
<PackageReference Include="MessagePack" Version="2.5.187" />
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="8.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="8.0.10" />

View File

@ -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<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));
}
}
}

View File

@ -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;