Compare commits

..

No commits in common. "b871cf51df53b42d8dafbc93609f1c93a83cd18e" and "a5266f3d7931c7a1842ef0ee87d4f5c081c6561a" have entirely different histories.

13 changed files with 46 additions and 1149 deletions

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,6 @@ using TIAM.Entities.Products;
using TIAM.Entities.Users;
using TIAM.Models.Dtos.Users;
using TIAM.Entities.Transfers;
using TIAM.Entities.Profiles;
namespace TIAM.Database.Test
{
@ -33,9 +32,9 @@ namespace TIAM.Database.Test
[DataRow("42968456-6EF3-4D9C-8BC4-0569A129AC05")]
public void GetPermissionViewBySubjectId_ReturnsPermissionContextMapping_WhenPermissionContextMappingExists(string subjectIdString)
{
var subjectId = Guid.Parse(subjectIdString);
var subjectId= Guid.Parse(subjectIdString);
var permMapping = Dal.GetPermissionContextsViewBySubjectId(subjectId).ToList();
Assert.IsNotNull(permMapping, "PermissionContextsView is null");
Assert.IsTrue(permMapping.Count != 0, "PermissionContextsView count: 0");
}
@ -46,7 +45,7 @@ namespace TIAM.Database.Test
{
var contextId = Guid.Parse(contextIdString);
var permMapping = Dal.GetPermissionContextsViewByContextId(contextId).ToList();
Assert.IsNotNull(permMapping, "PermissionContextsView is null");
Assert.IsTrue(permMapping.Count != 0, "PermissionContextsView count: 0");
}
@ -57,7 +56,7 @@ namespace TIAM.Database.Test
{
var contextId = Guid.Parse(contextIdString);
var permMapping = await Dal.GetPermissionContextsViewByContextIdAsync(contextId);
Assert.IsNotNull(permMapping, "PermissionContextsView is null");
Assert.IsTrue(permMapping.Count != 0, "PermissionContextsView count: 0");
}
@ -66,7 +65,7 @@ namespace TIAM.Database.Test
{
var productId = Guid.Parse(productIdString);
var product = Dal.GetProductById(productId, true);
Assert.IsNotNull(product, "Product is null");
Assert.IsNotNull(product.Profile, "Profile is null");
Assert.IsNotNull(product.Profile.Address, "Profile.Address is null");
@ -77,7 +76,7 @@ namespace TIAM.Database.Test
[DataTestMethod]
public void GetProducts_ReturnProductsJson_WhenProductsExist()
{
var products = JsonConvert.DeserializeObject<List<Product>>(Dal.GetProductsJson(false));
var products = JsonConvert.DeserializeObject<List<Product>>(Dal.GetProductsJson(false));
Assert.IsNotNull(products, "Products is null");
Assert.IsTrue(products.Count > 0, "No products found");
@ -157,8 +156,8 @@ namespace TIAM.Database.Test
{
var userProductCarId = Guid.Parse(userProductCarIdString);
var serializedUserProductMapping = Dal.Session(ctx
=> ctx.UserProductMappings.FirstOrDefault(x
var serializedUserProductMapping = Dal.Session(ctx
=> ctx.UserProductMappings.FirstOrDefault(x
=> x.JsonDetailModel != null && x.JsonDetailModel.Cars != null && x.JsonDetailModel.Cars.Any(c => c.UserProductCarId == userProductCarId))?.ToJson());
//var transfers = Dal.Session(x => x.GetTransfers()).ToList();
@ -293,7 +292,7 @@ namespace TIAM.Database.Test
var users = JsonConvert.DeserializeObject<List<User>>(userJson);
Assert.IsNotNull(users);
Assert.IsTrue(users.Count > 0);
Assert.IsTrue(users.Count>0);
}
#region Transfer
@ -348,7 +347,7 @@ namespace TIAM.Database.Test
Assert.IsTrue(transferDestinationToProduct.TransferDestination.Id == transferDestinationId, "transferDestinationToProduct.TransferDestination.Id != transferDestinationId");
}
[DataTestMethod]
[DataRow(["8f38f8e3-a92c-4979-88b1-dc812a82245f", "814b5495-c2e9-4f1d-a73f-37cd5d353078", "71392CFD-FB9C-45C1-9540-7BE3782CF26A", "b3f51770-c821-4207-be2a-e622fed2a731"])]
public async Task TransferCrudTest(string[] transferIdProductIdUserProductIdCarIdStrings)
@ -470,7 +469,7 @@ namespace TIAM.Database.Test
transferDest.Price = 20000;
transferDest.Address.AddressText = modifiedAddress;
Assert.IsTrue(await Dal.UpdateTransferDestinationAsync(transferDest));
transferDest = Dal.GetTransferDestinationById(transferDestId);
@ -513,7 +512,7 @@ namespace TIAM.Database.Test
var emailMessages = await Dal.GetEmailMessagesAsync(userId, userProductMappingId);
Assert.IsNotNull(emailMessages);
Assert.IsTrue(emailMessages.Count > 0);
Assert.IsTrue(emailMessages.All(x => x.Recipients.Any(recipient => recipient.RecipientId == userId || recipient.RecipientId == userProductMappingId)));
}
@ -531,7 +530,7 @@ namespace TIAM.Database.Test
var subject = "Transfer - Budapest, Liszt Ferenc tér";
var text = "1211 Budapest, Kossuth Lajos utca 145";
await Dal.RemoveEmailMessageAsync(emailMessageId); //kitöröljük a szemetet, ha korábbról bentmaradt - J.
var emailMessage = new EmailMessage(emailMessageId, senderId, contextId, subject, text, senderEmail);
@ -548,7 +547,7 @@ namespace TIAM.Database.Test
var modifiedText = "modifiedText";
emailMessage.Text = modifiedText;
Assert.IsTrue(await Dal.UpdateEmailMessageAsync(emailMessage));
@ -567,51 +566,6 @@ namespace TIAM.Database.Test
}
#endregion EmailMessage
#region User
[DataTestMethod]
[DataRow(["e31044d7-1771-4a32-8dd9-6f9853ed53c6", "0a831191-70a3-4504-9ec4-c5902affaba7", "8eed080c-d2ce-4cc3-bcfe-2268c220bba7", "addUser_test9432@tiam.hu"])]
public async Task AddUserTest(string[] userIdProfileIdAddressIdEmailStrings)
{
var userId = Guid.Parse(userIdProfileIdAddressIdEmailStrings[0]);
var profileId = Guid.Parse(userIdProfileIdAddressIdEmailStrings[1]);
var addressId = Guid.Parse(userIdProfileIdAddressIdEmailStrings[2]);
var email = userIdProfileIdAddressIdEmailStrings[3];
var fromAddress = "Budapest, Liszt Ferenc tér";
var toAddress = "1211 Budapest, Kossuth Lajos utca 145";
//var userProductToCarId = Guid.Parse("97179a87-d99f-4f12-b7b2-75e21aaec6ab");
await Dal.RemoveUserAsync(userId); //kitöröljük a szemetet, ha korábbról bentmaradt - J.
var user = new User(userId, email, "235664", "dsfglfjg45r34903t3kggvq");
//user.ProfileId = profileId;
var profile = new Profile();
profile.Id = profileId;;
profile.Name = "Add user test name";
var address = new Address();
address.Id = addressId;
address.Latitude = 5362.2341652256;
address.Longitude = 5362.2341333317;
address.AddressText = "1214 Kossuth Lajos utca 124.";
user.Profile = profile;
user.Profile.Address = address;
Assert.IsTrue(await Dal.AddUser(user));
user = Dal.GetUserById(userId);
Assert.IsNotNull(user);
Assert.IsNotNull(user.Profile);
Assert.IsNotNull(user.Profile.Address);
Assert.IsTrue(await Dal.RemoveUserAsync(userId)); //mielőbb kitöröljük, h ne maradjon szemét a db-ben - J.
user = Dal.GetUserById(userId);
Assert.IsNull(user); //a korábbi törlés miatt NULL kell legyen - J.
}
#endregion
}
}

View File

@ -10,15 +10,15 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="8.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="8.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="MSTest.TestAdapter" Version="3.2.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.2.2" />
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

View File

@ -9,12 +9,10 @@ using TIAM.Database.DbSets.Permissions;
using TIAM.Database.DbSets.Products;
using TIAM.Database.DbSets.Transfers;
using TIAM.Database.DbSets.Users;
using TIAM.Entities.Addresses;
using TIAM.Entities.Drivers;
using TIAM.Entities.Emails;
using TIAM.Entities.Permissions;
using TIAM.Entities.Products;
using TIAM.Entities.Profiles;
using TIAM.Entities.ServiceProviders;
using TIAM.Entities.Transfers;
using TIAM.Entities.Users;
@ -94,27 +92,6 @@ namespace TIAM.Database.DataLayers.Admins
public string? GetUserJsonById(Guid userId) => Session(ctx => ctx.GetUserById(userId)?.ToJson());
public string GetUsersJson() => Session(ctx => ctx.Users.ToJson());
public Task<bool> AddUser(User user) => TransactionAsync(ctx => ctx.AddUser(user));
public Task<bool> AddUser(User user, string profileName, Address address)
{
return TransactionAsync(ctx =>
{
var profile = Activator.CreateInstance<Profile>();
profile.Id = Guid.NewGuid();
profile.Name = profileName;
profile.Address = address;
user.Profile= profile;
return ctx.AddUser(user);
});
}
public Task<bool> RemoveUserAsync(User user) => TransactionAsync(ctx => ctx.RemoveUserAsync(user));
public Task<bool> RemoveUserAsync(Guid userId) => TransactionAsync(ctx => ctx.RemoveUserAsync(userId));
public Product? GetProductById(Guid contextId, bool includeUsers = true) => Session(ctx => ctx.GetProductById(contextId, includeUsers));
public string GetProductsJson(bool includeUsers = true) => Session(ctx => ctx.ProductsWithUserRelations(includeUsers).ToJson());

View File

@ -7,9 +7,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="8.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="8.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

View File

@ -32,7 +32,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="8.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="8.0.1" />
</ItemGroup>
</Project>

View File

@ -64,7 +64,7 @@
<ProjectReference Include="..\TIAM.Entities\TIAM.Entities.csproj" />
<ProjectReference Include="..\TIAMSharedUI\TIAMSharedUI.csproj" />
<ProjectReference Include="..\TIAMWebApp\Shared\TIAMWebApp.Shared.Application.csproj" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" VersionOverride="7.0.1" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" VersionOverride="7.0.1" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
@ -83,15 +83,15 @@
</ItemGroup>
<ItemGroup>
<PackageReference Update="Microsoft.AspNetCore.Components.WebView.Maui" Version="8.0.14" />
<PackageReference Update="Microsoft.AspNetCore.Components.WebView.Maui" Version="8.0.6" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="Microsoft.Maui.Controls" Version="8.0.14" />
<PackageReference Update="Microsoft.Maui.Controls" Version="8.0.6" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="Microsoft.Maui.Controls.Compatibility" Version="8.0.14" />
<PackageReference Update="Microsoft.Maui.Controls.Compatibility" Version="8.0.6" />
</ItemGroup>
</Project>

View File

@ -15,8 +15,8 @@
<PackageReference Include="Blazor.AnimateOnScroll" Version="1.1.0" />
<PackageReference Include="BlazorAnimation" Version="2.2.0" />
<PackageReference Include="DevExpress.Blazor" Version="23.2.3" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.3" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="8.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="8.0.1" />
</ItemGroup>
<ItemGroup>

View File

@ -10,9 +10,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Blazored.LocalStorage" Version="4.5.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.3" PrivateAssets="all" />
<PackageReference Include="Blazored.LocalStorage" Version="4.4.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.1" PrivateAssets="all" />
<PackageReference Include="SkiaSharp" Version="2.88.7" />
<PackageReference Include="SkiaSharp.Views.Desktop.Common" Version="2.88.7" />
</ItemGroup>

View File

@ -9,7 +9,7 @@ namespace TIAMWebApp.Server.Services
public class TransferBackendService
{
private readonly IConfiguration _configuration;
private readonly AdminDal _adminDal;
public AdminDal _adminDal;
public TransferBackendService(IConfiguration configuration, AdminDal adminDal)
{
@ -42,14 +42,14 @@ namespace TIAMWebApp.Server.Services
var price = GetSeatNumberPrice(in tranferDestinationPrice, seatNumber);
//TODO: ExtraPrice - J.
//if (baseDestination.Id == fromTransferDestination.Id && )
return price;
}
public double GetSeatNumberPrice(in ITransfeDestinationPrices transfeDestinationPrices, in byte seatNumber)
=> GetSeatNumberPrice(transfeDestinationPrices.Price, transfeDestinationPrices.Price2, transfeDestinationPrices.Price3, seatNumber);
public double GetSeatNumberPrice(double price, in double? price2, in double? price3, in byte seatNumber)
public double GetSeatNumberPrice(in double price, in double? price2, in double? price3, in byte seatNumber)
{
return seatNumber switch
{

View File

@ -11,12 +11,12 @@
<ItemGroup>
<PackageReference Include="GoogleApi" Version="5.3.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.3" />
<PackageReference Include="Microsoft.OpenApi" Version="1.6.14" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.1" />
<PackageReference Include="Microsoft.OpenApi" Version="1.6.12" />
<PackageReference Include="QRCoderNetCore" Version="1.0.0" />
<PackageReference Include="SendGrid" Version="9.29.2" />
<PackageReference Include="SendGrid" Version="9.29.1" />
<PackageReference Include="SkiaSharp" Version="2.88.7" />
<PackageReference Include="SkiaSharp.Views.Desktop.Common" Version="2.88.7" />
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="6.5.0" />

View File

@ -17,9 +17,9 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="8.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Http.Features" Version="5.0.17" />
<PackageReference Include="Microsoft.JSInterop" Version="8.0.3" />
<PackageReference Include="Microsoft.JSInterop" Version="8.0.1" />
<PackageReference Include="SkiaSharp" Version="2.88.7" />
<PackageReference Include="SkiaSharp.Views.Desktop.Common" Version="2.88.7" />
</ItemGroup>

View File

@ -37,11 +37,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TIAM.Models", "TIAM.Models\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TIAM.Resources", "TIAMResources\TIAM.Resources.csproj", "{2A300982-AA2E-4E62-97F2-6EF4C97939B2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DD32C7C2-218C-4148-8FD6-1AB3C824A7D5}"
ProjectSection(SolutionItems) = preProject
SqlSchemaCompare_Dev_to_DevRelease.scmp = SqlSchemaCompare_Dev_to_DevRelease.scmp
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU